Sha256: 8b7c9bf4585da48756b34614dea5020bc820e89c85c4d96010b300787fdccf7f

Contents?: true

Size: 1.72 KB

Versions: 25

Compression:

Stored size: 1.72 KB

Contents

# Shellany

Shellany captures command output.

## Features:

- portability (should work on recent JRuby versions)
- capturing stdout, stderr in a convenient way
- returning the result in a convenient way
- detecting if a shell is needed (though incomplete/primitive implementation)
- prevents running the same command multiple times

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'shellany'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install shellany

## Usage

Basic usage:

```ruby
require 'shellany/sheller'

Shellany::Sheller.stdout("echo abc") # => "abc"
Shellany::Sheller.stderr("touch /foo") # => "touch: cannot touch  ‘/aef’: Permission denied
Shellany::Sheller.run("false") # => false
Shellany::Sheller.system("clear") # => clears screen (no capture done)
```

Using Sheller object:

```ruby
require 'shellany/sheller'

sh = Shellany::Sheller.new('grep /etc/passed|tail -n 1') # does nothing

sh.stdout # shows output (runs the command since it wasn't run)
sh.stderr # shows stderr (does not run the command)
sh.ok? # returns true if exit code was zero (does not run the command)
```

## Project status

Only developed enough for Guard to run, though pull requests are more than welcome.

Especially for:

- better API
- better shell detection code
- better support for various system() arguments
- better support for redireciton handling
- better support for shell detection (e.g. Windows)

## Contributing

1. Fork it ( https://github.com/[my-github-username]/shellany/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 a new Pull Request

Version data entries

25 entries across 25 versions & 9 rubygems

Version Path
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.35 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.34 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.33 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.32 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.31 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.30 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.29 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.28 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.27 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.26 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
qiita_org-0.1.25 gems/ruby/2.7.0/gems/shellany-0.0.1/README.md
alimentos-alu0100945645-0.1.0 vendor/bundle/ruby/2.3.0/gems/shellany-0.0.1/README.md
alimentos-alu0100945645-1.0.0 vendor/bundle/ruby/2.3.0/gems/shellany-0.0.1/README.md
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/shellany-0.0.1/README.md
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/shellany-0.0.1/README.md
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/shellany-0.0.1/README.md
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/shellany-0.0.1/README.md
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/shellany-0.0.1/README.md
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/shellany-0.0.1/README.md