ayl-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +110 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/ayl-rails.rb +1 -0
- data/lib/ayl-rails/railtie.rb +87 -0
- data/spec/rails_extensions_spec.rb +169 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/support/null_logger.rb +16 -0
- data/spec/support/what_happened.rb +7 -0
- metadata +141 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
gem 'ayl', ">= 0.1.0"
|
6
|
+
gem 'rails', ">= 3.0.0"
|
7
|
+
|
8
|
+
# Add dependencies to develop your gem here.
|
9
|
+
# Include everything needed to run rake, tests, features, etc.
|
10
|
+
group :development do
|
11
|
+
gem "rspec", ">= 2.3.0"
|
12
|
+
gem "bundler", ">= 1.0.0"
|
13
|
+
gem "jeweler", ">= 1.6.4"
|
14
|
+
gem "rcov", ">= 0"
|
15
|
+
gem "sqlite3" # This is used for the spec tests (setting up activerecord models)
|
16
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (3.1.2)
|
5
|
+
actionpack (= 3.1.2)
|
6
|
+
mail (~> 2.3.0)
|
7
|
+
actionpack (3.1.2)
|
8
|
+
activemodel (= 3.1.2)
|
9
|
+
activesupport (= 3.1.2)
|
10
|
+
builder (~> 3.0.0)
|
11
|
+
erubis (~> 2.7.0)
|
12
|
+
i18n (~> 0.6)
|
13
|
+
rack (~> 1.3.5)
|
14
|
+
rack-cache (~> 1.1)
|
15
|
+
rack-mount (~> 0.8.2)
|
16
|
+
rack-test (~> 0.6.1)
|
17
|
+
sprockets (~> 2.1.0)
|
18
|
+
activemodel (3.1.2)
|
19
|
+
activesupport (= 3.1.2)
|
20
|
+
builder (~> 3.0.0)
|
21
|
+
i18n (~> 0.6)
|
22
|
+
activerecord (3.1.2)
|
23
|
+
activemodel (= 3.1.2)
|
24
|
+
activesupport (= 3.1.2)
|
25
|
+
arel (~> 2.2.1)
|
26
|
+
tzinfo (~> 0.3.29)
|
27
|
+
activeresource (3.1.2)
|
28
|
+
activemodel (= 3.1.2)
|
29
|
+
activesupport (= 3.1.2)
|
30
|
+
activesupport (3.1.2)
|
31
|
+
multi_json (~> 1.0)
|
32
|
+
arel (2.2.1)
|
33
|
+
ayl (0.1.0)
|
34
|
+
builder (3.0.0)
|
35
|
+
diff-lcs (1.1.3)
|
36
|
+
erubis (2.7.0)
|
37
|
+
git (1.2.5)
|
38
|
+
hike (1.2.1)
|
39
|
+
i18n (0.6.0)
|
40
|
+
jeweler (1.6.4)
|
41
|
+
bundler (~> 1.0)
|
42
|
+
git (>= 1.2.5)
|
43
|
+
rake
|
44
|
+
json (1.6.1)
|
45
|
+
mail (2.3.0)
|
46
|
+
i18n (>= 0.4.0)
|
47
|
+
mime-types (~> 1.16)
|
48
|
+
treetop (~> 1.4.8)
|
49
|
+
mime-types (1.17.2)
|
50
|
+
multi_json (1.0.3)
|
51
|
+
polyglot (0.3.3)
|
52
|
+
rack (1.3.5)
|
53
|
+
rack-cache (1.1)
|
54
|
+
rack (>= 0.4)
|
55
|
+
rack-mount (0.8.3)
|
56
|
+
rack (>= 1.0.0)
|
57
|
+
rack-ssl (1.3.2)
|
58
|
+
rack
|
59
|
+
rack-test (0.6.1)
|
60
|
+
rack (>= 1.0)
|
61
|
+
rails (3.1.2)
|
62
|
+
actionmailer (= 3.1.2)
|
63
|
+
actionpack (= 3.1.2)
|
64
|
+
activerecord (= 3.1.2)
|
65
|
+
activeresource (= 3.1.2)
|
66
|
+
activesupport (= 3.1.2)
|
67
|
+
bundler (~> 1.0)
|
68
|
+
railties (= 3.1.2)
|
69
|
+
railties (3.1.2)
|
70
|
+
actionpack (= 3.1.2)
|
71
|
+
activesupport (= 3.1.2)
|
72
|
+
rack-ssl (~> 1.3.2)
|
73
|
+
rake (>= 0.8.7)
|
74
|
+
rdoc (~> 3.4)
|
75
|
+
thor (~> 0.14.6)
|
76
|
+
rake (0.9.2.2)
|
77
|
+
rcov (0.9.11)
|
78
|
+
rdoc (3.11)
|
79
|
+
json (~> 1.4)
|
80
|
+
rspec (2.7.0)
|
81
|
+
rspec-core (~> 2.7.0)
|
82
|
+
rspec-expectations (~> 2.7.0)
|
83
|
+
rspec-mocks (~> 2.7.0)
|
84
|
+
rspec-core (2.7.1)
|
85
|
+
rspec-expectations (2.7.0)
|
86
|
+
diff-lcs (~> 1.1.2)
|
87
|
+
rspec-mocks (2.7.0)
|
88
|
+
sprockets (2.1.1)
|
89
|
+
hike (~> 1.2)
|
90
|
+
rack (~> 1.0)
|
91
|
+
tilt (!= 1.3.0, ~> 1.1)
|
92
|
+
sqlite3 (1.3.4)
|
93
|
+
thor (0.14.6)
|
94
|
+
tilt (1.3.3)
|
95
|
+
treetop (1.4.10)
|
96
|
+
polyglot
|
97
|
+
polyglot (>= 0.3.1)
|
98
|
+
tzinfo (0.3.31)
|
99
|
+
|
100
|
+
PLATFORMS
|
101
|
+
ruby
|
102
|
+
|
103
|
+
DEPENDENCIES
|
104
|
+
ayl (>= 0.1.0)
|
105
|
+
bundler (>= 1.0.0)
|
106
|
+
jeweler (>= 1.6.4)
|
107
|
+
rails (>= 3.0.0)
|
108
|
+
rcov
|
109
|
+
rspec (>= 2.3.0)
|
110
|
+
sqlite3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 j0hnds@gmail.com
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= ayl-rails
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to ayl-rails
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
+
* Fork the project
|
10
|
+
* Start a feature/bugfix branch
|
11
|
+
* Commit and push until you are happy with your contribution
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2011 j0hnds@gmail.com. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "ayl-rails"
|
18
|
+
gem.homepage = "http://github.com/j0hnds/ayl-rails"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Ayl Extension for Rails ActiveRecord support.}
|
21
|
+
gem.description = %Q{Ayl Extension for Rails ActiveRecord support.}
|
22
|
+
gem.email = "j0hnds@gmail.com"
|
23
|
+
gem.authors = ["j0hnds@gmail.com"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rdoc/task'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "ayl-rails #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/lib/ayl-rails.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'ayl-rails/railtie'
|
@@ -0,0 +1,87 @@
|
|
1
|
+
module Ayl
|
2
|
+
|
3
|
+
class Railtie < ::Rails::Railtie
|
4
|
+
|
5
|
+
# The hooks to be created/installed on ActiveRecord::Base
|
6
|
+
HOOKS = [ :after_update, :after_create, :after_save ]
|
7
|
+
|
8
|
+
initializer "Ayl::Railtie.extend" do
|
9
|
+
# Want the ayl_send/opts at the instance level
|
10
|
+
ActiveRecord::Base.send :include, Extensions
|
11
|
+
# Want the instance-level stuff there.
|
12
|
+
ActiveRecord::Base.send :include, InstanceExtensions
|
13
|
+
# Want the ayl_send/opts at the class level as well
|
14
|
+
ActiveRecord::Base.send :extend, Extensions
|
15
|
+
end
|
16
|
+
|
17
|
+
initializer "Ayl::Railtie.hooks" do
|
18
|
+
|
19
|
+
class << ActiveRecord::Base
|
20
|
+
|
21
|
+
# Add each of the hooks to ActiveRecord::Base
|
22
|
+
HOOKS.each do | hook |
|
23
|
+
method_code = <<-EOF
|
24
|
+
def ayl_#{hook}(*args, &block)
|
25
|
+
add_ayl_hook(#{hook.inspect}, *args, &block)
|
26
|
+
end
|
27
|
+
EOF
|
28
|
+
class_eval(method_code, __FILE__, __LINE__ - 1)
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_ayl_hook(hook, *args, &block)
|
32
|
+
if args && args.first.is_a?(Symbol)
|
33
|
+
method = args.shift
|
34
|
+
ayl_hooks[hook] << lambda{|o| o.send(method)}
|
35
|
+
else
|
36
|
+
ayl_hooks[hook] << block
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def ayl_hooks
|
41
|
+
@ayn_hooks ||= Hash.new do |hash, hook|
|
42
|
+
# Remember: this block is invoked only once for each
|
43
|
+
# access of a key that has not been used before.
|
44
|
+
|
45
|
+
# Define the name of a method that the standard hook
|
46
|
+
# method will call when the standard hook fires
|
47
|
+
ahook = "_ayl_#{hook}".to_sym
|
48
|
+
|
49
|
+
# This is for the producer's benefit
|
50
|
+
# So, this is the equivalent of performing the following
|
51
|
+
# in the ActiveRecord class:
|
52
|
+
#
|
53
|
+
# after_create { |o| ayl_send(:_ayl_after_create, o)
|
54
|
+
#
|
55
|
+
# What this means is that the block will be executed after
|
56
|
+
# the model has been save/created.
|
57
|
+
#
|
58
|
+
# So, the self.class target for the ayl_send is because we
|
59
|
+
# need to call the ayl_send method at the singleton level.
|
60
|
+
#
|
61
|
+
send(hook) { |o| self.class.ayl_send(ahook, o) }
|
62
|
+
|
63
|
+
# This is for the worker's benefit
|
64
|
+
#
|
65
|
+
# This defines the instance method
|
66
|
+
method_code = <<-EOF
|
67
|
+
def #{ahook}(o)
|
68
|
+
_run_ayl_hooks(#{hook.inspect}, o)
|
69
|
+
end
|
70
|
+
EOF
|
71
|
+
instance_eval(method_code, __FILE__, __LINE__ - 1)
|
72
|
+
|
73
|
+
hash[hook] = []
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def _run_ayl_hooks(hook, o)
|
78
|
+
ayl_hooks[hook].each { |b| b.call(o) }
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
@@ -0,0 +1,169 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module ClassMethod; end
|
4
|
+
|
5
|
+
class ClassMethod::MyModel < ActiveRecord::Base
|
6
|
+
|
7
|
+
def self.the_async_method(arg1, arg2)
|
8
|
+
WhatHappened.instance << "the static async method(#{arg1}, #{arg2})"
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
module InstanceMethod; end
|
15
|
+
|
16
|
+
class InstanceMethod::MyModel < ActiveRecord::Base
|
17
|
+
|
18
|
+
def the_async_method(arg1, arg2)
|
19
|
+
WhatHappened.instance << "the instance async method(#{arg1}, #{arg2})"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
module AfterSave; end
|
25
|
+
|
26
|
+
# Setup the class to deal with a before_save callback
|
27
|
+
class AfterSave::MyModel < ActiveRecord::Base
|
28
|
+
ayl_after_save :handle_after_save
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def handle_after_save
|
33
|
+
WhatHappened.instance << "handle after save"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
module AfterUpdate; end
|
38
|
+
|
39
|
+
# Setup the class to deal with a before_save callback
|
40
|
+
class AfterUpdate::MyModel < ActiveRecord::Base
|
41
|
+
ayl_after_update :handle_after_update
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def handle_after_update
|
46
|
+
WhatHappened.instance << "handle after update"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
module AfterCreate; end
|
51
|
+
|
52
|
+
# Setup the class to deal with a before_save callback
|
53
|
+
class AfterCreate::MyModel < ActiveRecord::Base
|
54
|
+
ayl_after_create :handle_after_create
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def handle_after_create
|
59
|
+
WhatHappened.instance << "handle after create"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "Rails Extensions" do
|
64
|
+
|
65
|
+
before(:each) do
|
66
|
+
# Set up a null logger
|
67
|
+
Ayl::Logger.instance.logger = Ayl::NullLogger.new
|
68
|
+
|
69
|
+
# Set up an in-memory database so that we can quickly do ActiveRecord
|
70
|
+
# tests.
|
71
|
+
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3',
|
72
|
+
:database => ":memory:")
|
73
|
+
|
74
|
+
ActiveRecord::Schema.define do
|
75
|
+
create_table :my_models do |t|
|
76
|
+
t.column :name, :string
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
after(:each) do
|
83
|
+
WhatHappened.instance.clear
|
84
|
+
end
|
85
|
+
|
86
|
+
context "when handling lifecycle callbacks" do
|
87
|
+
it "the ayl_after_save handler should fire when the model is saved" do
|
88
|
+
|
89
|
+
model = AfterSave::MyModel.new(:name => 'spud')
|
90
|
+
model.save.should be_true
|
91
|
+
|
92
|
+
WhatHappened.instance.what_ran.should == [ 'handle after save' ]
|
93
|
+
WhatHappened.instance.clear
|
94
|
+
|
95
|
+
model.update_attribute(:name, 'joan')
|
96
|
+
|
97
|
+
WhatHappened.instance.what_ran.should == [ 'handle after save' ]
|
98
|
+
end
|
99
|
+
|
100
|
+
it "the ayl_after_update handler should fire when the model is updated" do
|
101
|
+
|
102
|
+
model = AfterUpdate::MyModel.new(:name => 'spud')
|
103
|
+
model.save.should be_true
|
104
|
+
|
105
|
+
WhatHappened.instance.what_ran.should be_nil
|
106
|
+
|
107
|
+
model.update_attribute(:name, 'joan')
|
108
|
+
|
109
|
+
WhatHappened.instance.what_ran.should == [ 'handle after update' ]
|
110
|
+
end
|
111
|
+
|
112
|
+
it "the ayl_after_create handler should fire when the model is created" do
|
113
|
+
|
114
|
+
model = AfterCreate::MyModel.new(:name => 'spud')
|
115
|
+
model.save.should be_true
|
116
|
+
|
117
|
+
WhatHappened.instance.what_ran.should == [ 'handle after create' ]
|
118
|
+
WhatHappened.instance.clear
|
119
|
+
|
120
|
+
model.update_attribute(:name, 'joan')
|
121
|
+
|
122
|
+
WhatHappened.instance.what_ran.should be_nil
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
context "when using the instance extensions" do
|
128
|
+
|
129
|
+
it "should represent the instance of a particular model using a 'find'" do
|
130
|
+
model = InstanceMethod::MyModel.create(:name => 'loud')
|
131
|
+
|
132
|
+
model.to_rrepr.should == "InstanceMethod::MyModel.find(#{model.id})"
|
133
|
+
end
|
134
|
+
|
135
|
+
it "should invoke the instance method asynchronously with no options" do
|
136
|
+
model = InstanceMethod::MyModel.create(:name => 'loud')
|
137
|
+
|
138
|
+
model.ayl_send(:the_async_method, "first", "second")
|
139
|
+
|
140
|
+
WhatHappened.instance.what_ran.should == [ "the instance async method(first, second)" ]
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should invoke the instance method asynchronously with options" do
|
144
|
+
model = InstanceMethod::MyModel.create(:name => 'loud')
|
145
|
+
|
146
|
+
model.ayl_send_opts(:the_async_method, {}, "first", "second")
|
147
|
+
|
148
|
+
WhatHappened.instance.what_ran.should == [ "the instance async method(first, second)" ]
|
149
|
+
end
|
150
|
+
|
151
|
+
end
|
152
|
+
|
153
|
+
context "when using the class extensions" do
|
154
|
+
|
155
|
+
it "should invoke the static method asynchronously with no options" do
|
156
|
+
ClassMethod::MyModel.ayl_send(:the_async_method, "first", "second")
|
157
|
+
|
158
|
+
WhatHappened.instance.what_ran.should == [ "the static async method(first, second)" ]
|
159
|
+
end
|
160
|
+
|
161
|
+
it "should invoke the instance method asynchronously with options" do
|
162
|
+
ClassMethod::MyModel.ayl_send_opts(:the_async_method, {}, "first", "second")
|
163
|
+
|
164
|
+
WhatHappened.instance.what_ran.should == [ "the static async method(first, second)" ]
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'rails/all'
|
5
|
+
require 'ayl'
|
6
|
+
require 'ayl-rails'
|
7
|
+
|
8
|
+
# Run the initializers in the Railtie to get them to register
|
9
|
+
Ayl::Railtie.instance.run_initializers
|
10
|
+
|
11
|
+
# Requires supporting files with custom matchers and macros, etc,
|
12
|
+
# in ./support/ and its subdirectories.
|
13
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
14
|
+
|
15
|
+
RSpec.configure do |config|
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Ayl
|
2
|
+
|
3
|
+
#
|
4
|
+
# A logger to use to limit the amount of junk output while the test is running
|
5
|
+
#
|
6
|
+
class NullLogger
|
7
|
+
|
8
|
+
Ayl::Logger::LOG_METHODS.each do | method |
|
9
|
+
define_method(method) do |message|
|
10
|
+
# Do nothing
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ayl-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- j0hnds@gmail.com
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-11-20 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ayl
|
16
|
+
requirement: &88427140 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *88427140
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rails
|
27
|
+
requirement: &88426740 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.0
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *88426740
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &88426440 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.3.0
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *88426440
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: &88426050 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.0
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *88426050
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: jeweler
|
60
|
+
requirement: &88425610 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 1.6.4
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *88425610
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rcov
|
71
|
+
requirement: &88425070 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *88425070
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: sqlite3
|
82
|
+
requirement: &88424690 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *88424690
|
91
|
+
description: Ayl Extension for Rails ActiveRecord support.
|
92
|
+
email: j0hnds@gmail.com
|
93
|
+
executables: []
|
94
|
+
extensions: []
|
95
|
+
extra_rdoc_files:
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.rdoc
|
98
|
+
files:
|
99
|
+
- .document
|
100
|
+
- .rspec
|
101
|
+
- Gemfile
|
102
|
+
- Gemfile.lock
|
103
|
+
- LICENSE.txt
|
104
|
+
- README.rdoc
|
105
|
+
- Rakefile
|
106
|
+
- VERSION
|
107
|
+
- lib/ayl-rails.rb
|
108
|
+
- lib/ayl-rails/railtie.rb
|
109
|
+
- spec/rails_extensions_spec.rb
|
110
|
+
- spec/spec_helper.rb
|
111
|
+
- spec/support/null_logger.rb
|
112
|
+
- spec/support/what_happened.rb
|
113
|
+
homepage: http://github.com/j0hnds/ayl-rails
|
114
|
+
licenses:
|
115
|
+
- MIT
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
segments:
|
127
|
+
- 0
|
128
|
+
hash: -897926769
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
requirements: []
|
136
|
+
rubyforge_project:
|
137
|
+
rubygems_version: 1.8.10
|
138
|
+
signing_key:
|
139
|
+
specification_version: 3
|
140
|
+
summary: Ayl Extension for Rails ActiveRecord support.
|
141
|
+
test_files: []
|