Class: CapUtil::BundlerCmd

Inherits:
Object
  • Object
show all
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

VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cmdObject (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

#runObject



24
# File 'lib/cap-util/bundler_cmd.rb', line 24

def run; super(@cmd); end