hanami 1.3.4 → 1.3.5

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
  SHA256:
3
- metadata.gz: 97ed1063935d45a4613fd2361498251b968a462f4b01df368fbea563903958b7
4
- data.tar.gz: 475fbab907b3f7f09988ac0872da11341133be9606796d8f9cb99ea6a8cea9fe
3
+ metadata.gz: 92d8362c387abfc24cda9234c81c671d544f03a2ae2680c9f71d492c7172410a
4
+ data.tar.gz: 57643cd0ca74fd851e800edbe62c18464dc5ca0dcd09c66189ed53b256beb5f0
5
5
  SHA512:
6
- metadata.gz: edeec9fbca157fe6b6a368d7be2a71d622071e5aa0aee19fb23b4180f344c1aaccad5cdf00c488d0cd7fcff04e661338272a19ee9d5a0358893510e3ac0bfa57
7
- data.tar.gz: c52ec459e71ed05d2624a8007a9c7252ab397cf4f496a5b72cd2c4c56d66b88f4d9e33129681a2c9d3876c0ff4bca74be1de2dc63aa5aa25e0966cba1323ab3b
6
+ metadata.gz: 6570e1184cc95fe719bbb366f59f082ccafdc55dddae70496c98579cd53f4d46a31bd740030b500e5d2b7ed03e2df8f42148344170c1a90453209b2575960441
7
+ data.tar.gz: f2409cb5bc4d8bf3c7fe4bfa026eb03a9315fb6ccb80e95aa2b44e9b94600427cab0814a00d32035128a3ace49b42ed35644e1d0652ffc584be2ac5ea6564db5
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Hanami
2
2
  The web, with simplicity.
3
3
 
4
+ ## v1.3.5 - 2021-10-18
5
+ ### Fixed
6
+ - [Ivan Kabluchkov] Ensure to properly store exceptions in Rack environment
7
+ - [Sean Collins] Explicitly limit in gemspec the supported rubies (>= 2.3 and < 3) for Hanami 1
8
+
9
+ ### Changed
10
+ - [Luca Guidi] Use JSON as default HTTP session serializer for cookie session storage
11
+
4
12
  ## v1.3.4 - 2021-05-02
5
13
  ### Fixed
6
14
  - [Slava Kardakov] Fix generated `config.ru` `require_relative` statement
data/FEATURES.md CHANGED
@@ -3,6 +3,10 @@
3
3
 
4
4
  ## Features
5
5
 
6
+ ## v1.3.5 - 2021-10-18
7
+
8
+ ## v1.3.4 - 2021-05-02
9
+
6
10
  ## v1.3.3 - 2019-09-20
7
11
 
8
12
  - Standardize file loading for `.env` files (see: https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use)
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  The web, with simplicity.
4
4
 
5
+ ## Version
6
+
7
+ **This branch contains the code for `hanami` 1.3.x.**
8
+
5
9
  ## Frameworks
6
10
 
7
11
  Hanami is a **full-stack** Ruby web framework.
@@ -25,8 +29,8 @@ These components are designed to be used independently or together in a Hanami a
25
29
  ## Status
26
30
 
