responders 0.9.2 → 0.9.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.
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +23 -23
- data/lib/responders/collection_responder.rb +2 -2
- data/lib/responders/version.rb +1 -1
- data/test/collection_responder_test.rb +21 -1
- data/test/test_helper.rb +13 -0
- metadata +10 -6
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
responders (0.9.
|
4
|
+
responders (0.9.3)
|
5
5
|
railties (~> 3.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (3.2.
|
11
|
-
activemodel (= 3.2.
|
12
|
-
activesupport (= 3.2.
|
10
|
+
actionpack (3.2.8)
|
11
|
+
activemodel (= 3.2.8)
|
12
|
+
activesupport (= 3.2.8)
|
13
13
|
builder (~> 3.0.0)
|
14
14
|
erubis (~> 2.7.0)
|
15
|
-
journey (~> 1.0.
|
15
|
+
journey (~> 1.0.4)
|
16
16
|
rack (~> 1.4.0)
|
17
|
-
rack-cache (~> 1.
|
17
|
+
rack-cache (~> 1.2)
|
18
18
|
rack-test (~> 0.6.1)
|
19
|
-
sprockets (~> 2.1.
|
20
|
-
activemodel (3.2.
|
21
|
-
activesupport (= 3.2.
|
19
|
+
sprockets (~> 2.1.3)
|
20
|
+
activemodel (3.2.8)
|
21
|
+
activesupport (= 3.2.8)
|
22
22
|
builder (~> 3.0.0)
|
23
|
-
activesupport (3.2.
|
23
|
+
activesupport (3.2.8)
|
24
24
|
i18n (~> 0.6)
|
25
25
|
multi_json (~> 1.0)
|
26
|
-
builder (3.0.
|
26
|
+
builder (3.0.3)
|
27
27
|
columnize (0.3.6)
|
28
28
|
erubis (2.7.0)
|
29
29
|
hike (1.2.1)
|
30
|
-
i18n (0.6.
|
31
|
-
journey (1.0.
|
32
|
-
json (1.
|
30
|
+
i18n (0.6.1)
|
31
|
+
journey (1.0.4)
|
32
|
+
json (1.7.5)
|
33
33
|
linecache (0.46)
|
34
34
|
rbx-require-relative (> 0.0.4)
|
35
35
|
metaclass (0.0.1)
|
36
36
|
mocha (0.10.4)
|
37
37
|
metaclass (~> 0.0.1)
|
38
|
-
multi_json (1.
|
38
|
+
multi_json (1.3.6)
|
39
39
|
rack (1.4.1)
|
40
40
|
rack-cache (1.2)
|
41
41
|
rack (>= 0.4)
|
42
42
|
rack-ssl (1.3.2)
|
43
43
|
rack
|
44
|
-
rack-test (0.6.
|
44
|
+
rack-test (0.6.2)
|
45
45
|
rack (>= 1.0)
|
46
|
-
railties (3.2.
|
47
|
-
actionpack (= 3.2.
|
48
|
-
activesupport (= 3.2.
|
46
|
+
railties (3.2.8)
|
47
|
+
actionpack (= 3.2.8)
|
48
|
+
activesupport (= 3.2.8)
|
49
49
|
rack-ssl (~> 1.3.2)
|
50
50
|
rake (>= 0.8.7)
|
51
51
|
rdoc (~> 3.4)
|
52
|
-
thor (
|
52
|
+
thor (>= 0.14.6, < 2.0)
|
53
53
|
rake (0.9.2.2)
|
54
54
|
rbx-require-relative (0.0.9)
|
55
55
|
rdoc (3.12)
|
@@ -59,11 +59,11 @@ GEM
|
|
59
59
|
ruby-debug-base (~> 0.10.4.0)
|
60
60
|
ruby-debug-base (0.10.4)
|
61
61
|
linecache (>= 0.3)
|
62
|
-
sprockets (2.1.
|
62
|
+
sprockets (2.1.3)
|
63
63
|
hike (~> 1.2)
|
64
64
|
rack (~> 1.0)
|
65
65
|
tilt (~> 1.1, != 1.3.0)
|
66
|
-
thor (0.
|
66
|
+
thor (0.16.0)
|
67
67
|
tilt (1.3.3)
|
68
68
|
|
69
69
|
PLATFORMS
|
@@ -71,6 +71,6 @@ PLATFORMS
|
|
71
71
|
|
72
72
|
DEPENDENCIES
|
73
73
|
mocha
|
74
|
-
railties (
|
74
|
+
railties (~> 3.2.3)
|
75
75
|
responders!
|
76
76
|
ruby-debug
|
@@ -21,10 +21,10 @@ module Responders
|
|
21
21
|
klass = resources.last.class
|
22
22
|
|
23
23
|
if klass.respond_to?(:model_name)
|
24
|
-
resources[0...-1] << klass.model_name.
|
24
|
+
resources[0...-1] << klass.model_name.route_key.to_sym
|
25
25
|
else
|
26
26
|
resources
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
30
|
-
end
|
30
|
+
end
|
data/lib/responders/version.rb
CHANGED
@@ -26,6 +26,14 @@ class CollectionController < ApplicationController
|
|
26
26
|
def with_location
|
27
27
|
respond_with Address.new, :location => "given_location"
|
28
28
|
end
|
29
|
+
|
30
|
+
def isolated_namespace
|
31
|
+
respond_with MyEngine::Business.new
|
32
|
+
end
|
33
|
+
|
34
|
+
def uncountable
|
35
|
+
respond_with News.new
|
36
|
+
end
|
29
37
|
end
|
30
38
|
|
31
39
|
class CollectionResponderTest < ActionController::TestCase
|
@@ -59,4 +67,16 @@ class CollectionResponderTest < ActionController::TestCase
|
|
59
67
|
post :only_symbols
|
60
68
|
assert_redirected_to "admin_addresses_url"
|
61
69
|
end
|
62
|
-
|
70
|
+
|
71
|
+
def test_collection_respects_isolated_namespace
|
72
|
+
@controller.expects(:businesses_url).returns("businesses_url")
|
73
|
+
post :isolated_namespace
|
74
|
+
assert_redirected_to "businesses_url"
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_collection_respects_uncountable_resource
|
78
|
+
@controller.expects(:news_index_url).returns("news_index_url")
|
79
|
+
post :uncountable
|
80
|
+
assert_redirected_to "news_index_url"
|
81
|
+
end
|
82
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -21,6 +21,7 @@ I18n.reload!
|
|
21
21
|
|
22
22
|
Responders::Routes = ActionDispatch::Routing::RouteSet.new
|
23
23
|
Responders::Routes.draw do
|
24
|
+
resources :news
|
24
25
|
match '/admin/:action', :controller => "admin/addresses"
|
25
26
|
match '/:controller(/:action(/:id))'
|
26
27
|
end
|
@@ -64,3 +65,15 @@ end
|
|
64
65
|
|
65
66
|
class User < Model
|
66
67
|
end
|
68
|
+
|
69
|
+
class News < Model
|
70
|
+
end
|
71
|
+
|
72
|
+
module MyEngine
|
73
|
+
def self.use_relative_model_naming?
|
74
|
+
true
|
75
|
+
end
|
76
|
+
|
77
|
+
class Business < Model
|
78
|
+
end
|
79
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: responders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,12 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
25
30
|
description: A set of Rails 3 responders to dry up your application
|
26
31
|
email: contact@plataformatec.com.br
|
27
32
|
executables: []
|
@@ -77,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
82
|
version: '0'
|
78
83
|
requirements: []
|
79
84
|
rubyforge_project: responders
|
80
|
-
rubygems_version: 1.8.
|
85
|
+
rubygems_version: 1.8.23
|
81
86
|
signing_key:
|
82
87
|
specification_version: 3
|
83
88
|
summary: A set of Rails 3 responders to dry up your application
|
@@ -91,4 +96,3 @@ test_files:
|
|
91
96
|
- test/views/addresses/create.js.erb
|
92
97
|
- test/views/addresses/edit.html.erb
|
93
98
|
- test/views/addresses/new.html.erb
|
94
|
-
has_rdoc:
|