Class: Minke::Tasks::Fetch
Instance Method Summary collapse
Methods inherited from Task
#create_container_image, #initialize, #run_command_in_container, #run_with_block
Constructor Details
This class inherits a constructor from Minke::Tasks::Task
Instance Method Details
#run(args = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/minke/tasks/fetch.rb', line 5 def run args = nil puts "## Update dependencies" 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} && " if rvm_installed rvm_command = "source #{rvm_root} && rvm gemset use #{gemset} && " if rvm_root_installed @shell_helper.execute("/bin/bash -c '#{rvm_command}bundle install -j3 && bundle update'") puts '### Install generator dependencies' if @generator_config.build_settings.build_commands.fetch != nil run_with_block do @generator_config.build_settings.build_commands.fetch.each do |command| run_command_in_container command end end end end |