ananke 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ananke/helpers.rb +1 -1
- data/lib/version.rb +1 -1
- data/spec/lib/route_for_spec.rb +48 -2
- metadata +3 -3
data/lib/ananke/helpers.rb
CHANGED
@@ -14,7 +14,7 @@ module Ananke
|
|
14
14
|
|
15
15
|
def get_id(obj, key)
|
16
16
|
if !key
|
17
|
-
out :
|
17
|
+
out :warning, "Cannot get id on object #{obj}, key is nil"
|
18
18
|
return nil
|
19
19
|
end
|
20
20
|
obj.class == Hash && obj.has_key?(key) ? obj[key] : obj.respond_to?(key) ? obj.instance_variable_get("@#{key}") : nil
|
data/lib/version.rb
CHANGED
data/spec/lib/route_for_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe 'Resource Route-For' do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it """
|
13
|
-
|
13
|
+
should be able to accept route_for Registrations
|
14
14
|
""" do
|
15
15
|
module Repository
|
16
16
|
module Route_for
|
@@ -30,7 +30,7 @@ describe 'Resource Route-For' do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it """
|
33
|
-
|
33
|
+
should be able to accept route_for Registrations with POST and multiple input parameters
|
34
34
|
""" do
|
35
35
|
module Repository
|
36
36
|
module Route_for
|
@@ -48,4 +48,50 @@ describe 'Resource Route-For' do
|
|
48
48
|
check_status(200)
|
49
49
|
last_response.body.should == '{"route_for_list":[{"route_for":{"route_for_id":"1","content":"Test"},"links":[{"rel":"self","uri":"/route_for/1"}]}],"links":[{"rel":"self","uri":"/route_for/multi"}]}'
|
50
50
|
end
|
51
|
+
|
52
|
+
it """
|
53
|
+
should be able to register multiple route_for's in one declaration
|
54
|
+
""" do
|
55
|
+
module Repository
|
56
|
+
module Route_for
|
57
|
+
def self.get_1(id)
|
58
|
+
end
|
59
|
+
def self.get_2(id)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
route :route_for do
|
64
|
+
id :route_for_id
|
65
|
+
route_for :get_1
|
66
|
+
route_for :get_2
|
67
|
+
end
|
68
|
+
|
69
|
+
get "/route_for/get_1/1"
|
70
|
+
check_status(200)
|
71
|
+
get "/route_for/get_2/2"
|
72
|
+
check_status(200)
|
73
|
+
end
|
74
|
+
|
75
|
+
it """
|
76
|
+
should be able to register multiple route_for's with POST in one declaration
|
77
|
+
""" do
|
78
|
+
module Repository
|
79
|
+
module Route_for
|
80
|
+
def self.post_1(id)
|
81
|
+
end
|
82
|
+
def self.post_2(id)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
route :route_for do
|
87
|
+
id :route_for_id
|
88
|
+
route_for :post_1, :post
|
89
|
+
route_for :post_2, :post
|
90
|
+
end
|
91
|
+
|
92
|
+
post "/route_for/post_1/1"
|
93
|
+
check_status(200)
|
94
|
+
post "/route_for/post_2/2"
|
95
|
+
check_status(200)
|
96
|
+
end
|
51
97
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ananke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andries Coetzee
|
@@ -129,7 +129,7 @@ licenses: []
|
|
129
129
|
post_install_message: |
|
130
130
|
**************************************************
|
131
131
|
|
132
|
-
Thank you for installing ananke-1.0.
|
132
|
+
Thank you for installing ananke-1.0.2
|
133
133
|
|
134
134
|
Please be sure to look at README.rdoc to see what might have changed
|
135
135
|
since the last release and how to use this GEM.
|
@@ -158,7 +158,7 @@ rubyforge_project:
|
|
158
158
|
rubygems_version: 1.5.0
|
159
159
|
signing_key:
|
160
160
|
specification_version: 3
|
161
|
-
summary: ananke-1.0.
|
161
|
+
summary: ananke-1.0.2
|
162
162
|
test_files:
|
163
163
|
- spec/nice_formatter.rb
|
164
164
|
- spec/call_chain.rb
|