rory 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rory/controller.rb +6 -4
- data/lib/rory/version.rb +1 -1
- data/spec/lib/rory/controller_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 519e856afba46c0680d6d3af79ec301e16437bce
|
4
|
+
data.tar.gz: b6f3aff18d16be85d47eae141dd8f11f7946fcf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea76b00f53570b120d821f2e4f356cca6531ae15f85b4fe61a41f856d3ac025773b3e326bf9eef49ff2151e7a6d91189d9c3f876f0f08b294fe6fe36ff45df98
|
7
|
+
data.tar.gz: eed96368cd3a1e75d274f4c0f21d55a2b51b8340c10af48c92b7694b287837ccc9119fd9b54aee8850145f8a1d635f22b8f431432a8d9b72a655af32c847beca
|
data/lib/rory/controller.rb
CHANGED
@@ -30,10 +30,12 @@ module Rory
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def ancestor_actions(action_type)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
query_method = :"#{action_type}_actions"
|
34
|
+
if superclass && superclass.respond_to?(query_method)
|
35
|
+
superclass.send(query_method).flatten.compact
|
36
|
+
else
|
37
|
+
[]
|
38
|
+
end
|
37
39
|
end
|
38
40
|
end
|
39
41
|
|
data/lib/rory/version.rb
CHANGED
@@ -68,6 +68,22 @@ describe Rory::Controller do
|
|
68
68
|
subject.present
|
69
69
|
end
|
70
70
|
|
71
|
+
context "on sub-subclass" do
|
72
|
+
let(:grandchild) { Class.new(FilteredController) }
|
73
|
+
let(:greatgrandchild) { Class.new(grandchild) }
|
74
|
+
subject { greatgrandchild.new(@request, @routing) }
|
75
|
+
|
76
|
+
it "assembles list of all filter actions from ancestry" do
|
77
|
+
grandchild.before_action :do_a_jig
|
78
|
+
greatgrandchild.before_action :take_a_deep_breath
|
79
|
+
|
80
|
+
[:pickle_something, :make_it_tasty, :do_a_jig, :take_a_deep_breath, :letsgo, :rub_tummy, :sleep, :render].each do |m|
|
81
|
+
expect(subject).to receive(m).ordered
|
82
|
+
end
|
83
|
+
subject.present
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
71
87
|
it "short circuits if a before_action generates a response" do
|
72
88
|
def subject.pickle_something
|
73
89
|
@response = 'stuff'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ravi Gadad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|