Class: Ddenv::Goals::BundleInstalled

Inherits:
Ddenv::Goal show all
Defined in:
lib/ddenv/goals/bundle_installed.rb

Instance Method Summary collapse

Methods inherited from Ddenv::Goal

#==, #eql?, #hash, #initialize, #post_goals, #props, #with_pre_and_post_goals

Constructor Details

This class inherits a constructor from Ddenv::Goal

Instance Method Details

#achieveObject



18
19
20
21
22
# File 'lib/ddenv/goals/bundle_installed.rb', line 18

def achieve
  # TODO: use :pretty when passing --verbose
  cmd = TTY::Command.new(printer: :null)
  cmd.run("shadowenv", "exec", "--", "bundle", "install")
end

#achieved?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'lib/ddenv/goals/bundle_installed.rb', line 10

def achieved?
  cmd = TTY::Command.new(printer: :null)
  cmd.run("shadowenv", "exec", "--", "bundle", "check")
  true
rescue StandardError
  false
end

#messageObject



6
7
8
# File 'lib/ddenv/goals/bundle_installed.rb', line 6

def message
  "Installing bundle"
end

#pre_goalsObject



24
25
26
27
28
# File 'lib/ddenv/goals/bundle_installed.rb', line 24

def pre_goals
  [
    GemInstalled.new("bundler")
  ]
end