Permalink
Browse files

Bump gem to Rails 3.2

- Move to Bundler for dependency management
- Drop support for RDoc
- Upgrade to rspec 2
- Clean up a bunch of whitespace
- Add a Guardfile for easy testing
  • Loading branch information...
1 parent 4b7f3d1 commit d4bfaf33ca5aaf67305c4cd3a54a9e7d06ccd0a2 @shayfrendt shayfrendt committed Jun 28, 2012
View
@@ -0,0 +1 @@
+rvm 1.9.3-p194@acts_as_revisable
View
@@ -0,0 +1,4 @@
+source :rubygems
+
+# Gem dependencies specified in acts_as_revisable.gemspec
+gemspec
View
@@ -0,0 +1,66 @@
+PATH
+ remote: .
+ specs:
+ acts_as_revisable (1.2.0)
+ activerecord (>= 3.2.3)
+ activesupport (>= 3.2.3)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activemodel (3.2.6)
+ activesupport (= 3.2.6)
+ builder (~> 3.0.0)
+ activerecord (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activesupport (3.2.6)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.0)
+ diff-lcs (1.1.3)
+ ffi (1.0.11)
+ growl (1.0.3)
+ guard (1.2.1)
+ listen (>= 0.4.2)
+ thor (>= 0.14.6)
+ guard-rspec (1.1.0)
+ guard (>= 1.1)
+ i18n (0.6.0)
+ listen (0.4.7)
+ rb-fchange (~> 0.0.5)
+ rb-fsevent (~> 0.9.1)
+ rb-inotify (~> 0.8.8)
+ multi_json (1.3.6)
+ rake (0.9.2.2)
+ rb-fchange (0.0.5)
+ ffi
+ rb-fsevent (0.9.1)
+ rb-inotify (0.8.8)
+ ffi (>= 0.5.0)
+ rspec (2.10.0)
+ rspec-core (~> 2.10.0)
+ rspec-expectations (~> 2.10.0)
+ rspec-mocks (~> 2.10.0)
+ rspec-core (2.10.1)
+ rspec-expectations (2.10.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.10.1)
+ sqlite3 (1.3.6)
+ thor (0.15.3)
+ tzinfo (0.3.33)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ acts_as_revisable!
+ growl (~> 1.0.3)
+ guard-rspec (~> 1.1.0)
+ rake (~> 0.9.2)
+ rb-fsevent (~> 0.9.1)
+ rspec (~> 2.10.0)
+ sqlite3 (~> 1.3.6)
View
@@ -0,0 +1,14 @@
+# Run me with:
+#
+# $ bundle exec guard
+
+begin
+ require 'rb-inotify'
+ require 'libnotify'
+rescue LoadError
+end
+
+guard 'rspec', :all_on_start => false, :all_after_pass => false do
+ watch(%r{^spec/.+_spec\.rb})
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+end
View
@@ -1,44 +1,9 @@
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
-require 'fileutils'
-require 'lib/acts_as_revisable/version'
-require 'lib/acts_as_revisable/gem_spec_options'
+require 'bundler'
+Bundler::GemHelper.install_tasks
+require 'rspec/core/rake_task'
-Rake::RDocTask.new do |rdoc|
- files = ['README.rdoc','LICENSE','lib/**/*.rb','doc/**/*.rdoc','spec/*.rb']
- rdoc.rdoc_files.add(files)
- rdoc.main = 'README.rdoc'
- rdoc.title = 'acts_as_revisable RDoc'
- rdoc.rdoc_dir = 'doc'
- rdoc.options << '--line-numbers' << '--inline-source'
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.pattern = FileList['spec/**/*_spec.rb']
end
-spec = Gem::Specification.new do |s|
- WithoutScope::ActsAsRevisable::GemSpecOptions::HASH.each do |key, value|
- s.send("#{key.to_s}=",value)
- end
-end
-
-Rake::GemPackageTask.new(spec) do |package|
- package.gem_spec = spec
-end
-
-desc "Generate the static gemspec required for github."
-task :generate_gemspec do
- options = WithoutScope::ActsAsRevisable::GemSpecOptions::HASH.clone
- options[:name] = "acts_as_revisable"
-
- spec = ["Gem::Specification.new do |s|"]
- options.each do |key, value|
- spec << " s.#{key.to_s} = #{value.inspect}"
- end
- spec << "end"
-
- open("acts_as_revisable.gemspec", "w").write(spec.join("\n"))
-end
-
-desc "Install acts_as_revisable"
-task :install => :repackage do
- options = WithoutScope::ActsAsRevisable::GemSpecOptions::HASH.clone
- sh %{sudo gem install pkg/#{options[:name]}-#{spec.version} --no-rdoc --no-ri}
-end
+task :default => :spec
@@ -1,12 +1,34 @@
+# -*- encoding: utf-8 -*-
+lib = File.expand_path('../lib/', __FILE__)
+$:.unshift lib unless $:.include?(lib)
+
+require 'acts_as_revisable/version'
+
Gem::Specification.new do |s|
- s.summary = "acts_as_revisable enables revision tracking, querying, reverting and branching of ActiveRecord models. Inspired by acts_as_versioned."
- s.has_rdoc = true
- s.files = ["LICENSE", "README.rdoc", "Rakefile", "spec/associations_spec.rb", "spec/branch_spec.rb", "spec/deletable_spec.rb", "spec/find_spec.rb", "spec/general_spec.rb", "spec/options_spec.rb", "spec/quoted_columns_spec.rb", "spec/revert_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/sti_spec.rb", "spec/validations_spec.rb", "lib/acts_as_revisable", "lib/acts_as_revisable/acts", "lib/acts_as_revisable/acts/common.rb", "lib/acts_as_revisable/acts/deletable.rb", "lib/acts_as_revisable/acts/revisable.rb", "lib/acts_as_revisable/acts/revision.rb", "lib/acts_as_revisable/base.rb", "lib/acts_as_revisable/gem_spec_options.rb", "lib/acts_as_revisable/options.rb", "lib/acts_as_revisable/quoted_columns.rb", "lib/acts_as_revisable/validations.rb", "lib/acts_as_revisable/version.rb", "lib/acts_as_revisable.rb", "generators/revisable_migration", "generators/revisable_migration/revisable_migration_generator.rb", "generators/revisable_migration/templates", "generators/revisable_migration/templates/migration.rb", "rails/init.rb"]
- s.email = "rich@withoutscope.com"
- s.rdoc_options = ["--main", "README.rdoc"]
- s.version = "1.1.1"
- s.homepage = "http://github.com/rich/acts_as_revisable"
- s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
- s.name = "acts_as_revisable"
- s.authors = ["Rich Cavanaugh", "Stephen Caudill"]
-end
+ s.name = "acts_as_revisable"
+ s.version = WithoutScope::ActsAsRevisable::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.date = "2012-06-28"
+ s.authors = ["Rich Cavanaugh", "Stephen Caudill"]
+ s.email = "rich@withoutscope.com"
+ s.homepage = "http://github.com/chargify/acts_as_revisable"
+ s.summary = "acts_as_revisable enables revision tracking, querying, reverting and branching of ActiveRecord models. Inspired by acts_as_versioned."
+
+ s.required_rubygems_version = ">= 1.3.6"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.require_paths = ['lib']
+
+ # Runtime Dependencies
+ s.add_runtime_dependency('activesupport', '>= 3.2.3')
+ s.add_runtime_dependency('activerecord', '>= 3.2.3')
+
+ # Development Dependencies
+ s.add_development_dependency('rake', '~> 0.9.2')
+ s.add_development_dependency('rspec', '~> 2.10.0')
+ s.add_development_dependency('guard-rspec', '~> 1.1.0')
+ s.add_development_dependency('growl', '~> 1.0.3')
+ s.add_development_dependency('rb-fsevent', '~> 0.9.1')
+ s.add_development_dependency('sqlite3', '~> 1.3.6')
+end
@@ -1,8 +1,6 @@
-$:.unshift(File.dirname(__FILE__)) unless
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
-
-require 'activesupport' unless defined? ActiveSupport
-require 'activerecord' unless defined? ActiveRecord
+require 'rubygems'
+require 'active_support' unless defined? ActiveSupport
+require 'active_record' unless defined? ActiveRecord
require 'acts_as_revisable/version.rb'
require 'acts_as_revisable/base'
Oops, something went wrong.

0 comments on commit d4bfaf3

Please sign in to comment.