rails-observers 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +12 -0
- data/Gemfile +3 -3
- data/lib/rails-observers.rb +5 -1
- data/lib/rails/observers/version.rb +1 -1
- data/rails-observers.gemspec +1 -1
- data/rails-observers.gemspec.erb +26 -0
- data/test/isolation/abstract_unit.rb +13 -2
- metadata +4 -2
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -3,9 +3,9 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in active_record-observers.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'activerecord-deprecated_finders',
|
7
|
-
gem 'journey',
|
6
|
+
gem 'activerecord-deprecated_finders', github: 'rails/activerecord-deprecated_finders'
|
7
|
+
gem 'journey', github: 'rails/journey'
|
8
8
|
|
9
|
-
gem 'rails',
|
9
|
+
gem 'rails', github: 'rails/rails', branch: 'master'
|
10
10
|
|
11
11
|
gem 'mocha', require: false
|
data/lib/rails-observers.rb
CHANGED
@@ -4,9 +4,13 @@ require 'rails/observers/version'
|
|
4
4
|
module Rails
|
5
5
|
module Observers
|
6
6
|
class Railtie < ::Rails::Railtie
|
7
|
-
initializer "active_record.observer", :before => "active_record.set_configs" do
|
7
|
+
initializer "active_record.observer", :before => "active_record.set_configs" do |app|
|
8
8
|
ActiveSupport.on_load(:active_record) do
|
9
9
|
require "rails/observers/activerecord/active_record"
|
10
|
+
|
11
|
+
if observers = app.config.respond_to?(:active_record) && app.config.active_record.delete(:observers)
|
12
|
+
send :observers=, observers
|
13
|
+
end
|
10
14
|
end
|
11
15
|
end
|
12
16
|
|
data/rails-observers.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "https://github.com/rails/rails-observers"
|
11
11
|
s.version = Rails::Observers::VERSION
|
12
12
|
|
13
|
-
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"]
|
13
|
+
s.files = [".gitignore",".travis.yml","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","rails-observers.gemspec.erb","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"]
|
14
14
|
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"]
|
15
15
|
s.executables = []
|
16
16
|
s.require_paths = ["lib"]
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/rails/observers/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "rails-observers"
|
6
|
+
s.authors = ["Rafael Mendonça França", "Steve Klabnik"]
|
7
|
+
s.email = ["rafaelmfranca@gmail.com", "steve@steveklabnik.com"]
|
8
|
+
s.description = %q{Rails observer (removed from core in Rails 4.0)}
|
9
|
+
s.summary = %q{ActiveModel::Observer, ActiveRecord::Observer and ActionController::Caching::Sweeper extracted from Rails.}
|
10
|
+
s.homepage = "https://github.com/rails/rails-observers"
|
11
|
+
s.version = Rails::Observers::VERSION
|
12
|
+
|
13
|
+
s.files = [<%= files.map(&:inspect).join ',' %>]
|
14
|
+
s.test_files = [<%= test_files.map(&:inspect).join ',' %>]
|
15
|
+
s.executables = [<%= executables.map(&:inspect).join ',' %>]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
|
18
|
+
s.add_dependency 'railties', '~> 4.0.0.beta'
|
19
|
+
|
20
|
+
s.add_development_dependency 'minitest', '>= 3'
|
21
|
+
s.add_development_dependency 'activerecord', '~> 4.0.0.beta'
|
22
|
+
s.add_development_dependency 'activemodel', '~> 4.0.0.beta'
|
23
|
+
s.add_development_dependency 'actionmailer', '~> 4.0.0.beta'
|
24
|
+
s.add_development_dependency 'actionpack', '~> 4.0.0.beta'
|
25
|
+
s.add_development_dependency 'sqlite3', '~> 1.3'
|
26
|
+
end
|
@@ -54,8 +54,9 @@ module TestHelpers
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
|
58
|
-
|
57
|
+
gemfile_path = "#{app_path}/Gemfile"
|
58
|
+
if options[:gemfile].blank? && File.exist?(gemfile_path)
|
59
|
+
File.delete gemfile_path
|
59
60
|
end
|
60
61
|
|
61
62
|
routes = File.read("#{app_path}/config/routes.rb")
|
@@ -106,3 +107,13 @@ class ActiveSupport::TestCase
|
|
106
107
|
include TestHelpers::Paths
|
107
108
|
include TestHelpers::Generation
|
108
109
|
end
|
110
|
+
|
111
|
+
Module.new do
|
112
|
+
extend TestHelpers::Paths
|
113
|
+
|
114
|
+
# Build a rails app
|
115
|
+
FileUtils.rm_rf(app_template_path)
|
116
|
+
FileUtils.mkdir(app_template_path)
|
117
|
+
|
118
|
+
`rails new #{app_template_path} --skip-gemfile`
|
119
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-observers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-11-
|
13
|
+
date: 2012-11-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -133,6 +133,7 @@ extensions: []
|
|
133
133
|
extra_rdoc_files: []
|
134
134
|
files:
|
135
135
|
- .gitignore
|
136
|
+
- .travis.yml
|
136
137
|
- Gemfile
|
137
138
|
- LICENSE
|
138
139
|
- README.md
|
@@ -154,6 +155,7 @@ files:
|
|
154
155
|
- lib/rails/observers/activerecord/observer.rb
|
155
156
|
- lib/rails/observers/version.rb
|
156
157
|
- rails-observers.gemspec
|
158
|
+
- rails-observers.gemspec.erb
|
157
159
|
- test/configuration_test.rb
|
158
160
|
- test/console_test.rb
|
159
161
|
- test/fixtures/developers.yml
|