Class: CapUtil::BundlerCmd
- Inherits:
-
Object
- Object
- CapUtil::BundlerCmd
- Includes:
- CapUtil
- Defined in:
- lib/cap-util/bundler_cmd.rb
Overview
This defines a base utiltiy for building bundler commands to run.
Defined Under Namespace
Modules: TestHelpers
Constant Summary
Constants included from CapUtil
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
Instance Method Summary collapse
-
#initialize(cap, cmd, opts = nil) ⇒ BundlerCmd
constructor
A new instance of BundlerCmd.
- #run ⇒ Object
Methods included from CapUtil
color, #get, halt, #hostname, included, run_locally, run_locally_with_stdin, say, say_bulleted, say_error, say_raw, say_warning, time
Constructor Details
#initialize(cap, cmd, opts = nil) ⇒ BundlerCmd
Returns a new instance of BundlerCmd.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cap-util/bundler_cmd.rb', line 12 def initialize(cap, cmd, opts = nil) opts ||= {} @cap = cap opts[:root] ||= :current_path opts[:env] ||= "" cmd_root = @cap.send(opts[:root]) @cmd = "cd #{cmd_root} && #{opts[:env]} bundle exec #{cmd}" end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
10 11 12 |
# File 'lib/cap-util/bundler_cmd.rb', line 10 def cmd @cmd end |
Instance Method Details
#run ⇒ Object
24 |
# File 'lib/cap-util/bundler_cmd.rb', line 24 def run; super(@cmd); end |