Permalink
Browse files

Monkey-patched jeweler to work around Rubyforge's 3 character minimum…

… for package names.
  • Loading branch information...
btakita committed Aug 30, 2009
1 parent 03523a7 commit bedad843c7f0a6c517f0eda53db4c1c95f1c94c1
Showing with 40 additions and 1 deletion.
  1. +39 −0 Rakefile
  2. +1 −1 rr.gemspec
View
@@ -47,3 +47,42 @@ begin
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
+RUBYFORGE_PACKAGE_NAME = "rr (Double Ruby)"
+# The package was renamed from "rr (Double R)" to "rr (Double Ruby)".
+# When this was last run, the script did not work for the new name but it did work for the old name.
+# Perhaps more time was needed for the name change to propagate?
+#RUBYFORGE_PACKAGE_NAME = "rr (Double R)"
+
+# This is hacked to get around the 3 character limitation for package names on Rubyforge.
+# http://rubyforge.org/tracker/index.php?func=detail&aid=27026&group_id=5&atid=102
+class Jeweler
+ module Commands
+ class ReleaseToRubyforge
+ 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, RUBYFORGE_PACKAGE_NAME, @version.to_s, @gemspec_helper.gem_path)
+ rescue StandardError => e
+ case e.message
+ 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
+ end
+ end
+end
View
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brian Takita"]
- s.date = %q{2009-08-22}
+ s.date = %q{2009-08-30}
s.description = %q{RR (Double Ruby) is a double framework that features a rich selection of double techniques and a terse syntax. http://xunitpatterns.com/Test%20Double.html}
s.email = %q{brian@pivotallabs.com}
s.extra_rdoc_files = [

0 comments on commit bedad84

Please sign in to comment.