hanami 1.3.3 → 1.3.4

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: 9ec1be46fff34a0e6278e8c08a20742d87622bb24ef82b5320c7f71c9900bc6d
4
- data.tar.gz: b88a1a45b04427a79a7c7d828353bca49df12de456815d35ff84c18ff09dcda0
3
+ metadata.gz: 97ed1063935d45a4613fd2361498251b968a462f4b01df368fbea563903958b7
4
+ data.tar.gz: 475fbab907b3f7f09988ac0872da11341133be9606796d8f9cb99ea6a8cea9fe
5
5
  SHA512:
6
- metadata.gz: 97ff7cbc39b2dca8623431ff84024f854d504618742035242f3ee6ca84af419ba6126812e2e7316f4cb1025f1b5be1b0f383ea7c9acc4947a726c4012e301ec0
7
- data.tar.gz: 53c4e2fe586a644adc84a32fa8f19ea41553796e0aeb33d40e0d60185a99bb225a6809b618693e0663569acd7bd040c402928629d8a54cdc63ee9e0a55bc5df2
6
+ metadata.gz: edeec9fbca157fe6b6a368d7be2a71d622071e5aa0aee19fb23b4180f344c1aaccad5cdf00c488d0cd7fcff04e661338272a19ee9d5a0358893510e3ac0bfa57
7
+ data.tar.gz: c52ec459e71ed05d2624a8007a9c7252ab397cf4f496a5b72cd2c4c56d66b88f4d9e33129681a2c9d3876c0ff4bca74be1de2dc63aa5aa25e0966cba1323ab3b
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Hanami
2
2
  The web, with simplicity.
3
3
 
4
+ ## v1.3.4 - 2021-05-02
5
+ ### Fixed
6
+ - [Slava Kardakov] Fix generated `config.ru` `require_relative` statement
7
+ - [Armin] Fix `Hanami::CommonLogger` elapsed time compatibility with `rack` 2.1.0+
8
+ - [Adam Daniels] Fix generated tests compatibility with `minitest` 6.0+
9
+
4
10
  ## v1.3.3 - 2019-09-20
5
11
  ### Added
6
12
  - [Gray Manley] Standardize file loading for `.env` files (see: https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use)
@@ -24,7 +30,7 @@ The web, with simplicity.
24
30
  ### Fixed
25
31
  - [Aidan Coyle] Remove from app generator support for deprecated `force_ssl` setting
26
32
  - [Alessandro Caporrini] Remove from app generator support for deprecated `body_parsers` setting
27
- - [Daphne Rouw & Sean Collins] Make app generator to work when code in `config/enviroment.rb` uses double quotes
33
+ - [Daphne Rouw & Sean Collins] Make app generator to work when code in `config/environment.rb` uses double quotes
28
34
 
29
35
  ## v1.3.0 - 2018-10-24
30
36
  ### Added
@@ -41,7 +47,7 @@ The web, with simplicity.
41
47
 
42
48
  ### Fixed
43
49
  - [Anton Davydov] Make possible to pass extra settings for custom logger instances (eg. `logger SemanticLogger.new, :foo, :bar`)
44
- - [graywolf] Ensure `hanami generate app` to work without `require_relative` entries in `config/enviroment.rb`
50
+ - [graywolf] Ensure `hanami generate app` to work without `require_relative` entries in `config/environment.rb`
45
51
  - [Makoto Tajitsu & Luca Guidi] Fixed regression for `hanami new .` that used to generate a broken project
46
52
 
47
53
  ### Fixed
@@ -158,7 +164,7 @@ The web, with simplicity.
158
164
  - [Luca Guidi] Make compatible with Rack 2.0 only
159
165
  - [Luca Guidi] Removed `logger` settings from Hanami applications
160
166
  - [Luca Guidi] Removed logger for Hanami applications (eg `Web.logger`)
161
- - [Luca Guidi] Changed mailer syntax in `config/enviroment.rb`
167
+ - [Luca Guidi] Changed mailer syntax in `config/environment.rb`
162
168
 
163
169
  ## v0.9.2 - 2016-12-19
