responders 2.1.0 → 2.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06ba4b048f7ab149753ce1222674abcde97594ce
4
- data.tar.gz: d10721b4e6683ecc3095d709134d9e8785909c7f
3
+ metadata.gz: 921e032d21bf201f9199b401ecdca88cbbc9668f
4
+ data.tar.gz: e2f710246648471f2f62fa37305c972497a2320a
5
5
  SHA512:
6
- metadata.gz: 89dbb2374f73e0090d5ef320ae5d52235a075de8f344475717c1dc45474d86a0a2fd8de8dd8d7a7661f166f014658841106635c57cf1dc9db36b1acea5ad37d5
7
- data.tar.gz: 973bbda1f6a6b6b4f056a8a5615b170d22f0e954fb2b77625279347e23f85378100fbf1d3079897c69174b304132099ed77c29963741439466bc0fdaff3b7120
6
+ metadata.gz: 7a1de1eab1ecd945eed1c5ea80c14bb9570902c00a2f19f9de2404bd267a5cc6ffad885c737594ec6ed559df473ae5e64ce293a9ed986a724cac458ba54ac56f
7
+ data.tar.gz: d02ec53cc1cb3b7001e03effb6167fdfb57b8823a8dbbf3d04eeaa029f94249e98dde1cb7154db9c451585a3c524b9ec6b680f4e56a9695ba87862fc7a74b5e0
@@ -1,3 +1,7 @@
1
+ ## 2.1.1
2
+
3
+ * Added support for Rails 5.
4
+
1
5
  ## 2.1.0
2
6
 
3
7
  * No longer automatically set the responders generator as many projects may use this gem as a dependency. When upgrading, users will need to add `config.app_generators.scaffold_controller :responders_controller` to their application. The `responders:install` generator has been updated to automatically insert it in new applications
@@ -1,4 +1,4 @@
1
- Copyright 2009-2014 Plataforma Tecnologia. http://blog.plataformatec.com.br
1
+ Copyright 2009-2015 Plataformatec. http://plataformatec.com.br
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Responders
2
2
 
3
- [![Gem Version](https://fury-badge.herokuapp.com/rb/responders.png)](http://badge.fury.io/rb/responders)
4
- [![Build Status](https://api.travis-ci.org/plataformatec/responders.png?branch=master)](http://travis-ci.org/plataformatec/responders)
5
- [![Code Climate](https://codeclimate.com/github/plataformatec/responders.png)](https://codeclimate.com/github/plataformatec/responders)
3
+ [![Gem Version](https://fury-badge.herokuapp.com/rb/responders.svg)](http://badge.fury.io/rb/responders)
4
+ [![Build Status](https://api.travis-ci.org/plataformatec/responders.svg?branch=master)](http://travis-ci.org/plataformatec/responders)
5
+ [![Code Climate](https://codeclimate.com/github/plataformatec/responders.svg)](https://codeclimate.com/github/plataformatec/responders)
6
6
 
7
7
  A set of responders modules to dry up your Rails 4.2+ app.
8
8
 
@@ -17,6 +17,10 @@ Update your bundle and run the install generator:
17
17
  $ bundle install
18
18
  $ rails g responders:install
19
19
 
20
+ If you are including this gem to support backwards compatibilty for responders in previous releases of Rails, you only need to include the gem and bundle.
21
+
22
+ $ bundle install
23
+
20
24
  ## Responders Types
21
25
 
22
26
  ### FlashResponder
@@ -101,6 +105,22 @@ class ThingsController < ApplicationController
101
105
  end
102
106
  ```
103
107
 
108
+ **Dealing with namespaced routes**
109
+
110
+ In order for the LocationResponder to find the correct route helper for namespaced routes you need to pass the namespaces to `respond_with`:
111
+
112
+ ```ruby
113
+ class Api::V1::ThingsController < ApplicationController
114
+ respond_to :json
115
+
116
+ # POST /api/v1/things
117
+ def create
118
+ @thing = Thing.create(thing_params)
119
+ respond_with :api, :v1, @thing
120
+ end
121
+ end
122
+ ```
123
+
104
124
  ## Configuring your own responder
105
125
 
106
126
  Responders only provides a set of modules and to use them you have to create your own
@@ -109,7 +129,7 @@ generated in your application:
109
129
 
110
130
  ```ruby
111
131
  # lib/application_responder.rb
112
- class AppResponder < ActionController::Responder
132
+ class ApplicationResponder < ActionController::Responder
113
133
  include Responders::FlashResponder
114
134
  include Responders::HttpCacheResponder
115
135
  end
@@ -122,7 +142,7 @@ Your application also needs to be configured to use it:
122
142
  require "application_responder"
123
143
 
124
144
  class ApplicationController < ActionController::Base
125
- self.responder = AppResponder
145
+ self.responder = ApplicationResponder
126
146
  respond_to :html
127
147
  end
128
148
  ```
@@ -182,4 +202,4 @@ If you discover any bugs or want to drop a line, feel free to create an issue on
182
202
 
183
203
  http://github.com/plataformatec/responders/issues
184
204
 
185
- MIT License. Copyright 2009-2014 Plataforma Tecnologia. http://blog.plataformatec.com.br
205
+ MIT License. Copyright 2009-2015 Plataformatec. http://plataformatec.com.br
@@ -175,7 +175,9 @@ module ActionController #:nodoc:
175
175
  # Also, a hash passed to +respond_with+ immediately after the specified
176
176
  # resource(s) is interpreted as a set of options relevant to all
177
177
  # formats. Any option accepted by +render+ can be used, e.g.
178
+ #
178
179
  # respond_with @people, status: 200
180
+ #
179
181
  # However, note that these options are ignored after an unsuccessful attempt
180
182
  # to save a resource, e.g. when automatically rendering <tt>:new</tt>
181
183
  # after a post request.
@@ -233,7 +233,7 @@ module ActionController #:nodoc:
233
233
  if @default_response
234
234
  @default_response.call(options)
235
235
  else
236
- controller.default_render(options)
236
+ controller.render(options)
237
237
  end
238
238
  end
239
239
 
@@ -34,4 +34,6 @@ module Responders
34
34
  end
35
35
  end
36
36
 
37
- ActionController::Base.extend Responders::ControllerMethod
37
+ ActiveSupport.on_load(:action_controller) do
38
+ ActionController::Base.extend Responders::ControllerMethod
39
+ end
@@ -1,3 +1,3 @@
1
1
  module Responders
2
- VERSION = "2.1.0".freeze
2
+ VERSION = "2.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: responders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2015-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 4.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5'
22
+ version: '5.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 4.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5'
32
+ version: '5.1'
33
33
  description: A set of Rails responders to dry up your application
34
34
  email: contact@plataformatec.com.br
35
35
  executables: []
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project: responders
76
- rubygems_version: 2.2.2
76
+ rubygems_version: 2.4.5
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: A set of Rails responders to dry up your application