class Bundleup::Commands
Constants
- GEMFILE_ENTRY_REGEXP
- OUTDATED_2_1_REGEXP
- OUTDATED_2_2_REGEXP
Public Instance Methods
check?()
click to toggle source
# File lib/bundleup/commands.rb, line 12 def check? shell.run?(%w[bundle check]) end
install()
click to toggle source
# File lib/bundleup/commands.rb, line 16 def install shell.run(%w[bundle install]) end
list()
click to toggle source
# File lib/bundleup/commands.rb, line 20 def list output = shell.capture(%w[bundle list]) output.scan(GEMFILE_ENTRY_REGEXP).each_with_object({}) do |(name, ver, sha), gems| gems[name] = sha || ver end end
outdated()
click to toggle source
# File lib/bundleup/commands.rb, line 27 def outdated output = shell.capture(%w[bundle outdated], raise_on_error: false) expr = output.match?(/^Gem\s+Current\s+Latest/) ? OUTDATED_2_2_REGEXP : OUTDATED_2_1_REGEXP output.scan(expr).each_with_object({}) do |(name, newest, pin), gems| gems[name] = { newest: newest, pin: pin } end end
update(args=[])
click to toggle source
# File lib/bundleup/commands.rb, line 36 def update(args=[]) shell.run(%w[bundle update] + args) end