Permalink
Browse files

Reverted and locked down Rake version, cleaned up Gemfile, added a si…

…mple Rake script for testing packaging.
  • Loading branch information...
1 parent 2e851a0 commit 15b8e6f6dec8154a5e5e0dc12530406add0471f5 @bguthrie bguthrie committed Sep 27, 2011
View
@@ -9,7 +9,7 @@ PATH
jquery-rails (= 1.0.9)
rack (= 1.2.3)
rails (= 3.0.7)
- rake
+ rake (= 0.8.7)
tzinfo (= 0.3.27)
xml-simple (= 1.0.16)
@@ -81,7 +81,7 @@ GEM
activesupport (= 3.0.7)
rake (>= 0.8.7)
thor (~> 0.14.4)
- rake (0.9.2)
+ rake (0.8.7)
rcov (0.9.9)
rcov (0.9.9-java)
thor (0.14.6)
@@ -40,8 +40,6 @@ def self.data_root
end
class Application < Rails::Application
- include Rake::DSL
-
# Add additional load paths for your own custom dirs
config.autoload_paths << Rails.root.join('lib')
config.autoload_paths << Rails.root.join('lib', 'builder_plugins')
View
@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
+ENV["RAILS_ENV"] = "production"
ENV_PATH = File.expand_path("../config/environment", __FILE__)
require File.expand_path("../config/boot", __FILE__)
@@ -14,21 +14,26 @@ Gem::Specification.new do |s|
s.homepage = 'http://cruisecontrolrb.thoughtworks.com'
s.has_rdoc = false
- s.add_dependency "rails", "3.0.7"
- s.add_dependency "tzinfo", "0.3.27"
- s.add_dependency "rack", "1.2.3"
- s.add_dependency "bundler"
+ [ [ "rails", "3.0.7" ],
+ [ "tzinfo", "0.3.27" ],
+ [ "rack", "1.2.3" ],
+ [ "bundler", nil ],
+ [ "httparty", "0.6.1" ],
+ [ "api_cache", "0.2.0" ],
+ [ "xml-simple", '1.0.16' ],
+ [ "rake", "0.8.7" ],
+ [ "jquery-rails", '1.0.9' ],
+ [ "abstract", "1.0.0" ],
+ ].each do |gem, version|
+ s.add_dependency gem, version
+ end
- s.add_dependency "httparty", "0.6.1"
- s.add_dependency "api_cache", "0.2.0"
- s.add_dependency "xml-simple", '1.0.16'
- s.add_dependency "rake"
- s.add_dependency "jquery-rails", '1.0.9'
- s.add_dependency "abstract", "1.0.0"
-
- s.add_development_dependency "rcov", '0.9.9'
- s.add_development_dependency "mocha", "0.9.12"
- s.add_development_dependency "rack-test"
+ [ [ "rcov", '0.9.9' ],
+ [ "mocha", "0.9.12" ],
+ [ "rack-test", nil ],
+ ].each do |gem, version|
+ s.add_development_dependency gem, version
+ end
s.bindir = "."
s.executables << "cruise"
@@ -1,23 +1,18 @@
-gem_spec = load(Rails.root.join("cruisecontrolrb.gemspec"))
-
task :package => ["package:gem"]
namespace :package do
- def gem_file
- if gem_spec.platform == Gem::Platform::RUBY
- "#{gem_spec.full_name}.gem"
- else
- "#{gem_spec.full_name}-#{gem_spec.platform}.gem"
- end
- end
-
def package_dir
"pkg"
end
+ def gem_file
+ Pathname.glob("*.gem").first
+ end
+
+ desc "Package CruiseControl.rb as a gem."
task :gem => :prepare do
- Gem::Builder.new(gem_spec).build
- verbose(true) { mv gem_file, "#{package_dir}/#{gem_file}" }
+ system "gem build cruisecontrolrb.gemspec"
+ verbose(true) { gem_file.rename(package_dir) }
end
desc "Remove all existing packaged files."
@@ -26,7 +21,19 @@ namespace :package do
end
desc "Install all dependencies using Bundler's deployment mode."
- task :prepare => :clean do
- system "bundle install --deployment"
+ task :prepare => :clean
+
+ namespace :gem do
+ task :test => "package:gem" do
+ system "rvm gemset create ccrb-test"
+ system "rvm gemset use ccrb-test"
+ system "rvm --force gemset empty ccrb-test"
+
+ puts Pathname.glob("#{package_dir}/*.gem").inspect
+ gem_file = Pathname.glob("#{package_dir}/*.gem").first
+ system "gem install #{gem_file}"
+ system "cruise start"
+ system "rvm gemset use ccrb"
+ end
end
end
Binary file not shown.
Binary file not shown.

0 comments on commit 15b8e6f

Please sign in to comment.