Class: Jeweler::Commands::ReleaseToRubyforge
- Inherits:
-
Object
- Object
- Jeweler::Commands::ReleaseToRubyforge
- Defined in:
- lib/jeweler/commands/release_to_rubyforge.rb
Instance Attribute Summary collapse
-
#gemspec ⇒ Object
Returns the value of attribute gemspec.
-
#gemspec_helper ⇒ Object
Returns the value of attribute gemspec_helper.
-
#output ⇒ Object
Returns the value of attribute output.
-
#rubyforge ⇒ Object
Returns the value of attribute rubyforge.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ReleaseToRubyforge
constructor
A new instance of ReleaseToRubyforge.
- #run ⇒ Object
Constructor Details
#initialize ⇒ ReleaseToRubyforge
Returns a new instance of ReleaseToRubyforge.
8 9 10 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 8 def initialize self.output = $stdout end |
Instance Attribute Details
#gemspec ⇒ Object
Returns the value of attribute gemspec.
6 7 8 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 6 def gemspec @gemspec end |
#gemspec_helper ⇒ Object
Returns the value of attribute gemspec_helper.
6 7 8 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 6 def gemspec_helper @gemspec_helper end |
#output ⇒ Object
Returns the value of attribute output.
6 7 8 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 6 def output @output end |
#rubyforge ⇒ Object
Returns the value of attribute rubyforge.
6 7 8 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 6 def rubyforge @rubyforge end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 6 def version @version end |
Class Method Details
.build_for(jeweler) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 38 def self.build_for(jeweler) command = new command.gemspec = jeweler.gemspec command.gemspec_helper = jeweler.gemspec_helper command.version = jeweler.version command.rubyforge = jeweler.rubyforge command.output = jeweler.output command end |
Instance Method Details
#run ⇒ Object
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 |
# File 'lib/jeweler/commands/release_to_rubyforge.rb', line 12 def run raise NoRubyForgeProjectInGemspecError unless @gemspec.rubyforge_project @rubyforge.configure rescue nil output.puts 'Logging in rubyforge' @rubyforge.login @rubyforge.userconfig['release_notes'] = @gemspec.description if @gemspec.description @rubyforge.userconfig['preformatted'] = true output.puts "Releasing #{@gemspec.name}-#{@version} to #{@gemspec.rubyforge_project}" begin @rubyforge.add_release(@gemspec.rubyforge_project, @gemspec.name, @version.to_s, @gemspec_helper.gem_path) rescue StandardError => e case e. when /no <group_id> configured for <#{Regexp.escape @gemspec.rubyforge_project}>/ raise RubyForgeProjectNotConfiguredError, @gemspec.rubyforge_project when /no <package_id> configured for <#{Regexp.escape @gemspec.name}>/i raise MissingRubyForgePackageError, @gemspec.name else raise end end end |