Method: Pik::Run#execute

Defined in:
lib/pik/commands/run_command.rb

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pik/commands/run_command.rb', line 7

def execute
  check_args
  @config.sort.each do |version,hash|
    begin
      switch_path_to(hash)
      switch_gem_home_to(hash[:gem_home])
      echo_ruby_version(hash[:path])
      system command
      puts
    rescue => e
      version = version.split(': ')[1..-1].join(': ')
      puts version
      Pik.print_error(e)
    end
  end
end