Check if a filename is safe to use in a path join operation
Sanitize a string for use as a filename
Check if a filename is safe to use in a path join operation
Convert a string to a valid safe filename
shim for require.main.filename() that works in as many environments as possible
Generate a unique filename for use in temporary directories or caches.
Check if a string is a valid filename
Write files in an atomic fashion w/configurable ownership
Create and parse Content-Disposition header
Give a regex, get a robust predicate function that tests it against a string.
Return the filename and line number of the calling function
Easily read/write JSON files.
Safer Node.js Buffer API
Return the filename and line number of the calling function
Webpack loader that adjusts source maps
A deep deletion module for node (like `rm -rf`)
Regular expression for matching reserved filename characters
`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable
detect possibly catastrophic, exponential-time regular expressions
A JavaScript parser built from the Hermes engine
Modern Buffer API polyfill without footguns
Push an array of items into an array, while being robust against prototype modification
Fault-tolerant CSS parser for PostCSS
A lightweight Node.js module to recursively read files in a directory using ES6 Promises
Helper to make safe unique filenames in ruby
Converts string using filename safe characters.
Zaru takes a given filename (a string) and normalizes, filters and truncates it, so it can be safely used as a filename in modern operating systems. Zaru doesn't remove Unicode characters when not necessary.
Enhanced show-doc (a.k.a ? command) for: $! $" $$ $& $' $* $+ $, $-0 $-F $-I $-K $-W $-a $-d $-i $-l $-p $-v $-w $. $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $: $; $< $= $> $? $@ $DEBUG $FILENAME $KCODE $LOADED_FEATURES $LOAD_PATH $PROGRAM_NAME $SAFE $VERBOSE $\ $_ $` $stderr $stdin $stdout $~ $⁄ BEGIN END __ENCODING__ __FILE__ __LINE__ alias and begin break case class def defined? do else elsif end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield
Miscellaneous methods that may or may not be useful. sh:: Safely pass untrusted parameters to sh scripts. fork_and_check:: Run a block in a forked process and raise an exception if the process returns a non-zero value. do_and_exit, do_and_exit!:: Run a block. If the block does not run exit!, a successful exec or equivalent, run exit(1) or exit!(1) ourselves. Useful to make sure a forked block either runs a successful exec or dies. Any exceptions from the block are printed to standard error. overwrite:: Safely replace a file. Writes to a temporary file and then moves it over the old file. tempname_for:: Generates an unique temporary path based on a filename. The generated filename resides in the same directory as the original one. try_n_times:: Retries a block of code until it succeeds or a maximum number of attempts (default 10) is exceeded. Exception#to_formatted_string:: Returns a string that looks like how Ruby would dump an uncaught exception. IO#best_datasync:: Tries fdatasync, falling back to fsync, falling back to flush.
Miscellaneous methods that may or may not be useful. sh:: Safely pass untrusted parameters to sh scripts. Raise an exception if the script returns a non-zero value. fork_and_check:: Run a block in a forked process and raise an exception if the process returns a non-zero value. do_and_exit, do_and_exit!:: Run a block. If the block does not run exit!, a successful exec or equivalent, run exit(1) or exit!(1) ourselves. Useful to make sure a forked block either runs a successful exec or dies. Any exceptions from the block are printed to standard error. overwrite:: Safely replace a file. Writes to a temporary file and then moves it over the old file. tempname_for:: Generates an unique temporary path based on a filename. The generated filename resides in the same directory as the original one. try_n_times:: Retries a block of code until it succeeds or a maximum number of attempts (default 10) is exceeded. Exception#to_formatted_string:: Return a string that looks like how Ruby would dump an uncaught exception. IO#best_datasync:: Try fdatasync, falling back to fsync, falling back to flush. Random#exp:: Return a random integer 0 ≤ n < 2^argument (using SecureRandom). Random#float:: Return a random float 0.0 ≤ n < argument (using SecureRandom). Random#int:: Return a random integer 0 ≤ n < argument (using SecureRandom). Password:: A small wrapper for String#crypt that does secure salt generation and easy password verification.
# Dotbot: A Cute Lil' Dotfiles Manager I made a simple little dotfiles manager because I got tired of creating symlinks all the time. ## Installation You can install `dotbot` via the `gem` command: $ gem install dotbot Once you have it installed, either create a `~/.dotbot` file (YAML) with the following contents. ``` dir: ~/.dotfiles # or whatever your preferred location is ``` Optionally, instead of a .dotbot file, you can use environment variables, each of the pattern DOTBOT_<var>. For instance, you could execute some commands by saying $ DOTBOT_DIR=~/shnargleflorp dotbot update More commands and options to come later. ## Usage ### Track a New File $ dotbot track <filename> [--git] This command adds the file to your dotfiles repo and creates a symlink in the file's old location so it will stay updated. Use the `--git` flag to also add/commit/push to your remote dotfiles repo. ### Update Your Dotfiles $ dotbot update This command is pretty much just a `git pull` in your dotfiles repo. ## Development After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dotbot-mini. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). ## Code of Conduct Everyone interacting in the Dotbot::Mini project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rpalo/dotbot/blob/master/CODE_OF_CONDUCT.md).