hanami-controller 1.1.0 → 1.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
- SHA1:
3
- metadata.gz: e43dfef6c8d6484a6ef636194dd0369b7780274b
4
- data.tar.gz: f8d80e3ab997981d7dff0beecf372359334bf484
2
+ SHA256:
3
+ metadata.gz: dec60bc59285348cfcf6fc743dbc586d8bd7356bfb02197db37bc18fe0131fcd
4
+ data.tar.gz: c8b851ca2730d18b886dcb4300fdcd28c31c12cf03df5505c995bd4a3819ef28
5
5
  SHA512:
6
- metadata.gz: fc087535ca74c735b55c7fe5fbeb618b3e6fb974e85b28163092ab5db3da74334ef7111431fa1a3dbfaa7afab4c8dac46fdf0e0f7af377d6829886db355309a4
7
- data.tar.gz: 9ab870daa9fed48f56ffa14a8efa6138bc9c4cba09a03f8788d278f99f5d82eab1084e0315307c79fb1e475ce7da5585ca222a96e8dc42d92b4c18556ee1bd56
6
+ metadata.gz: a0bdc218188b3f71d5bd22bd11e81fae44089dad09191ed31ea5a1da742e4ea007df521e899469bbe01e3fd8d28d9652ec032589e83e817733a53144860a8582
7
+ data.tar.gz: f0f04ea096539c67c1413dc1a527b68aa258a155389324601c9cbf419c1423f0eb6fcf8a23cce67f49cf4d1109a98dd3f068f6a88dcff5b8d337fd2dba66fd91
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Hanami::Controller
2
2
  Complete, fast and testable actions for Rack
3
3
 
4
+ ## v1.1.1 - 2017-11-22
5
+ ### Fixed
6
+ - [Luca Guidi] Ensure `Hanami::Action#send_file` and `#unsafe_send_file` to run `after` action callbacks
7
+ - [Luca Guidi] Ensure Rack env to have the `REQUEST_METHOD` key set to `GET` during actions unit tests
8
+
4
9
  ## v1.1.0 - 2017-10-25
5
10
  ### Added
6
11
  - [Luca Guidi] Introduce `Hanami::Action::CookieJar#each` to iterate through action's `cookies`
@@ -29,6 +29,18 @@ module Hanami
29
29
  # action.session[:foo] # => "bar"
30
30
  RACK_SESSION = 'rack.session'.freeze
31
31
 
32
+ # HTTP request method for Rack env
33
+ #
34
+ # @since 1.1.1
35
+ # @api private
36
+ REQUEST_METHOD = 'REQUEST_METHOD'.freeze
37
+
38
+ # Default HTTP request method for Rack env
39
+ #
40
+ # @since 1.1.1
41
+ # @api private
42
+ DEFAULT_REQUEST_METHOD = 'GET'.freeze
43
+
32
44
  # @attr_reader env [Hash] the Rack env
33
45
  #
34
46
  # @since 0.7.0
@@ -150,6 +162,7 @@ module Hanami
150
162
  result.merge! _router_params
151
163
  else
152
164
  result.merge! _router_params(env)
165
+ env[REQUEST_METHOD] ||= DEFAULT_REQUEST_METHOD
153
166
  end
154
167
 
155
168
  result
@@ -383,6 +383,10 @@ module Hanami
383
383
  headers.delete(CONTENT_LENGTH)
384
384
  halt NOT_FOUND
385
385
  else
386
+ # FIXME: this is a fix for https://github.com/hanami/controller/issues/240
387
+ # It's here to maintain the backward compat with 1.1, as we can't remove `#halt`
388
+ # We should review the workflow for 2.0, because I don't like callbacks to be referenced from here.
389
+ _run_after_callbacks(params)
386
390
  halt response[RESPONSE_CODE], response[RESPONSE_BODY]
387
391
  end
388
392
  end
@@ -3,6 +3,6 @@ module Hanami
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '1.1.0'.freeze
6
+ VERSION = '1.1.1'.freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-25 00:00:00.000000000 Z
11
+ date: 2017-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.6.13
161
+ rubygems_version: 2.7.1
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Complete, fast and testable actions for Rack and Hanami