Skip to content
This repository
Browse code

Adding better gem management tools to Raketask

  • Loading branch information...
commit eecb0a346829e83c4895b0834308f492116b70ab 1 parent 6d9be1c
Jacques Crocker authored October 04, 2010
4  Gemfile
... ...
@@ -1,6 +1,8 @@
1 1
 source :rubygems
2 2
 gemspec
3 3
 
  4
+gem "rake"
  5
+
4 6
 gem "rspec", ">= 2.0.0.beta"
5 7
 
6  
-gem "ruby-debug"
  8
+gem "ruby-debug"
4  Gemfile.lock
... ...
@@ -1,7 +1,7 @@
1 1
 PATH
2 2
   remote: .
3 3
   specs:
4  
-    jammit-s3 (0.5.3.0)
  4
+    jammit-s3 (0.5.3.1)
5 5
       jammit (>= 0.5.3)
6 6
       mimemagic (>= 0.1.7)
7 7
       s3 (>= 0.3.4)
@@ -18,6 +18,7 @@ GEM
18 18
     linecache (0.43)
19 19
     mimemagic (0.1.7)
20 20
     proxies (0.2.1)
  21
+    rake (0.8.7)
21 22
     rspec (2.0.0.beta.22)
22 23
       rspec-core (= 2.0.0.beta.22)
23 24
       rspec-expectations (= 2.0.0.beta.22)
@@ -44,6 +45,7 @@ DEPENDENCIES
44 45
   jammit (>= 0.5.3)
45 46
   jammit-s3!
46 47
   mimemagic (>= 0.1.7)
  48
+  rake
47 49
   rspec (>= 2.0.0.beta)
48 50
   ruby-debug
49 51
   s3 (>= 0.3.4)
27  Rakefile
... ...
@@ -1,15 +1,22 @@
1  
-require 'rake/testtask'
  1
+require 'rubygems'
2 2
 
3  
-task :gem => "gem:build"
4  
-
5  
-
6  
-namespace :gem do
7  
-  desc "Build the jammit gem"
8  
-  task :build do
9  
-    sh "mkdir -p pkg"
10  
-    sh "gem build jammit-s3.gemspec"
11  
-  end
  3
+require "bundler"
  4
+Bundler.setup
12 5
 
  6
+require 'rake'
  7
+require 'rake/gempackagetask'
13 8
 
  9
+gemspec = eval(File.read('jammit-s3.gemspec'))
  10
+Rake::GemPackageTask.new(gemspec) do |pkg|
  11
+  pkg.gem_spec = gemspec
14 12
 end
15 13
 
  14
+desc "build the gem and release it to rubygems.org"
  15
+task :release => :gem do
  16
+  puts "Tagging #{gemspec.version}..."
  17
+  system "git tag -a #{gemspec.version} -m 'Tagging #{gemspec.version}'"
  18
+  puts "Pushing to Github..."
  19
+  system "git push --tags"
  20
+  puts "Pushing to rubygems.org..."
  21
+  system "gem push pkg/#{gemspec.name}-#{gemspec.version}.gem"
  22
+end
2  jammit-s3.gemspec
... ...
@@ -1,6 +1,6 @@
1 1
 Gem::Specification.new do |s|
2 2
   s.name      = 'jammit-s3'
3  
-  s.version   = '0.5.3.0'
  3
+  s.version   = '0.5.3.1'
4 4
 
5 5
   s.homepage    = "http://documentcloud.github.com/jammit/"
6 6
   s.summary     = "Asset Packaging for Rails with Deployment to S3/Cloudfront"

0 notes on commit eecb0a3

Please sign in to comment.
Something went wrong with that request. Please try again.