Sha256: 5b454c7cadb44480638027d09905166c3f0022b1fd2d050ae130a4b26f705683

Contents?: true

Size: 592 Bytes

Versions: 4

Compression:

Stored size: 592 Bytes

Contents

require "open3"

module Bundleup
  class BundleCommands
    include Console

    def outdated
      run(%w[bundle outdated], true)
    end

    def list
      run(%w[bundle list])
    end

    def update(args=[])
      run(%w[bundle update] + args)
    end

    private

    def run(cmd, fail_silently=false)
      cmd_line = cmd.join(" ")
      progress("Running `#{cmd_line}`") do
        out, err, status = Open3.capture3(*cmd)
        next(out) if status.success? || fail_silently

        raise ["Failed to execute: #{cmd_line}", out, err].compact.join("\n")
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bundleup-1.2.0 lib/bundleup/bundle_commands.rb
bundleup-1.1.0 lib/bundleup/bundle_commands.rb
bundleup-1.0.0 lib/bundleup/bundle_commands.rb
bundleup-0.9.0 lib/bundleup/bundle_commands.rb