164
170
  ## Added
@@ -247,11 +253,11 @@ The web, with simplicity.
247
253
 
248
254
  ## v0.7.2 - 2016-02-09
249
255
  ### Fixed
250
- - [Alfonso Uceda Pompa] Fixed routing issue when static assets server tried to hijiack paths that are matching directories in public directory
256
+ - [Alfonso Uceda Pompa] Fixed routing issue when static assets server tried to hijack paths that are matching directories in public directory
251
257
 
252
258
  ## v0.7.1 - 2016-02-05
253
259
  ### Fixed
254
- - [Anton Davydov] Fixed routing issue when static assets server tried to hijiack requests belonging to dynamic endpoints
260
+ - [Anton Davydov] Fixed routing issue when static assets server tried to hijack requests belonging to dynamic endpoints
255
261
  - [Anatolii Didukh] Ensure to fallback to default engine for `hanami console`
256
262
 
257
263
  ## v0.7.0 - 2016-01-22
@@ -386,7 +392,7 @@ The web, with simplicity.
386
392
  ## v0.3.0 - 2015-03-23
387
393
  ### Added
388
394
  - [Luca Guidi] Introduced action generator. Eg. `bundle exec lotus generate action web dashboard#index`
389
- - [Alfonso Uceda Pompa] Allow to specify default coookies options in application configuration. Eg. `cookies true, { domain: 'lotusrb.org' }`
395
+ - [Alfonso Uceda Pompa] Allow to specify default cookies options in application configuration. Eg. `cookies true, { domain: 'lotusrb.org' }`
390
396
  - [Tom Kadwill] Include `Lotus::Helpers` in views.
391
397
  - [Linus Pettersson] Allow to specify `--database` CLI option when generate a new project. Eg. `lotus new bookshelf --database=postgresql`
392
398
  - [Linus Pettersson] Initialize a Git repository when generating a new project
data/FEATURES.md CHANGED
@@ -26,7 +26,7 @@
26
26
  - Unobtrusive JavaScript (UJS) (via `hanami-ujs` gem)
27
27
  - Interactive console for development error page (via `hanami-webconsole` gem)
28
28
  - CLI: register callbacks for `hanami` commands (`Hanami::CLI.after("db migrate", MyCallback.new)` or `Hanami::CLI.after("db migrate") { ... }`)
29
- - Project level Rack middleware stack (`Hanami.configure { middleware.use MyRackMiddlewre }`)
29
+ - Project level Rack middleware stack (`Hanami.configure { middleware.use MyRackMiddleware }`)
30
30
  - Plugins can hook into project configuration (`Hanami.plugin { middleware.use AnotherRackMiddleware }`)
31
31
  - Custom repository commands
