responders 0.9.0 → 0.9.1

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 CHANGED
@@ -1,4 +1,8 @@
1
- ## 0.9
1
+ ## 0.9.1
2
+
3
+ * Fix bug with namespace lookup
4
+
5
+ ## 0.9.0
2
6
 
3
7
  * Disable namespace lookup by default
4
8
 
data/Gemfile CHANGED
@@ -2,6 +2,9 @@ source :rubygems
2
2
 
3
3
  gemspec
4
4
 
5
+ # Fixed 3.2.1 because 3.2.2 is broken
6
+ gem 'railties', '3.2.1'
7
+
5
8
  gem 'mocha'
6
9
 
7
10
  gem 'ruby-debug', :platform => :mri_18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- responders (0.8.0)
4
+ responders (0.9.1)
5
5
  railties (~> 3.1)
6
6
 
7
7
  GEM
@@ -37,7 +37,7 @@ GEM
37
37
  metaclass (~> 0.0.1)
38
38
  multi_json (1.1.0)
39
39
  rack (1.4.1)
40
- rack-cache (1.1)
40
+ rack-cache (1.2)
41
41
  rack (>= 0.4)
42
42
  rack-ssl (1.3.2)
43
43
  rack
@@ -71,5 +71,6 @@ PLATFORMS
71
71
 
72
72
  DEPENDENCIES
73
73
  mocha
74
+ railties (= 3.2.1)
74
75
  responders!
75
76
  ruby-debug
data/README.md CHANGED
@@ -126,6 +126,15 @@ This gem also includes a responders controller generator, so your scaffold can b
126
126
  to use `respond_with` instead of default `respond_to` blocks. Installing this gem automatically
127
127
  sets the generator.
128
128
 
129
+ ## Examples
130
+
131
+ Want more examples ? Check out this blog posts:
132
+
133
+ * [One in Three: Inherited Resources, Has Scope and Responders](http://blog.plataformatec.com.br/2009/12/one-in-three-inherited-resources-has-scope-and-responders/)
134
+ * [Embracing REST with mind, body and soul](http://blog.plataformatec.com.br/2009/08/embracing-rest-with-mind-body-and-soul/)
135
+ * [Three reasons to love ActionController::Responder](http://weblog.rubyonrails.org/2009/8/31/three-reasons-love-responder/)
136
+ * [My five favorite things about Rails 3](http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/)
137
+
129
138
  ## Bugs and Feedback
130
139
 
131
140
  If you discover any bugs or want to drop a line, feel free to create an issue on GitHub.
@@ -169,7 +169,9 @@ module Responders
169
169
 
170
170
  begin
171
171
  controller_scope = :"flash.#{slices.fill(controller.controller_name, -1).join('.')}.#{controller.action_name}.#{status}"
172
- actions_scope = :"flash.#{slices.fill('actions', -1).join('.')}.#{controller.action_name}.#{status}"
172
+
173
+ actions_scope = lookup ? slices.fill('actions', -1).join('.') : :actions
174
+ actions_scope = :"flash.#{actions_scope}.#{controller.action_name}.#{status}"
173
175
 
174
176
  defaults << :"#{controller_scope}_html"
175
177
  defaults << controller_scope
@@ -1,3 +1,3 @@
1
1
  module Responders
2
- VERSION = "0.9.0".freeze
2
+ VERSION = "0.9.1".freeze
3
3
  end
@@ -196,8 +196,11 @@ class NamespacedFlashResponderTest < ActionController::TestCase
196
196
  end
197
197
 
198
198
  def test_sets_the_flash_message_based_on_namespace_actions
199
+ Responders::FlashResponder.namespace_lookup = true
199
200
  post :create
200
201
  assert_equal "Admin created address with success", flash[:notice]
202
+ ensure
203
+ Responders::FlashResponder.namespace_lookup = false
201
204
  end
202
205
 
203
206
  def test_fallbacks_to_non_namespaced_controller_flash_message
@@ -208,8 +211,13 @@ class NamespacedFlashResponderTest < ActionController::TestCase
208
211
  Responders::FlashResponder.namespace_lookup = false
209
212
  end
210
213
 
214
+ def test_does_not_fallbacks_to_namespaced_actions_if_disabled
215
+ post :create
216
+ assert_equal "Address was successfully created.", flash[:notice]
217
+ end
218
+
211
219
  def test_does_not_fallbacks_to_non_namespaced_controller_flash_message_if_disabled
212
- delete :destroy
220
+ post :new
213
221
  assert_equal nil, flash[:notice]
214
222
  end
215
223
  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.0
4
+ version: 0.9.1
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-03-16 00:00:00.000000000 Z
12
+ date: 2012-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &2156123020 !ruby/object:Gem::Requirement
16
+ requirement: &70100053167580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156123020
24
+ version_requirements: *70100053167580
25
25
  description: A set of Rails 3 responders to dry up your application
26
26
  email: contact@plataformatec.com.br
27
27
  executables: []
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project: responders
80
- rubygems_version: 1.8.15
80
+ rubygems_version: 1.8.11
81
81
  signing_key:
82
82
  specification_version: 3
83
83
  summary: A set of Rails 3 responders to dry up your application