Class: Natives::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/natives/cli.rb

Instance Method Summary collapse

Instance Method Details

#detectObject



30
31
32
33
# File 'lib/natives/cli.rb', line 30

def detect
  app = Apps::Detect.new
  puts app.detection_info
end

#list(*entry_names) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/natives/cli.rb', line 13

def list(*entry_names)
  app = Apps::List.new

  catalog_name = options[:catalog]
  if catalog_name == 'rubygems' && entry_names.empty?
    packages = app.natives_for_gemfile(options[:gemfile])
  else
    packages = app.natives_for(catalog_name, entry_names)
  end

  puts packages
rescue => ex
  $stderr.puts ex.message
end

#versionObject



37
38
39
40
41
42
# File 'lib/natives/cli.rb', line 37

def version
  version_file = File.expand_path(File.join(
    File.dirname(__FILE__), '..', '..', 'VERSION'))

  puts IO.read(version_file)
end