Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow bundler to automatically build a gem directly from git

Using bundler (now included with Rails 3.0), it's possible to fetch gems
directly from specific branches in a git repository.  This is very handy
for contributors and people who need to make small fixes.

With this patch applied, it's possible to include the following line
in a Gemfile:

  gem 'mail', :git => 'git://github.com/mikel/mail.git'

Then you can install the latest master branch using bundler:

  bundle install

This patch changes two things about the development process.  First,
gems are now built using:

  rake build

...or:

  gem build mail.gemspec

Second, the generated gemfile now appears in the top-level directory,
and not in a pkg/ subdirectory.
  • Loading branch information...
commit b094a2bbf08725b9e697043b11f280f554aad8cf 1 parent 1e665e4
@emk emk authored committed
Showing with 24 additions and 25 deletions.
  1. +1 −1  .gitignore
  2. +3 −24 Rakefile
  3. +20 −0 mail.gemspec
View
2  .gitignore
@@ -1,7 +1,7 @@
.bundle
coverage
gems
-pkg
+/mail-*.gem
rdoc
mail.tmproj
spec/fixtures/emails/failed_emails/
View
27 Rakefile
@@ -1,34 +1,13 @@
require File.expand_path('../spec/environment', __FILE__)
require 'rake/rdoctask'
-require 'rake/gempackagetask'
require 'rake/testtask'
require 'spec/rake/spectask'
require 'cucumber/rake/task'
-spec = Gem::Specification.new do |s|
- s.name = "mail"
- s.version = "2.2.0"
- s.author = "Mike Lindsaar"
- s.email = "raasdnil@gmail.com"
- s.homepage = "http://github.com/mikel/mail"
- s.description = "A really Ruby Mail handler."
- s.summary = "Mail provides a nice Ruby DSL for making, sending and reading emails."
-
- s.platform = Gem::Platform::RUBY
- s.has_rdoc = true
- s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "TODO.rdoc"]
-
- s.add_dependency('activesupport', ">= 2.3.4")
- s.add_dependency('mime-types')
- s.add_dependency('treetop', '>= 1.4.5')
-
- s.require_path = 'lib'
- s.files = %w(README.rdoc Rakefile TODO.rdoc) + Dir.glob("lib/**/*")
-end
-
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.gem_spec = spec
+desc "Build a gem file"
+task :build do
+ system "gem build mail.gemspec"
end
task :default => :spec
View
20 mail.gemspec
@@ -0,0 +1,20 @@
+Gem::Specification.new do |s|
+ s.name = "mail"
+ s.version = "2.2.0"
+ s.author = "Mike Lindsaar"
+ s.email = "raasdnil@gmail.com"
+ s.homepage = "http://github.com/mikel/mail"
+ s.description = "A really Ruby Mail handler."
+ s.summary = "Mail provides a nice Ruby DSL for making, sending and reading emails."
+
+ s.platform = Gem::Platform::RUBY
+ s.has_rdoc = true
+ s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "TODO.rdoc"]
+
+ s.add_dependency('activesupport', ">= 2.3.4")
+ s.add_dependency('mime-types')
+ s.add_dependency('treetop', '>= 1.4.5')
+
+ s.require_path = 'lib'
+ s.files = %w(README.rdoc Rakefile TODO.rdoc) + Dir.glob("lib/**/*")
+end
Please sign in to comment.
Something went wrong with that request. Please try again.