responders 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ ## 0.9.3
2
+
3
+ * Fix url generation for namespaced models
4
+
1
5
  ## 0.9.2
2
6
 
3
7
  * Properly inflect custom responders names
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source :rubygems
3
3
  gemspec
4
4
 
5
5
  # Fixed 3.2.1 because 3.2.2 is broken
6
- gem 'railties', '3.2.1'
6
+ gem 'railties', '~> 3.2.3'
7
7
 
8
8
  gem 'mocha'
9
9
 
@@ -1,55 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- responders (0.9.2)
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.1)
11
- activemodel (= 3.2.1)
12
- activesupport (= 3.2.1)
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.1)
15
+ journey (~> 1.0.4)
16
16
  rack (~> 1.4.0)
17
- rack-cache (~> 1.1)
17
+ rack-cache (~> 1.2)
18
18
  rack-test (~> 0.6.1)
19
- sprockets (~> 2.1.2)
20
- activemodel (3.2.1)
21
- activesupport (= 3.2.1)
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.1)
23
+ activesupport (3.2.8)
24
24
  i18n (~> 0.6)
25
25
  multi_json (~> 1.0)
26
- builder (3.0.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.0)
31
- journey (1.0.3)
32
- json (1.6.5)
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.1.0)
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.1)
44
+ rack-test (0.6.2)
45
45
  rack (>= 1.0)
46
- railties (3.2.1)
47
- actionpack (= 3.2.1)
48
- activesupport (= 3.2.1)
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 (~> 0.14.6)
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.2)
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.14.6)
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 (= 3.2.1)
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.plural.to_sym
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
@@ -1,3 +1,3 @@
1
1
  module Responders
2
- VERSION = "0.9.2".freeze
2
+ VERSION = "0.9.3".freeze
3
3
  end
@@ -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
- end
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
@@ -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.2
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-07-18 00:00:00.000000000 Z
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: &2166146420 !ruby/object:Gem::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: *2166146420
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.15
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: