No description
Find a file
2022-01-16 21:33:12 -08:00
.circleci Initial commit 2022-01-16 15:35:53 -08:00
.github Initialize the template project 2022-01-16 15:51:10 -08:00
bin Initialize the template project 2022-01-16 15:51:10 -08:00
exe Implement the most basic API possible 2022-01-16 18:22:54 -08:00
ext Implement the most basic API possible 2022-01-16 18:22:54 -08:00
lib Implement the most basic API possible 2022-01-16 18:22:54 -08:00
test Implement the most basic API possible 2022-01-16 18:22:54 -08:00
.gitignore Update .gitignore 2022-01-16 21:32:27 -08:00
.overcommit.yml Initial commit 2022-01-16 15:35:53 -08:00
.prettierignore Initial commit 2022-01-16 15:35:53 -08:00
.rubocop.yml Set rubocop's target Ruby version to 2.6 2022-01-16 15:54:59 -08:00
CHANGELOG.md Initialize the template project 2022-01-16 15:51:10 -08:00
CODE_OF_CONDUCT.md Initialize the template project 2022-01-16 15:51:10 -08:00
Gemfile Update rubocop-performance requirement from 1.13.1 to 1.13.2 2022-01-16 23:52:24 +00:00
Gemfile.lock Add Gemfile.lock 2022-01-16 21:12:38 -08:00
LICENSE.txt Initialize the template project 2022-01-16 15:51:10 -08:00
Rakefile Implement the most basic API possible 2022-01-16 18:22:54 -08:00
README.md s/GNU wordexp/wordexp/ 2022-01-16 18:28:09 -08:00
wordexp.gemspec Include wordexp executable in gem 2022-01-16 21:09:57 -08:00

wordexp

Gem Version Circle Code Climate Maintainability

A Ruby gem for performing shell word expansion using wordexp. It's like Shellwords turned up to 11. Not only does it split taking quotes into account, but it also expands environment variables and tildes, and runs subcommands in `backticks` or $(dollar parentheses).


Quick start

$ gem install wordexp
require 'wordexp'

cmd = Wordexp.expand("echo 'roof cats' $HOME ~/bin $(date +%F)")
# => ["echo", "roof cats", "/home/queso", "/home/queso/bin", "2022-01-16"]

fork { exec(*cmd) }
# roof cats /home/queso /home/queso/bin 2022-01-16

With that you're half way to a fairly usable shell in Ruby.

Support

If you want to report a bug, or have ideas, feedback or questions about the gem, let me know via GitHub issues and I will do my best to provide a helpful answer. Happy hacking!

License

The gem is available as open source under the terms of the MIT License.

Code of conduct

Everyone interacting in this projects codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Contribution guide

Pull requests are welcome! Make sure that new code is reasonably well tested and all the checks pass. I'm happy to provide a bit of direction and guidance if you're unsure how to proceed with any of these things.