32
32
  - Coloured logging
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright © 2014-2019 Luca Guidi
1
+ Copyright © 2014-2021 Luca Guidi
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -18,7 +18,6 @@ which provides the glue that ties all the parts together:
18
18
  * [**Hanami::Helpers**](https://github.com/hanami/helpers) - View helpers for Ruby applications
19
19
  * [**Hanami::Mailer**](https://github.com/hanami/mailer) - Mail for Ruby applications
20
20
  * [**Hanami::Assets**](https://github.com/hanami/assets) - Assets management for Ruby
21
- * [**Hanami::CLI**](https://github.com/hanami/cli) - Ruby command line interface
22
21
  * [**Hanami::Utils**](https://github.com/hanami/utils) - Ruby core extensions and class utilities
23
22
 
24
23
  These components are designed to be used independently or together in a Hanami application.
@@ -26,7 +25,7 @@ These components are designed to be used independently or together in a Hanami a
26
25
  ## Status
27
26
 
28
27
  [![Gem Version](https://badge.fury.io/rb/hanami.svg)](https://badge.fury.io/rb/hanami)
29
- [![TravisCI](https://travis-ci.org/hanami/hanami.svg?branch=master)](https://travis-ci.org/hanami/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)
30
29
  [![Test Coverage](https://codecov.io/gh/hanami/hanami/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/hanami)
31
30
  [![Depfu](https://badges.depfu.com/badges/ba000e0f69e6ef1c44cd3038caaa1841/overview.svg)](https://depfu.com/github/hanami/hanami?project=Bundler)
32
31
  [![Inline Docs](http://inch-ci.org/github/hanami/hanami.svg)](http://inch-ci.org/github/hanami/hanami)
@@ -137,4 +136,4 @@ Released under MIT License.
137
136
 
138
137
  This project was formerly known as Lotus (`lotusrb`).
139
138
 
140
- Copyright © 2014-2019 Luca Guidi.
139
+ Copyright © 2014-2021 Luca Guidi.
data/bin/hanami CHANGED
@@ -3,4 +3,4 @@ require 'bundler'
3
3
  require 'hanami/cli/commands'
4
4
 
5
5
  ::Bundler.require(:plugins) if File.exist?(ENV["BUNDLE_GEMFILE"] || "Gemfile")
6
- Hanami::CLI.new(Hanami::CLI::Commands).call
6
+ Dry::CLI.new(Hanami::CLI::Commands).call
data/hanami.gemspec CHANGED
@@ -29,12 +29,12 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency 'hanami-helpers', '~> 1.3'
30
30
  spec.add_dependency 'hanami-mailer', '~> 1.3'
31
31
  spec.add_dependency 'hanami-assets', '~> 1.3'
32
- spec.add_dependency 'hanami-cli', '~> 0.3'
32
+ spec.add_dependency 'dry-cli', '~> 0.5'
33
33
  spec.add_dependency 'concurrent-ruby', '~> 1.0'
34
34
  spec.add_dependency 'bundler', '>= 1.6', '< 3'
35
35
 
36
36
  spec.add_development_dependency 'rspec', '~> 3.7'
37
37
  spec.add_development_dependency 'rack-test', '~> 1.1'
38
38
  spec.add_development_dependency 'aruba', '~> 0.14'
39
- spec.add_development_dependency 'rake', '~> 12.0'
39
+ spec.add_development_dependency 'rake', '~> 13.0'
40
40
  end
@@ -1,4 +1,4 @@
1
- require 'hanami/cli'
1
+ require 'dry/cli'
2
2
  require 'ostruct'
3
3
 
4
4
  module Hanami
@@ -54,7 +54,7 @@ module Hanami
54
54
  # @since 1.1.0
55
55
  # @api private
56
56
  module Commands
57
- extend Hanami::CLI::Registry
57
+ extend Dry::CLI::Registry
58
58
 
59
59
  # CLI command context
60
60
  #
@@ -1,7 +1,7 @@
1
1
  require 'hanami'
2
2
  require 'hanami/environment'
3
3
  require 'hanami/components'
4
- require 'hanami/cli/command'
4
+ require 'dry/cli/command'
5
5
  require 'hanami/cli/commands/project'
6
6
  require 'hanami/cli/commands/templates'
7
7
  require 'concurrent'
@@ -17,7 +17,7 @@ module Hanami
17
17
  # Abstract command
18
18
  #
19
19
  # @since 1.1.0
20
- class Command < Hanami::CLI::Command
20
+ class Command < Dry::CLI::Command
21
21
  # @since 1.1.0
22
22
  # @api private
23
23
  def self.inherited(component)
@@ -82,7 +82,7 @@ module Hanami
82
82
  options = environment.to_options.merge(options)
83
83
  end
84
84
 
85
- super(options)
85
+ super(**options)
86
86
  rescue StandardError => e
87
87
  warn e.message
88
88
  warn e.backtrace.join("\n\t")
@@ -92,9 +92,7 @@ module Hanami
92
92
 
93
93
  # @since 1.1.0
94
94
  # @api private
95
- def initialize(command_name:, out: $stdout, files: Utils::Files)
96
- super(command_name: command_name)
97
-
95
+ def initialize(out: $stdout, files: Utils::Files)
98
96
  @out = out
99
97
  @files = files
100
98
  @templates = Templates.new(self.class)
@@ -6,6 +6,6 @@ describe <%= app.classify %>::Controllers::<%= classified_controller_name %>::<%
6
6
 
7
7
  it 'is successful' do
8
8
  response = action.call(params)
9
- response[0].must_equal 200
9
+ _(response[0]).must_equal 200
10
10
  end
11
11
  end
@@ -7,6 +7,6 @@ describe <%= app.classify %>::Views::<%= classified_controller_name %>::<%= acti
7
7
  let(:rendered) { view.render }
8
8
 
9
9
  it 'exposes #format' do
10
- view.format.must_equal exposures.fetch(:format)
10
+ _(view.format).must_equal exposures.fetch(:format)
11
11
  end
12
12
  end
@@ -5,6 +5,6 @@ describe <%= app.classify %>::Views::ApplicationLayout do
5
5
  let(:rendered) { layout.render }
6
6
 
7
7
  it 'contains application name' do
8
- rendered.must_include('<%= app.classify %>')
8
+ _(rendered).must_include('<%= app.classify %>')
9
9
  end
10
10
  end
@@ -502,7 +502,7 @@ module Hanami
502
502
  # @since 1.1.0
503
503
  # @api private
504
504
  def generate_app(context)
505
- Hanami::CLI::Commands::New::App.new(command_name: "generate app", out: @out, files: @files).call(app: context.application_name, application_base_url: context.application_base_url, **context.options)
505
+ Hanami::CLI::Commands::New::App.new(out: @out, files: @files).call(app: context.application_name, application_base_url: context.application_base_url, **context.options)
506
506
  end
507
507
 
508
508
  # @since 1.1.0
@@ -565,8 +565,8 @@ module Hanami
565
565
 
566
566
  # @since 1.1.0
567
567
  # @api private
568
- def initialize(*)
569
- super
568
+ def initialize(*args, **kwargs)
569
+ super(*args, **kwargs)
570
570
  @templates = Templates.new(self.class.superclass)
571
571
  end
572
572
  end
@@ -10,7 +10,6 @@ gem 'hanami-controller', require: false, git: 'https://github.com/hanami/contro
10
10
  gem 'hanami-view', require: false, git: 'https://github.com/hanami/view.git', branch: 'develop'
11
11
  gem 'hanami-helpers', require: false, git: 'https://github.com/hanami/helpers.git', branch: 'develop'
12
12
  gem 'hanami-mailer', require: false, git: 'https://github.com/hanami/mailer.git', branch: 'develop'
13
- gem 'hanami-cli', require: false, git: 'https://github.com/hanami/cli.git', branch: 'develop'
14
13
  gem 'hanami-assets', require: false, git: 'https://github.com/hanami/assets.git', branch: 'develop'
15
14
  gem 'hanami-model', require: false, git: 'https://github.com/hanami/model.git', branch: 'develop'
16
15
  gem 'hanami', git: 'https://github.com/hanami/hanami.git', branch: 'develop'
@@ -1,3 +1,3 @@
1
- require './config/environment'
1
+ require_relative 'config/environment'
2
2
 
3
3
  run Hanami.app
@@ -55,7 +55,7 @@ module Hanami
55
55
  # rubocop:disable Metrics/AbcSize
56
56
  # rubocop:disable Metrics/MethodLength
57
57
  def log(env, status, header, began_at)
58
- now = Time.now
58
+ now = ElapsedTime.call
59
59
  length = extract_content_length(header)
60
60
 
61
61
  msg = Hash[
@@ -89,5 +89,21 @@ module Hanami
89
89
  result.merge!(Utils::Hash.deep_stringify(env.fetch(ROUTER_PARAMS, {})))
90
90
  result
91
91
  end
92
+
93
+ # Wrapper which uses Rack's monotonic clock_time (used for began_at since Rack 2.1.0)
94
+ #
95
+ # @since 1.3.4
96
+ # @api private
97
+ class ElapsedTime
98
+ @clock = if Gem::Version.new(Rack::RELEASE) >= Gem::Version.new('2.1.0')
99
+ -> { Rack::Utils.clock_time }
100
+ else
101
+ -> { Time.now }
102
+ end.freeze
103
+
104
+ def self.call
105
+ @clock.call
106
+ end
107
+ end
92
108
  end
93
109
  end
@@ -5,7 +5,7 @@ module Hanami
5
5
  # @since 0.9.0
6
6
  # @api private
7
7
  module App
8
- # hanami-assets configuration for a sigle Hanami application in the project.
8
+ # hanami-assets configuration for a single Hanami application in the project.
9
9
  #
10
10
  # @since 0.9.0
11
11
  # @api private
@@ -8,7 +8,7 @@ module Hanami
8
8
  # @since 0.9.0
9
9
  # @api private
10
10
  module App
11
- # hanami-controller configuration for a sigle Hanami application in the project.
11
+ # hanami-controller configuration for a single Hanami application in the project.
12
12
  #
13
13
  # @since 0.9.0
14
14
  # @api private
@@ -8,7 +8,7 @@ module Hanami
8
8
  # @since 0.9.0
9
9
  # @api private
10
10
  module App
11
- # hanami-router configuration for a sigle Hanami application in the project.
11
+ # hanami-router configuration for a single Hanami application in the project.
12
12
  #
13
13
  # @since 0.9.0
14
14
  # @api private
@@ -5,7 +5,7 @@ module Hanami
5
5
  # @since 0.9.0
6
6
  # @api private
7
7
  module App
8
- # hanami-view configuration for a sigle Hanami application in the project.
8
+ # hanami-view configuration for a single Hanami application in the project.
9
9
  #
10
10
  # @since 0.9.0
11
11
  # @api private
@@ -3,7 +3,7 @@
3
3
  module Hanami
4
4
  # HTTP/2 Early Hints Rack middleware
5
5
  #
6
- # It sends extra responses **before** the main reponse is sent.
6
+ # It sends extra responses **before** the main response is sent.
7
7
  # These extra responses are HTTP/2 Early Hints (103).
8
8
  # They specify the web assets (javascripts, stylesheets, etc..) to be "pushed",
9
9
  # so modern browsers pre-fetch them in parallel with the main HTTP response.
@@ -71,7 +71,7 @@ module Hanami
71
71
  # @api private
72
72
  def run_hanami_command(command)
73
73
  require "hanami/cli/commands"
74
- Hanami::CLI.new(Hanami::CLI::Commands).call(arguments: command.split(/[[:space:]]/))
74
+ Dry::CLI.new(Hanami::CLI::Commands).call(arguments: command.split(/[[:space:]]/))
75
75
  end
76
76
  # rubocop:enable Metrics/MethodLength
77
77
  end
@@ -6,7 +6,7 @@ module Hanami
6
6
  module Version
7
7
  # @since 0.9.0
8
8
  # @api private
9
- VERSION = '1.3.3'.freeze
9
+ VERSION = '1.3.4'.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.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-20 00:00:00.000000000 Z
11
+ date: 2021-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hanami-utils
@@ -129,19 +129,19 @@ dependencies:
129
129
  - !ruby/object:Gem::Version
130
130
  version: '1.3'
131
131
  - !ruby/object:Gem::Dependency
132
- name: hanami-cli
132
+ name: dry-cli
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '0.3'
137
+ version: '0.5'
138
138
  type: :runtime
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '0.3'
144
+ version: '0.5'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: concurrent-ruby
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -224,14 +224,14 @@ dependencies:
224
224
  requirements:
225
225
  - - "~>"
226
226
  - !ruby/object:Gem::Version
227
- version: '12.0'
227
+ version: '13.0'
228
228
  type: :development
229
229
  prerelease: false
230
230
  version_requirements: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - "~>"
233
233
  - !ruby/object:Gem::Version
234
- version: '12.0'
234
+ version: '13.0'
235
235
  description: Hanami is a web framework for Ruby
236
236
  email:
237
237
  - me@lucaguidi.com
@@ -401,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
401
401
  - !ruby/object:Gem::Version
402
402
  version: '0'
403
403
  requirements: []
404
- rubygems_version: 3.0.3
404
+ rubygems_version: 3.2.2
405
405
  signing_key:
406
406
  specification_version: 4
407
407
  summary: The web, with simplicity