From bd1877cab0a2f3c2dc8f4bf0d5b06340ee45d984 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 15 Oct 2010 12:53:33 +0100 Subject: [PATCH] Use Bundler to manage dependencies. --- .gitignore | 3 +++ Gemfile | 2 ++ Gemfile.lock | 34 ++++++++++++++++++++++++++++++++++ README.md | 2 +- Rakefile | 28 ++-------------------------- paper_trail.gemspec | 13 +++++++++---- 6 files changed, 51 insertions(+), 31 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index d5eaf1c68..b1830f623 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ test/debug.log test/paper_trail_plugin.sqlite3.db coverage +pkg/* +*.gem +.bundle diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..e45e65f87 --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +source :rubygems +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..56fb29ee6 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,34 @@ +PATH + remote: . + specs: + paper_trail (1.5.4) + actionpack (~> 2.3) + activerecord (~> 2.3) + activerecord (~> 2.3) + +GEM + remote: http://rubygems.org/ + specs: + actionpack (2.3.5) + activesupport (= 2.3.5) + rack (~> 1.0.0) + activerecord (2.3.5) + activesupport (= 2.3.5) + activesupport (2.3.5) + rack (1.0.1) + rake (0.8.7) + shoulda (2.10.3) + sqlite3-ruby (1.3.1) + +PLATFORMS + ruby + +DEPENDENCIES + actionpack (~> 2.3) + activerecord (~> 2.3) + activesupport (~> 2.3) + bundler (~> 1.0) + paper_trail! + rake (= 0.8.7) + shoulda (= 2.10.3) + sqlite3-ruby (~> 1.2) diff --git a/README.md b/README.md index 7b05037cc..2b71ebdc3 100644 --- a/README.md +++ b/README.md @@ -392,7 +392,7 @@ Over time your `versions` table will grow to an unwieldy size. Because each ver ## Testing -PaperTrail has a thorough suite of tests. +PaperTrail uses Bundler to manage its dependencies (in development and testing). You can run the tests with `bundle exec rake test`. (You may need to `bundle install` first.) ## Articles diff --git a/Rakefile b/Rakefile index ba685c266..90897c46e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,32 +1,8 @@ -$LOAD_PATH.unshift 'lib' -require 'paper_trail/version_number' +require 'bundler' +Bundler::GemHelper.install_tasks -require 'rake' require 'rake/testtask' - -desc 'Build the gem.' -task :build do - sh 'gem build paper_trail.gemspec' -end - -desc 'Build and install the gem locally.' -task :install => :build do - sh "gem install paper_trail-#{PaperTrail::VERSION}.gem" -end - -desc 'Tag the code and push tags to origin.' -task :tag do - sh "git tag v#{PaperTrail::VERSION}" - sh "git push origin master --tags" -end - -desc 'Release gem to rubygems.org.' -task :release => [:build, :tag] do - sh "gem push paper_trail-#{PaperTrail::VERSION}.gem" - # sh 'git clean -fd' -end - desc 'Test the paper_trail plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' diff --git a/paper_trail.gemspec b/paper_trail.gemspec index c6d15f0fb..87b46a3e5 100644 --- a/paper_trail.gemspec +++ b/paper_trail.gemspec @@ -16,8 +16,13 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.test_files = Dir.glob("test/**/*") - s.add_dependency 'activerecord' - s.add_dependency 'actionpack' - s.add_development_dependency 'shoulda' - s.add_development_dependency 'activesupport' + s.add_development_dependency 'bundler', '~> 1.0' + s.add_development_dependency 'rake', '0.8.7' # TODO: why do we need to list rake? + s.add_development_dependency 'shoulda', '2.10.3' + s.add_development_dependency 'activesupport', '~> 2.3' + s.add_development_dependency 'sqlite3-ruby', '~> 1.2' + + s.add_dependency 'activerecord', '~> 2.3' + s.add_dependency 'activerecord', '~> 2.3' + s.add_dependency 'actionpack', '~> 2.3' end