Permalink
Browse files

Add Gemfile, use Bundler::GemHelper

  • Loading branch information...
1 parent 28525ab commit c4d6a413470b126bb644ac8fb8fbce957b5350e9 Denis Odorcic committed Aug 19, 2011
Showing with 17 additions and 55 deletions.
  1. +2 −1 .gitignore
  2. +3 −0 Gemfile
  3. +7 −47 Rakefile
  4. +1 −7 lib/vendor/test_helper.rb
  5. +4 −0 test/test_helper.rb
View
3 .gitignore
@@ -3,4 +3,5 @@ test.xml
sample.rb
*.orig
pkg
-.dotest
+.dotest
+Gemfile.lock
View
3 Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+
+gemspec
View
54 Rakefile
@@ -1,23 +1,7 @@
-require 'rake'
-require 'rake/clean'
-require 'rake/testtask'
-require 'rake/gempackagetask'
-
-desc 'Run unit tests by default (and not remote tests)'
-task :default => 'test:units'
-
-desc 'Run all tests, including remote tests'
-task :test => ['test:units','test:remote']
-
-gemspec = eval(File.read('active_shipping.gemspec'))
+require 'bundler'
+Bundler::GemHelper.install_tasks
-Rake::GemPackageTask.new(gemspec) do |pkg|
- pkg.gem_spec = gemspec
-end
-
-desc "Default Task"
-task :default => 'test:units'
-task :test => ['test:units','test:remote']
+require 'rake/testtask'
namespace :test do
Rake::TestTask.new(:units) do |t|
@@ -33,32 +17,8 @@ namespace :test do
end
end
-desc "Validate the gemspec"
-task :gemspec do
- gemspec.validate
-end
-
-desc "Update common files from active_merchant directory"
-task :update_common do
- STDERR.puts "Updating common include from ../active_merchant. Please make sure this is up-to-date"
- system("diff -u lib/active_merchant/common.rb ../active_merchant/lib/active_merchant/common.rb | patch -p0")
- system("diff -ur lib/active_merchant/common ../active_merchant/lib/active_merchant/common | patch -p0")
- STDERR.puts "done.."
-end
-
-task :package => :gemspec
-
-desc "Build and install the gem"
-task :install => :package do
- sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
-end
-
-desc "Uninstall gem"
-task :uninstall => [ :clean ] do
- sh %{gem uninstall #{gemspec.name}}
-end
+desc "Default Task"
+task :default => 'test:units'
-desc "Release #{gemspec.name} gem (#{gemspec.version})"
-task :release => [ :test, :package ] do
- sh %{gem push pkg/#{gemspec.name}-#{gemspec.version}.gem}
-end
+desc "Run the unit and remote tests"
+task :test => ['test:units','test:remote']
View
8 lib/vendor/test_helper.rb
@@ -4,10 +4,4 @@
require 'test/unit'
require 'active_shipping'
-
-begin
- require 'mocha'
-rescue LoadError
- require 'rubygems'
- require 'mocha'
-end
+require 'mocha'
View
4 test/test_helper.rb
@@ -1,6 +1,10 @@
#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + '/../lib')
+require 'rubygems'
+require 'bundler'
+Bundler.setup
+
require 'test/unit'
require 'active_shipping'
require 'mocha'

0 comments on commit c4d6a41

Please sign in to comment.