Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't shell out when evaling the gemspec

  • Loading branch information...
commit 1aa6cbf77a0cd3da01527c14a336c8ebe3337aef 1 parent 3651b70
@rafaelfranca rafaelfranca authored
Showing with 60 additions and 19 deletions.
  1. +15 −0 Rakefile
  2. +19 −19 rails-observers.gemspec
  3. +26 −0 rails-observers.gemspec.erb
View
15 Rakefile
@@ -17,3 +17,18 @@ end
task :default => :test
task :test => ['test:regular', 'test:generators']
+
+specname = "rails-observers.gemspec"
+deps = `git ls-files`.split("\n") - [specname]
+
+file specname => deps do
+ files = `git ls-files`.split("\n")
+ test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+
+ require 'erb'
+
+ File.open specname, 'w:utf-8' do |f|
+ f.write ERB.new(File.read("#{specname}.erb")).result(binding)
+ end
+end
View
38 rails-observers.gemspec
@@ -1,26 +1,26 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/rails/observers/version', __FILE__)
-Gem::Specification.new do |gem|
- gem.authors = ["Steve Klabnik"]
- gem.email = ["steve@steveklabnik.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
- gem.homepage = ""
+Gem::Specification.new do |s|
+ s.name = "rails-observers"
+ s.authors = ["Rafael Mendonça França", "Steve Klabnik"]
+ s.email = ["rafaelmfranca@gmail.com", "steve@steveklabnik.com"]
+ s.description = %q{Rails observer (removed from core in Rails 4.0)}
+ s.summary = %q{ActiveModel::Observer, ActiveRecord::Observer and ActionController::Caching::Sweeper extracted from Rails.}
+ s.homepage = "https://github.com/rails/rails-observers"
+ s.version = Rails::Observers::VERSION
- gem.files = `git ls-files`.split($\)
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
- gem.name = "rails-observers"
- gem.require_paths = ["lib"]
- gem.version = Rails::Observers::VERSION
+ s.files = [".gitignore","Gemfile","LICENSE","README.md","Rakefile","lib/generators/active_record/observer/observer_generator.rb","lib/generators/active_record/observer/templates/observer.rb","lib/generators/rails/observer/USAGE","lib/generators/rails/observer/observer_generator.rb","lib/generators/test_unit/observer/observer_generator.rb","lib/generators/test_unit/observer/templates/unit_test.rb","lib/rails-observers.rb","lib/rails/observers/action_controller/caching.rb","lib/rails/observers/action_controller/caching/sweeping.rb","lib/rails/observers/active_model/active_model.rb","lib/rails/observers/active_model/observer_array.rb","lib/rails/observers/active_model/observing.rb","lib/rails/observers/activerecord/active_record.rb","lib/rails/observers/activerecord/base.rb","lib/rails/observers/activerecord/observer.rb","lib/rails/observers/version.rb","rails-observers.gemspec","test/configuration_test.rb","test/console_test.rb","test/fixtures/developers.yml","test/fixtures/minimalistics.yml","test/fixtures/topics.yml","test/generators/generators_test_helper.rb","test/generators/namespaced_generators_test.rb","test/generators/observer_generator_test.rb","test/helper.rb","test/isolation/abstract_unit.rb","test/lifecycle_test.rb","test/models/observers.rb","test/observer_array_test.rb","test/observing_test.rb","test/rake_test.rb","test/sweeper_test.rb","test/transaction_callbacks_test.rb"]
+ s.test_files = ["test/configuration_test.rb","test/console_test.rb","test/fixtures/developers.yml","test/fixtures/minimalistics.yml","test/fixtures/topics.yml","test/generators/generators_test_helper.rb","test/generators/namespaced_generators_test.rb","test/generators/observer_generator_test.rb","test/helper.rb","test/isolation/abstract_unit.rb","test/lifecycle_test.rb","test/models/observers.rb","test/observer_array_test.rb","test/observing_test.rb","test/rake_test.rb","test/sweeper_test.rb","test/transaction_callbacks_test.rb"]
+ s.executables = []
+ s.require_paths = ["lib"]
- gem.add_dependency 'railties', '~> 4.0.0.beta'
+ s.add_dependency 'railties', '~> 4.0.0.beta'
- gem.add_development_dependency 'minitest', '>= 3'
- gem.add_development_dependency 'activerecord', '~> 4.0.0.beta'
- gem.add_development_dependency 'activemodel', '~> 4.0.0.beta'
- gem.add_development_dependency 'actionmailer', '~> 4.0.0.beta'
- gem.add_development_dependency 'actionpack', '~> 4.0.0.beta'
- gem.add_development_dependency 'sqlite3', '~> 1.3'
+ s.add_development_dependency 'minitest', '>= 3'
+ s.add_development_dependency 'activerecord', '~> 4.0.0.beta'
+ s.add_development_dependency 'activemodel', '~> 4.0.0.beta'
+ s.add_development_dependency 'actionmailer', '~> 4.0.0.beta'
+ s.add_development_dependency 'actionpack', '~> 4.0.0.beta'
+ s.add_development_dependency 'sqlite3', '~> 1.3'
end
View
26 rails-observers.gemspec.erb
@@ -0,0 +1,26 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/rails/observers/version', __FILE__)
+
+Gem::Specification.new do |s|
+ s.name = "rails-observers"
+ s.authors = ["Rafael Mendonça França", "Steve Klabnik"]
+ s.email = ["rafaelmfranca@gmail.com", "steve@steveklabnik.com"]
+ s.description = %q{Rails observer (removed from core in Rails 4.0)}
+ s.summary = %q{ActiveModel::Observer, ActiveRecord::Observer and ActionController::Caching::Sweeper extracted from Rails.}
+ s.homepage = "https://github.com/rails/rails-observers"
+ s.version = Rails::Observers::VERSION
+
+ s.files = [<%= files.map(&:inspect).join ',' %>]
+ s.test_files = [<%= test_files.map(&:inspect).join ',' %>]
+ s.executables = [<%= executables.map(&:inspect).join ',' %>]
+ s.require_paths = ["lib"]
+
+ s.add_dependency 'railties', '~> 4.0.0.beta'
+
+ s.add_development_dependency 'minitest', '>= 3'
+ s.add_development_dependency 'activerecord', '~> 4.0.0.beta'
+ s.add_development_dependency 'activemodel', '~> 4.0.0.beta'
+ s.add_development_dependency 'actionmailer', '~> 4.0.0.beta'
+ s.add_development_dependency 'actionpack', '~> 4.0.0.beta'
+ s.add_development_dependency 'sqlite3', '~> 1.3'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.