Sha256: cb34c4699cf0f76a6c0613cc4b73b50765e6d23099d29663c3499b2f5e311c79

Contents?: true

Size: 818 Bytes

Versions: 3

Compression:

Stored size: 818 Bytes

Contents

module Minke
  module Tasks
    class Bundle

      def initialize args
        @shell_helper = args[:shell_helper]
      end

      def run args = nil
        puts '### Install gems'
        rvm = "#{ENV['HOME']}/.rvm/scripts/rvm"
        rvm_root = '/usr/local/rvm/scripts/rvm'

        rvm_installed = @shell_helper.exist?(rvm)
        rvm_root_installed = @shell_helper.exist?(rvm_root)

        gemset = @shell_helper.read_file '.ruby-gemset'

        puts "Using gemset #{gemset}"

        rvm_command = "source #{rvm} && rvm gemset use #{gemset} --create && " if rvm_installed
        rvm_command = "source #{rvm_root} && rvm gemset use #{gemset} --create && " if rvm_root_installed

        @shell_helper.execute("/bin/bash -c '#{rvm_command}bundle install -j3 && bundle update'")
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minke-1.12.9 lib/minke/tasks/bundle.rb
minke-1.12.8 lib/minke/tasks/bundle.rb
minke-1.12.7 lib/minke/tasks/bundle.rb