Parent

Class Index [+]

Quicksearch

Gem::Commands::BuildCommand

Public Class Methods

new() click to toggle source
   # File lib/rubygems/commands/build_command.rb, line 6
6:   def initialize
7:     super('build', 'Build a gem from a gemspec')
8:   end

Public Instance Methods

execute() click to toggle source
    # File lib/rubygems/commands/build_command.rb, line 18
18:   def execute
19:     gemspec = get_one_gem_name
20:     if File.exist?(gemspec)
21:       specs = load_gemspecs(gemspec)
22:       specs.each do |spec|
23:         Gem::Builder.new(spec).build
24:       end
25:     else
26:       alert_error "Gemspec file not found: #{gemspec}"
27:     end
28:   end
load_gemspecs(filename) click to toggle source
    # File lib/rubygems/commands/build_command.rb, line 30
30:   def load_gemspecs(filename)
31:     if yaml?(filename)
32:       result = []
33:       open(filename) do |f|
34:         begin
35:           while not f.eof? and spec = Gem::Specification.from_yaml(f)
36:             result << spec
37:           end
38:         rescue Gem::EndOfYAMLException => e
39:           # OK
40:         end
41:       end
42:     else
43:       result = [Gem::Specification.load(filename)]
44:     end
45:     result
46:   end
yaml?(filename) click to toggle source
    # File lib/rubygems/commands/build_command.rb, line 48
48:   def yaml?(filename)
49:     line = open(filename) { |f| line = f.gets }
50:     result = line =~ %{!ruby/object:Gem::Specification}
51:     result
52:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.