Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'upgrade-infrastructure'
- Loading branch information
Showing
12 changed files
with
91 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.rvmrc | ||
.*.sw[pon] | ||
coverage | ||
doc/api | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
gem 'rake' | ||
gem 'rspec', '~> 1.3.1' | ||
gem 'cucumber', '~> 0.9.4' | ||
|
||
unless RUBY_PLATFORM =~ /java/ | ||
gem 'rcov', '~> 0.9.9' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
desc 'Ensure all the cross compiled versions are installed' | ||
task :bootstrap do | ||
fail "Sorry, this only works on OSX and Linux" if RUBY_PLATFORM =~ /mswin|mingw/ | ||
|
||
versions = %w(1.8.6-p398 1.9.1-p243 1.9.2-p0) | ||
|
||
versions.each do |version| | ||
puts "[INFO] Attempt to cross-compile Ruby #{version}" | ||
ruby "-Ilib bin/rake-compiler cross-ruby VERSION=#{version}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
require 'rake/clean' | ||
|
||
# common pattern cleanup | ||
CLEAN.include('tmp') | ||
CLEAN.include('tmp/project.*') | ||
|
||
# set default task | ||
task :default => [:spec, :features] | ||
|
||
# make packing depend on success of running specs and features | ||
task :package => [:spec, :features] | ||
|
||
# publish documentation when doing a release | ||
task :release => [:publish] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,39 @@ | ||
begin | ||
require 'rubyforge' | ||
rescue LoadError | ||
warn "rubyforge gem is required to generate announces, please install it (gem install rubyforge)." | ||
end | ||
|
||
CLEAN.include('email.txt') | ||
|
||
if defined?(RubyForge) then | ||
if defined?(GEM_SPEC) then | ||
desc 'Create news email file and post to RubyForge.' | ||
task :announce do |t| | ||
ver = ENV['VERSION'] or fail "Must supply VERSION (rake announce VERSION=x.y.z)." | ||
|
||
# compare versions to avoid mistakes | ||
unless ver == GEM_SPEC.version.to_s then | ||
fail "Version mismatch (supplied and specification versions differ)." | ||
end | ||
|
||
# no homepage? why announce it then?! | ||
if GEM_SPEC.homepage == 'TODO' or GEM_SPEC.homepage.nil? then | ||
fail "Must define homepage in your gem specification." | ||
end | ||
|
||
# no rubyforge project? no release for you! | ||
if GEM_SPEC.rubyforge_project == 'TODO' or GEM_SPEC.rubyforge_project.nil? then | ||
fail "Must define rubyforge_project in your gem specification." | ||
end | ||
|
||
# instantiate a RubyForge object | ||
rf = RubyForge.new.configure | ||
|
||
# read project info and overview | ||
notes = begin | ||
r = File.read("README.rdoc") | ||
r.split(/^(=+ .*)/)[1..4].join.strip | ||
rescue | ||
warn "Missing README.rdoc" | ||
'' | ||
end | ||
|
||
# read changes | ||
changes = begin | ||
h = File.read("History.txt") | ||
h.split(/^(===+ .*)/)[1..2].join.strip | ||
rescue | ||
warn "Missing History.txt" | ||
'' | ||
end | ||
|
||
# standard fields | ||
subject = "#{GEM_SPEC.name} #{GEM_SPEC.version} Released" | ||
title = "#{GEM_SPEC.name} version #{GEM_SPEC.version} has been released!" | ||
body = "#{notes}\n\nChanges:\n\n#{changes}" | ||
urls = [GEM_SPEC.homepage, "http://rubyforge.org/projects/#{GEM_SPEC.rubyforge_project}"].map { |u| "* <#{u.strip}>" }.join("\n") | ||
|
||
puts "Logging in RubyForge..." | ||
rf.login | ||
|
||
puts "Generating email.txt..." | ||
File.open("email.txt", "w") do |mail| | ||
mail.puts "Subject: [ANN] #{subject}" | ||
mail.puts | ||
mail.puts title | ||
mail.puts | ||
mail.puts urls | ||
mail.puts | ||
mail.puts body | ||
end | ||
puts "Created email.txt" | ||
|
||
puts "Posting news for #{GEM_SPEC.name} version #{GEM_SPEC.version}..." | ||
rf.post_news GEM_SPEC.rubyforge_project, subject, "#{title}\n\n#{body}" | ||
puts "Done." | ||
end | ||
else | ||
warn "no GEM_SPEC is found or defined. 'announce' task cannot work without it." | ||
end | ||
desc 'Generate email template to standard output' | ||
task :announce do | ||
fail "no GEM_SPEC is found or defined. 'announce' task cannot work without it." unless defined?(GEM_SPEC) | ||
|
||
# read project info and overview | ||
notes = begin | ||
r = File.read("README.rdoc") | ||
r.split(/^(=+ .*)/)[1..4].join.strip | ||
rescue | ||
warn "Missing README.rdoc" | ||
'' | ||
end | ||
|
||
# read changes | ||
changes = begin | ||
h = File.read("History.txt") | ||
h.split(/^(===+ .*)/)[1..2].join.strip | ||
rescue | ||
warn "Missing History.txt" | ||
'' | ||
end | ||
|
||
# standard fields | ||
subject = "#{GEM_SPEC.name} #{GEM_SPEC.version} Released" | ||
title = "#{GEM_SPEC.name} version #{GEM_SPEC.version} has been released!" | ||
body = "#{notes}\n\nChanges:\n\n#{changes}" | ||
urls = [GEM_SPEC.homepage].map { |u| "* <#{u.strip}>" }.join("\n") | ||
|
||
puts "=" * 80, "" | ||
puts "Subject: [ANN] #{subject}" | ||
puts | ||
puts title | ||
puts | ||
puts urls | ||
puts | ||
puts body | ||
puts | ||
puts "=" * 80, "" | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,26 @@ | ||
begin | ||
require 'rubyforge' | ||
rescue LoadError | ||
warn "rubyforge gem is required to generate releases, please install it (gem install rubyforge)." | ||
end | ||
|
||
if defined?(RubyForge) then | ||
if defined?(GEM_SPEC) then | ||
desc 'Package and upload to RubyForge' | ||
task :release => [:clobber, :package] do |t| | ||
ver = ENV['VERSION'] or fail "Must supply VERSION (rake release VERSION=x.y.z)." | ||
|
||
# compare versions to avoid mistakes | ||
unless ver == GEM_SPEC.version.to_s then | ||
fail "Version mismatch (supplied and specification versions differ)." | ||
end | ||
|
||
# no rubyforge project? no release for you! | ||
if GEM_SPEC.rubyforge_project == 'TODO' or GEM_SPEC.rubyforge_project.nil? then | ||
fail "Must define rubyforge_project in your gem specification." | ||
end | ||
|
||
# instantiate a RubyForge object | ||
rf = RubyForge.new | ||
desc 'Package gems and upload to RubyGems' | ||
task :release, :version, :needs => [:package] do |t, args| | ||
args.with_defaults(:version => "") | ||
ver = args.version | ||
|
||
# read project info and overview | ||
notes = begin | ||
r = File.read("README.rdoc") | ||
r.split(/^(=+ .*)/)[1..4].join.strip | ||
rescue | ||
warn "Missing README.rdoc" | ||
'' | ||
end | ||
fail "no GEM_SPEC is found or defined. 'release' task cannot work without it." unless defined?(GEM_SPEC) | ||
|
||
# read changes | ||
changes = begin | ||
h = File.read("History.txt") | ||
h.split(/^(===+ .*)/)[1..2].join.strip | ||
rescue | ||
warn "Missing History.txt" | ||
'' | ||
end | ||
|
||
# build the configuration for the release | ||
config = Hash.new | ||
config["release_notes"] = notes | ||
config["release_changes"] = changes | ||
config["preformatted"] = true | ||
|
||
# prepare configuration | ||
rf.configure config | ||
|
||
files = FileList["pkg/#{GEM_SPEC.name}-#{GEM_SPEC.version}*.*"].to_a | ||
fail "No files found for the release." if files.empty? | ||
# compare versions to avoid mistakes | ||
unless ver == GEM_SPEC.version.to_s then | ||
fail "Version mismatch (supplied and specification versions differ)." | ||
end | ||
|
||
puts "Logging in RubyForge..." | ||
rf.login | ||
files = FileList["pkg/#{GEM_SPEC.name}-#{GEM_SPEC.version}*.*"].to_a | ||
fail "No files found for the release." if files.empty? | ||
|
||
puts "Files to upload:" | ||
files.each do |f| | ||
puts " * #{f}" | ||
end | ||
puts "Files to release:" | ||
files.each do |f| | ||
puts " * #{f}" | ||
end | ||
|
||
puts "Releasing #{GEM_SPEC.name} version #{GEM_SPEC.version}..." | ||
rf.add_release GEM_SPEC.rubyforge_project, GEM_SPEC.name, GEM_SPEC.version, *files | ||
puts "Done." | ||
end | ||
else | ||
warn "no GEM_SPEC is found or defined. 'release' task cannot work without it." | ||
puts "Releasing #{GEM_SPEC.name} version #{GEM_SPEC.version}..." | ||
files.each do |f| | ||
system "gem push #{f}" | ||
end | ||
puts "Done." | ||
end |