0.0
No commit activity in last 3 years
No release in over 3 years
A simple command runner interface.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 0

Runtime

 Project Readme

ExecSimple

A simple command runner in Ruby.

ExecSimple.run 'echo 123'
=> ["123\n", "", 0]
ExecSimple.run 'echo "error message" >&2; exit 123'
=> ["", "error message\n", 123]

Handle timeouts:

ExecSimple.run 'echo "Legen... wait for it"; sleep 100; echo "DARY"', timeout: 1
=> ["Legen... wait for it\n", "", nil]

Integrate with logging:

require 'logging'
log = Logging.logger['main']
log.add_appenders(Logging.appenders.stdout)

ExecSimple.run 'echo "You will read this"; sleep 3; echo "before the end."', log: log
 INFO  main : You will read this
 INFO  main : before the end.
=> 0

Installation

Add this line to your application's Gemfile:

gem 'exec-simple'

And then execute:

$ bundle

Or install it yourself as:

$ gem install exec-simple

Contributing

  1. Fork it ( http://github.com/arlimus/exec-simple/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT