Module: Backticks
- Defined in:
- lib/backticks.rb,
lib/backticks/cli.rb,
lib/backticks/ext.rb,
lib/backticks/runner.rb,
lib/backticks/command.rb,
lib/backticks/version.rb
Defined Under Namespace
Modules: CLI, Ext Classes: Command, Runner
Constant Summary collapse
- VERSION =
"1.0.5"
Class Method Summary collapse
-
.new(*sugar) ⇒ Backticks::Command
Run a command with default invocation options; return a Command object that can be used to interact with the running process.
-
.run(*sugar) ⇒ String
Run a command with default invocation options; wait for to exit, then return its output.
-
.system(*sugar) ⇒ Boolean
Run a command; return whether it succeeded or failed.
Class Method Details
.new(*sugar) ⇒ Backticks::Command
Run a command with default invocation options; return a Command object that can be used to interact with the running process.
15 16 17 |
# File 'lib/backticks.rb', line 15 def self.new(*sugar) Backticks::Runner.new.run(*sugar) end |
.run(*sugar) ⇒ String
Run a command with default invocation options; wait for to exit, then return its output. Populate $? with the command’s status before returning.
26 27 28 29 30 |
# File 'lib/backticks.rb', line 26 def self.run(*sugar) command = self.new(*sugar) command.join command.captured_output end |
.system(*sugar) ⇒ Boolean
Run a command; return whether it succeeded or failed.
38 39 40 41 42 |
# File 'lib/backticks.rb', line 38 def self.system(*sugar) command = self.new(*sugar) command.join $?.success? end |