Class: Gem::Commands::ClasspathCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems/commands/classpath_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClasspathCommand

Returns a new instance of ClasspathCommand.



9
10
11
12
# File 'lib/rubygems/commands/classpath_command.rb', line 9

def initialize
  super 'classpath', "Given a Gemfile, returns the classpath necessary to satisfy dependencies"
  @cp_builder = JavaGems::ClasspathBuilder.new
end

Instance Attribute Details

#cp_builderObject (readonly)

Returns the value of attribute cp_builder.



7
8
9
# File 'lib/rubygems/commands/classpath_command.rb', line 7

def cp_builder
  @cp_builder
end

Instance Method Details

#executeObject



18
19
20
21
22
23
# File 'lib/rubygems/commands/classpath_command.rb', line 18

def execute
  say(@cp_builder.classpath_for(options[:args].first))
rescue => e
  alert_error(e.message)
  exit 1
end

#usageObject



14
15
16
# File 'lib/rubygems/commands/classpath_command.rb', line 14

def usage
  "#{program_name} [GEMFILE]"
end