Method: Pik::Info#execute

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

#executeObject



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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/pik/commands/info_command.rb', line 9

def execute
  puts pik_version
  
  ruby = check_path
  
  ruby_version = find_config_from_path(ruby)
  current = config[ruby_version]
  gem_home = current[:gem_home] || actual_gem_home
  ruby_version = Pik::VersionParser.parse(ruby_version)

  puts info ="\nruby:\ninterpreter:  \"\#{ruby_version.interpreter}\"\nversion:      \"\#{ruby_version.version}\"\ndate:         \"\#{ruby_version.date}\"\nplatform:     \"\#{ruby_version.platform}\"\npatchlevel:   \"\#{ruby_version.patchlevel}\"\nfull_version: \"\#{ruby_version.full_version}\"\n\nhomes:\ngem:          \"\#{gem_home}\"\nruby:         \"\#{ruby.dirname}\"\n\nbinaries:\nruby:         \"\#{ruby}\"\nirb:          \"\#{Which::Irb.exe}\"\ngem:          \"\#{Which::Gem.exe}\"\nrake:         \"\#{Which::Rake.exe}\"\n\nenvironment:\nGEM_HOME:     \"\#{ENV['GEM_HOME']}\"\nHOME:         \"\#{ENV['HOME']}\"\nIRBRC:        \"\#{ENV['IRBRC']}\"\nRUBYOPT:      \"\#{ENV['RUBYOPT']}\"\n\nfile associations:\n.rb:           \#{file_associations('.rb')}\n.rbw:          \#{file_associations('.rbw')}\n"
end