27
31
  [![Gem Version](https://badge.fury.io/rb/hanami.svg)](https://badge.fury.io/rb/hanami)
28
- [![CI](https://github.com/hanami/hanami/workflows/ci/badge.svg?branch=master)](https://github.com/hanami/hanami/actions?query=workflow%3Aci+branch%3Amaster)
29
- [![Test Coverage](https://codecov.io/gh/hanami/hanami/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/hanami)
32
+ [![CI](https://github.com/hanami/hanami/workflows/ci/badge.svg?branch=1.3.x)](https://github.com/hanami/hanami/actions?query=workflow%3Aci+branch%3A1.3.x)
33
+ [![Test Coverage](https://codecov.io/gh/hanami/hanami/branch/1.3.x/graph/badge.svg)](https://codecov.io/gh/hanami/hanami)
30
34
  [![Depfu](https://badges.depfu.com/badges/ba000e0f69e6ef1c44cd3038caaa1841/overview.svg)](https://depfu.com/github/hanami/hanami?project=Bundler)
31
35
  [![Inline Docs](http://inch-ci.org/github/hanami/hanami.svg)](http://inch-ci.org/github/hanami/hanami)
32
36
 
data/hanami.gemspec CHANGED
@@ -17,14 +17,14 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test)/})
19
19
  spec.require_paths = ['lib']
20
- spec.required_ruby_version = '>= 2.3.0'
20
+ spec.required_ruby_version = '>= 2.3.0', '< 3'
21
21
 
22
22
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
23
23
 
24
24
  spec.add_dependency 'hanami-utils', '~> 1.3'
25
25
  spec.add_dependency 'hanami-validations', '>= 1.3', '< 3'
26
26
  spec.add_dependency 'hanami-router', '~> 1.3'
27
- spec.add_dependency 'hanami-controller', '~> 1.3'
27
+ spec.add_dependency 'hanami-controller', '~> 1.3', '>= 1.3.3'
28
28
  spec.add_dependency 'hanami-view', '~> 1.3'
29
29
  spec.add_dependency 'hanami-helpers', '~> 1.3'
30
30
  spec.add_dependency 'hanami-mailer', '~> 1.3'
@@ -33,6 +33,7 @@ module Hanami
33
33
  # @api private
34
34
  #
35
35
  # @see http://www.rubydoc.info/github/rack/rack/Rack/Session/Abstract/ID
36
+ # @see https://www.rubydoc.info/github/rack/rack/Rack/Session/Cookie
36
37
  def initialize(adapter = nil, options = {}, configuration = nil)
37
38
  @adapter = adapter
38
39
  @options = options
@@ -77,11 +78,17 @@ module Hanami
77
78
  # @since 0.2.0
78
79
  # @api private
79
80
  def default_options
80
- if @configuration
81
+ result = if @configuration
81
82
  { domain: domain, secure: @configuration.ssl? }
82
83
  else
83
84
  {}
84
85
  end
86
+
87
+ if s = cookies_adapter_serializer
88
+ result[:coder] = s
89
+ end
90
+
91
+ result
85
92
  end
86
93
 
87
94
  # @since 0.2.0
@@ -98,6 +105,15 @@ module Hanami
98
105
  def ip_address?(string)
99
106
  !!IPAddr.new(string) rescue false
100
107
  end
108
+
109
+ # @since 1.3.5
110
+ # @api private
111
+ def cookies_adapter_serializer
112
+ return nil unless @adapter == :cookie
113
+
114
+ require "rack/session/cookie"
115
+ Rack::Session::Cookie::Base64::JSON.new
116
+ end
101
117
  end
102
118
  end
103
119
  end
@@ -1,6 +1,7 @@
1
1
  require 'hanami/utils/class'
2
2
  require 'hanami/views/default'
3
3
  require 'hanami/views/null_view'
4
+ require 'hanami/action/rack/errors'
4
5
 
5
6
  module Hanami
6
7
  # Rendering policy
@@ -17,8 +18,6 @@ module Hanami
17
18
 
18
19
  # @api private
19
20
  HANAMI_ACTION = 'hanami.action'.freeze
20
- # @api private
21
- RACK_EXCEPTION = 'rack.exception'.freeze
22
21
 
23
22
  # @api private
24
23
  SUCCESSFUL_STATUSES = (200..201).freeze
@@ -57,7 +56,7 @@ module Hanami
57
56
  action.exposures
58
57
  )
59
58
  rescue StandardError => e
60
- env[RACK_EXCEPTION] = e
59
+ Hanami::Action::Rack::Errors.set(env, e)
61
60
  raise e unless @configuration.handle_exceptions
62
61
 
63
62
  response[STATUS] = ERROR_STATUS
@@ -6,7 +6,7 @@ module Hanami
6
6
  module Version
7
7
  # @since 0.9.0
8
8
  # @api private
9
- VERSION = '1.3.4'.freeze
9
+ VERSION = '1.3.5'.freeze
10
10
 
11
11
  # @since 0.9.0
12
12
  # @api private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-02 00:00:00.000000000 Z
11
+ date: 2021-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hanami-utils
@@ -65,6 +65,9 @@ dependencies:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: '1.3'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 1.3.3
68
71
  type: :runtime
69
72
  prerelease: false
70
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -72,6 +75,9 @@ dependencies:
72
75
  - - "~>"
73
76
  - !ruby/object:Gem::Version
74
77
  version: '1.3'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 1.3.3
75
81
  - !ruby/object:Gem::Dependency
76
82
  name: hanami-view
77
83
  requirement: !ruby/object:Gem::Requirement
@@ -395,6 +401,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
395
401
  - - ">="
396
402
  - !ruby/object:Gem::Version
397
403
  version: 2.3.0
404
+ - - "<"
405
+ - !ruby/object:Gem::Version
406
+ version: '3'
398
407
  required_rubygems_version: !ruby/object:Gem::Requirement
399
408
  requirements:
400
409
  - - ">="