Permalink
Browse files

simplify pkging process

  • Loading branch information...
1 parent 96e140e commit 8d409644624be9e1a779450a98366fc27717c131 @sr committed Dec 23, 2009
Showing with 53 additions and 26 deletions.
  1. +12 −26 Rakefile
  2. +41 −0 rack-client.gemspec
View
@@ -1,9 +1,8 @@
require 'rake'
-require "rake/gempackagetask"
require "rake/clean"
require "spec/rake/spectask"
-require 'bundler'
-require File.expand_path("./lib/rack/client")
+
+require "lib/rack/client"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_files = FileList['spec/*_spec.rb']
@@ -12,31 +11,18 @@ end
task :default => :spec
-spec = Gem::Specification.new do |s|
- s.name = "rack-client"
- s.rubyforge_project = s.name
- s.version = Rack::Client::VERSION
- s.author = "Tim Carey-Smith"
- s.email = "tim" + "@" + "spork.in"
- s.homepage = "http://github.com/halorgium/rack-client"
- s.summary = "A client wrapper around a Rack app or HTTP"
- s.description = s.summary
- s.files = %w[History.txt LICENSE README.textile Rakefile] + Dir["lib/**/*"] + Dir["demo/**/*"]
- s.test_files = Dir["spec/**/*"]
+directory "pkg/"
+CLOBBER.include "pkg"
- manifest = Bundler::Dsl.load_gemfile(File.dirname(__FILE__) + '/Gemfile')
- manifest.dependencies.each do |d|
- next unless d.only && d.only.include?('release')
- s.add_dependency(d.name, d.version)
- end
-end
+GEM = "pkg/rack-client-#{Rack::Client::VERSION}.gem"
-Rake::GemPackageTask.new(spec) do |package|
- package.gem_spec = spec
+desc "Build the gem"
+file GEM => "pkg/" do |f|
+ sh "gem exec gem build rack-client.gemspec"
+ mv File.basename(f.name), f.name
end
-desc 'Install the package as a gem.'
-task :install => [:clean, :package] do
- gem = Dir['pkg/*.gem'].first
- sh "sudo gem install --no-rdoc --no-ri --local #{gem}"
+desc "Install the gem"
+task :install => GEM do
+ sh "gem install --no-rdoc --no-ri --local #{GEM}"
end
View
@@ -0,0 +1,41 @@
+require "lib/rack/client"
+require "bundler"
+
+Gem::Specification.new do |s|
+ s.name = "rack-client"
+ s.version = Rack::Client::VERSION
+ s.author = "Tim Carey-Smith"
+ s.email = "tim@spork.in"
+ s.homepage = "http://github.com/halorgium/rack-client"
+ s.summary = "A client wrapper around a Rack app or HTTP"
+ s.description = s.summary
+ s.files = %w[
+.gitignore
+Gemfile
+History.txt
+LICENSE
+README.textile
+Rakefile
+demo/client.rb
+demo/config.ru
+demo/demo.rb
+demo/demo_spec.rb
+lib/rack/client.rb
+lib/rack/client/auth.rb
+lib/rack/client/follow_redirects.rb
+lib/rack/client/http.rb
+spec/apps/example.org.ru
+spec/auth_spec.rb
+spec/core_spec.rb
+spec/endpoint_spec.rb
+spec/https_spec.rb
+spec/middleware_spec.rb
+spec/quality_spec.rb
+spec/redirect_spec.rb
+spec/spec_helper.rb
+]
+
+ Bundler::Dsl.load_gemfile("Gemfile").dependencies.
+ reject { |d| d.only && d.only.include?("release") }.
+ each { |d| s.add_dependency(d.name, d.version) }
+end

0 comments on commit 8d40964

Please sign in to comment.