hanami 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -6
- data/FEATURES.md +1 -1
- data/LICENSE.md +1 -1
- data/README.md +2 -3
- data/bin/hanami +1 -1
- data/hanami.gemspec +2 -2
- data/lib/hanami/cli/commands.rb +2 -2
- data/lib/hanami/cli/commands/command.rb +4 -6
- data/lib/hanami/cli/commands/generate/action/action_spec.minitest.erb +1 -1
- data/lib/hanami/cli/commands/generate/action/view_spec.minitest.erb +1 -1
- data/lib/hanami/cli/commands/generate/app/layout_spec.minitest.erb +1 -1
- data/lib/hanami/cli/commands/new.rb +3 -3
- data/lib/hanami/cli/commands/new/Gemfile.erb +0 -1
- data/lib/hanami/cli/commands/new/config.ru.erb +1 -1
- data/lib/hanami/common_logger.rb +17 -1
- data/lib/hanami/components/app/assets.rb +1 -1
- data/lib/hanami/components/app/controller.rb +1 -1
- data/lib/hanami/components/app/routes.rb +1 -1
- data/lib/hanami/components/app/view.rb +1 -1
- data/lib/hanami/early_hints.rb +1 -1
- data/lib/hanami/rake_helper.rb +1 -1
- data/lib/hanami/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97ed1063935d45a4613fd2361498251b968a462f4b01df368fbea563903958b7
|
4
|
+
data.tar.gz: 475fbab907b3f7f09988ac0872da11341133be9606796d8f9cb99ea6a8cea9fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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/
|
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/
|
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
|
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
|
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
|
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
|
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
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
|
-
[![
|
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-
|
139
|
+
Copyright © 2014-2021 Luca Guidi.
|
data/bin/hanami
CHANGED
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 '
|
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', '~>
|
39
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
40
40
|
end
|
data/lib/hanami/cli/commands.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
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
|
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 '
|
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 <
|
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(
|
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)
|
@@ -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(
|
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'
|
data/lib/hanami/common_logger.rb
CHANGED
@@ -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 =
|
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
|
@@ -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
|
11
|
+
# hanami-controller configuration for a single Hanami application in the project.
|
12
12
|
#
|
13
13
|
# @since 0.9.0
|
14
14
|
# @api private
|
data/lib/hanami/early_hints.rb
CHANGED
@@ -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
|
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.
|
data/lib/hanami/rake_helper.rb
CHANGED
@@ -71,7 +71,7 @@ module Hanami
|
|
71
71
|
# @api private
|
72
72
|
def run_hanami_command(command)
|
73
73
|
require "hanami/cli/commands"
|
74
|
-
|
74
|
+
Dry::CLI.new(Hanami::CLI::Commands).call(arguments: command.split(/[[:space:]]/))
|
75
75
|
end
|
76
76
|
# rubocop:enable Metrics/MethodLength
|
77
77
|
end
|
data/lib/hanami/version.rb
CHANGED
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
|
+
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:
|
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:
|
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.
|
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.
|
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: '
|
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: '
|
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.
|
404
|
+
rubygems_version: 3.2.2
|
405
405
|
signing_key:
|
406
406
|
specification_version: 4
|
407
407
|
summary: The web, with simplicity
|