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.



17
18
19
20
# File 'lib/rubygems/commands/classpath_command.rb', line 17

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.



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

def cp_builder
  @cp_builder
end

Instance Method Details

#executeObject



26
27
28
29
30
31
# File 'lib/rubygems/commands/classpath_command.rb', line 26

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

#usageObject



22
23
24
# File 'lib/rubygems/commands/classpath_command.rb', line 22

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