hanami 1.3.0.beta1 → 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 +4 -4
- data/CHANGELOG.md +44 -5
- data/FEATURES.md +17 -2
- data/LICENSE.md +1 -1
- data/README.md +5 -5
- data/bin/hanami +2 -2
- data/hanami.gemspec +14 -14
- data/lib/hanami.rb +1 -1
- data/lib/hanami/app.rb +1 -1
- data/lib/hanami/application.rb +2 -2
- data/lib/hanami/application_configuration.rb +3 -3
- 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/application.erb +5 -18
- data/lib/hanami/cli/commands/generate/app/layout_spec.minitest.erb +2 -3
- data/lib/hanami/cli/commands/generate/app/layout_spec.rspec.erb +1 -2
- data/lib/hanami/cli/commands/generate/app/routes.erb +1 -1
- data/lib/hanami/cli/commands/new.rb +4 -4
- data/lib/hanami/cli/commands/new/Gemfile.erb +1 -2
- data/lib/hanami/cli/commands/new/README.md.erb +1 -1
- data/lib/hanami/cli/commands/new/config.ru.erb +1 -1
- data/lib/hanami/cli/commands/new/config/environment.erb +2 -2
- data/lib/hanami/cli/commands/new/gitignore.erb +2 -0
- data/lib/hanami/cli/commands/new/gitignore_with_sqlite.erb +2 -0
- data/lib/hanami/common_logger.rb +29 -3
- 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 +8 -6
- data/lib/hanami/components/app/view.rb +1 -1
- data/lib/hanami/components/routes_inspector.rb +1 -1
- data/lib/hanami/configuration.rb +7 -4
- data/lib/hanami/configuration/app.rb +5 -2
- data/lib/hanami/early_hints.rb +1 -1
- data/lib/hanami/environment.rb +38 -10
- data/lib/hanami/{middleware.rb → middleware_stack.rb} +5 -5
- data/lib/hanami/rake_helper.rb +1 -1
- data/lib/hanami/rake_tasks.rb +1 -0
- data/lib/hanami/routes.rb +1 -1
- data/lib/hanami/setup.rb +1 -1
- data/lib/hanami/templates/welcome.html.erb +2 -2
- data/lib/hanami/version.rb +1 -1
- data/lib/hanami/welcome.rb +6 -1
- metadata +45 -34
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,45 @@
|
|
|
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
|
+
|
|
10
|
+
## v1.3.3 - 2019-09-20
|
|
11
|
+
### Added
|
|
12
|
+
- [Gray Manley] Standardize file loading for `.env` files (see: https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use)
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- [Alfonso Uceda & Luca Guidi] Ensure to use `:host` option when mounting an application in main router (e.g. `mount Beta::Application.new, at: "/", host: "beta.hanami.test"`)
|
|
16
|
+
|
|
17
|
+
## v1.3.2 - 2019-07-26
|
|
18
|
+
### Added
|
|
19
|
+
- [Luca Guidi] Support both `hanami-validations` 1 and 2
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- [Wisnu Adi Nurcahyo] Ensure `hanami generate` syntax for Welcome page is compatible with ZSH
|
|
23
|
+
- [Luca Guidi] Don't let `hanami` to crash when called without `bundle exec`
|
|
24
|
+
|
|
25
|
+
## v1.3.1 - 2019-01-18
|
|
26
|
+
### Added
|
|
27
|
+
- [Luca Guidi] Official support for Ruby: MRI 2.6
|
|
28
|
+
- [Luca Guidi] Support `bundler` 2.0+
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
- [Aidan Coyle] Remove from app generator support for deprecated `force_ssl` setting
|
|
32
|
+
- [Alessandro Caporrini] Remove from app generator support for deprecated `body_parsers` setting
|
|
33
|
+
- [Daphne Rouw & Sean Collins] Make app generator to work when code in `config/environment.rb` uses double quotes
|
|
34
|
+
|
|
35
|
+
## v1.3.0 - 2018-10-24
|
|
36
|
+
### Added
|
|
37
|
+
- [Luca Guidi] Automatically log body payload from body parsers
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- [Luca Guidi] Generate correct syntax for layout unit tests
|
|
41
|
+
- [Vladislav Yashin] Fix concatenation of `Pathname` and `String` in `Hanami::CommonLogger`
|
|
42
|
+
|
|
4
43
|
## v1.3.0.beta1 - 2018-08-08
|
|
5
44
|
### Added
|
|
6
45
|
- [Sean Collins] Generate new projects with RSpec as default testing framework
|
|
@@ -8,7 +47,7 @@ The web, with simplicity.
|
|
|
8
47
|
|
|
9
48
|
### Fixed
|
|
10
49
|
- [Anton Davydov] Make possible to pass extra settings for custom logger instances (eg. `logger SemanticLogger.new, :foo, :bar`)
|
|
11
|
-
- [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`
|
|
12
51
|
- [Makoto Tajitsu & Luca Guidi] Fixed regression for `hanami new .` that used to generate a broken project
|
|
13
52
|
|
|
14
53
|
### Fixed
|
|
@@ -125,7 +164,7 @@ The web, with simplicity.
|
|
|
125
164
|
- [Luca Guidi] Make compatible with Rack 2.0 only
|
|
126
165
|
- [Luca Guidi] Removed `logger` settings from Hanami applications
|
|
127
166
|
- [Luca Guidi] Removed logger for Hanami applications (eg `Web.logger`)
|
|
128
|
-
- [Luca Guidi] Changed mailer syntax in `config/
|
|
167
|
+
- [Luca Guidi] Changed mailer syntax in `config/environment.rb`
|
|
129
168
|
|
|
130
169
|
## v0.9.2 - 2016-12-19
|
|
131
170
|
## Added
|
|
@@ -214,11 +253,11 @@ The web, with simplicity.
|
|
|
214
253
|
|
|
215
254
|
## v0.7.2 - 2016-02-09
|
|
216
255
|
### Fixed
|
|
217
|
-
- [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
|
|
218
257
|
|
|
219
258
|
## v0.7.1 - 2016-02-05
|
|
220
259
|
### Fixed
|
|
221
|
-
- [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
|
|
222
261
|
- [Anatolii Didukh] Ensure to fallback to default engine for `hanami console`
|
|
223
262
|
|
|
224
263
|
## v0.7.0 - 2016-01-22
|
|
@@ -353,7 +392,7 @@ The web, with simplicity.
|
|
|
353
392
|
## v0.3.0 - 2015-03-23
|
|
354
393
|
### Added
|
|
355
394
|
- [Luca Guidi] Introduced action generator. Eg. `bundle exec lotus generate action web dashboard#index`
|
|
356
|
-
- [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' }`
|
|
357
396
|
- [Tom Kadwill] Include `Lotus::Helpers` in views.
|
|
358
397
|
- [Linus Pettersson] Allow to specify `--database` CLI option when generate a new project. Eg. `lotus new bookshelf --database=postgresql`
|
|
359
398
|
- [Linus Pettersson] Initialize a Git repository when generating a new project
|
data/FEATURES.md
CHANGED
|
@@ -3,7 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
## Features
|
|
5
5
|
|
|
6
|
-
## v1.3.
|
|
6
|
+
## v1.3.3 - 2019-09-20
|
|
7
|
+
|
|
8
|
+
- Standardize file loading for `.env` files (see: https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use)
|
|
9
|
+
|
|
10
|
+
## v1.3.2 - 2019-07-26
|
|
11
|
+
|
|
12
|
+
## v1.3.1 - 2019-01-18
|
|
13
|
+
|
|
14
|
+
## v1.3.0 - 2018-10-24
|
|
15
|
+
|
|
16
|
+
- Default testing framework is RSpec
|
|
17
|
+
- Introduced `Hanami::Middleware::BodyParser` Rack middleware
|
|
18
|
+
- Log payload (body) for non-GET HTTP requests coming from body parsers
|
|
19
|
+
- Added support for `reply_to` in mailers
|
|
20
|
+
- Variadic arguments for `hanami-cli`
|
|
21
|
+
- Array as argument or option for `hanami-cli`
|
|
7
22
|
|
|
8
23
|
## v1.2.0 - 2018-04-11
|
|
9
24
|
|
|
@@ -11,7 +26,7 @@
|
|
|
11
26
|
- Unobtrusive JavaScript (UJS) (via `hanami-ujs` gem)
|
|
12
27
|
- Interactive console for development error page (via `hanami-webconsole` gem)
|
|
13
28
|
- CLI: register callbacks for `hanami` commands (`Hanami::CLI.after("db migrate", MyCallback.new)` or `Hanami::CLI.after("db migrate") { ... }`)
|
|
14
|
-
- Project level Rack middleware stack (`Hanami.configure { middleware.use
|
|
29
|
+
- Project level Rack middleware stack (`Hanami.configure { middleware.use MyRackMiddleware }`)
|
|
15
30
|
- Plugins can hook into project configuration (`Hanami.plugin { middleware.use AnotherRackMiddleware }`)
|
|
16
31
|
- Custom repository commands
|
|
17
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
|
[](https://badge.fury.io/rb/hanami)
|
|
29
|
-
[](https://github.com/hanami/hanami/actions?query=workflow%3Aci+branch%3Amaster)
|
|
30
29
|
[](https://codecov.io/gh/hanami/hanami)
|
|
31
30
|
[](https://depfu.com/github/hanami/hanami?project=Bundler)
|
|
32
31
|
[](http://inch-ci.org/github/hanami/hanami)
|
|
@@ -47,7 +46,7 @@ cd bookshelf && bundle
|
|
|
47
46
|
bundle exec hanami server # visit http://localhost:2300
|
|
48
47
|
```
|
|
49
48
|
|
|
50
|
-
Please follow along with the [Getting Started guide](
|
|
49
|
+
Please follow along with the [Getting Started guide](https://guides.hanamirb.org/getting-started/).
|
|
51
50
|
|
|
52
51
|
## Donations
|
|
53
52
|
|
|
@@ -63,7 +62,8 @@ You can give back to Open Source, by supporting Hanami development via a [donati
|
|
|
63
62
|
|
|
64
63
|
* Home page: http://hanamirb.org
|
|
65
64
|
* Community: http://hanamirb.org/community
|
|
66
|
-
* Guides:
|
|
65
|
+
* Guides: https://guides.hanamirb.org
|
|
66
|
+
* Snippets: https://snippets.hanamirb.org
|
|
67
67
|
* Mailing List: http://hanamirb.org/mailing-list
|
|
68
68
|
* API Doc: http://rdoc.info/gems/hanami
|
|
69
69
|
* Bugs/Issues: https://github.com/hanami/hanami/issues
|
|
@@ -136,4 +136,4 @@ Released under MIT License.
|
|
|
136
136
|
|
|
137
137
|
This project was formerly known as Lotus (`lotusrb`).
|
|
138
138
|
|
|
139
|
-
Copyright © 2014-
|
|
139
|
+
Copyright © 2014-2021 Luca Guidi.
|
data/bin/hanami
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
require 'bundler'
|
|
3
3
|
require 'hanami/cli/commands'
|
|
4
4
|
|
|
5
|
-
Bundler.require(:plugins) if File.exist?(ENV["BUNDLE_GEMFILE"] || "Gemfile")
|
|
6
|
-
|
|
5
|
+
::Bundler.require(:plugins) if File.exist?(ENV["BUNDLE_GEMFILE"] || "Gemfile")
|
|
6
|
+
Dry::CLI.new(Hanami::CLI::Commands).call
|
data/hanami.gemspec
CHANGED
|
@@ -21,20 +21,20 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
|
|
22
22
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
23
23
|
|
|
24
|
-
spec.add_dependency 'hanami-utils', '~> 1.3
|
|
25
|
-
spec.add_dependency 'hanami-validations', '
|
|
26
|
-
spec.add_dependency 'hanami-router', '~> 1.3
|
|
27
|
-
spec.add_dependency 'hanami-controller', '~> 1.3
|
|
28
|
-
spec.add_dependency 'hanami-view', '~> 1.3
|
|
29
|
-
spec.add_dependency 'hanami-helpers', '~> 1.3
|
|
30
|
-
spec.add_dependency 'hanami-mailer', '~> 1.3
|
|
31
|
-
spec.add_dependency 'hanami-assets', '~> 1.3
|
|
32
|
-
spec.add_dependency '
|
|
24
|
+
spec.add_dependency 'hanami-utils', '~> 1.3'
|
|
25
|
+
spec.add_dependency 'hanami-validations', '>= 1.3', '< 3'
|
|
26
|
+
spec.add_dependency 'hanami-router', '~> 1.3'
|
|
27
|
+
spec.add_dependency 'hanami-controller', '~> 1.3'
|
|
28
|
+
spec.add_dependency 'hanami-view', '~> 1.3'
|
|
29
|
+
spec.add_dependency 'hanami-helpers', '~> 1.3'
|
|
30
|
+
spec.add_dependency 'hanami-mailer', '~> 1.3'
|
|
31
|
+
spec.add_dependency 'hanami-assets', '~> 1.3'
|
|
32
|
+
spec.add_dependency 'dry-cli', '~> 0.5'
|
|
33
33
|
spec.add_dependency 'concurrent-ruby', '~> 1.0'
|
|
34
|
-
spec.add_dependency 'bundler'
|
|
34
|
+
spec.add_dependency 'bundler', '>= 1.6', '< 3'
|
|
35
35
|
|
|
36
|
-
spec.add_development_dependency 'rspec', '~>
|
|
37
|
-
spec.add_development_dependency 'rack-test', '~>
|
|
38
|
-
spec.add_development_dependency 'aruba', '~>
|
|
39
|
-
spec.add_development_dependency 'rake', '~>
|
|
36
|
+
spec.add_development_dependency 'rspec', '~> 3.7'
|
|
37
|
+
spec.add_development_dependency 'rack-test', '~> 1.1'
|
|
38
|
+
spec.add_development_dependency 'aruba', '~> 0.14'
|
|
39
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
|
40
40
|
end
|
data/lib/hanami.rb
CHANGED
|
@@ -264,7 +264,7 @@ module Hanami
|
|
|
264
264
|
# @since 1.0.0
|
|
265
265
|
# @api private
|
|
266
266
|
#
|
|
267
|
-
# @see
|
|
267
|
+
# @see https://guides.hanamirb.org/projects/code-reloading
|
|
268
268
|
def self.code_reloading?
|
|
269
269
|
environment
|
|
270
270
|
Components.resolve('code_reloading')
|
data/lib/hanami/app.rb
CHANGED
data/lib/hanami/application.rb
CHANGED
|
@@ -191,12 +191,12 @@ module Hanami
|
|
|
191
191
|
|
|
192
192
|
# Rack middleware stack
|
|
193
193
|
#
|
|
194
|
-
# @return [Hanami::
|
|
194
|
+
# @return [Hanami::MiddlewareStack] the middleware stack
|
|
195
195
|
#
|
|
196
196
|
# @since 0.1.0
|
|
197
197
|
# @api private
|
|
198
198
|
#
|
|
199
|
-
# @see Hanami::
|
|
199
|
+
# @see Hanami::MiddlewareStack
|
|
200
200
|
attr_reader :middleware
|
|
201
201
|
end
|
|
202
202
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'hanami/utils/kernel'
|
|
2
2
|
require 'hanami/environment'
|
|
3
|
-
require 'hanami/
|
|
3
|
+
require 'hanami/middleware_stack'
|
|
4
4
|
require 'hanami/config/cookies'
|
|
5
5
|
require 'hanami/config/framework_configuration'
|
|
6
6
|
require 'hanami/config/load_paths'
|
|
@@ -670,7 +670,7 @@ module Hanami
|
|
|
670
670
|
# @since 0.2.0
|
|
671
671
|
#
|
|
672
672
|
# @see http://rdoc.info/gems/rack/Rack/Static
|
|
673
|
-
# @see Hanami::
|
|
673
|
+
# @see Hanami::MiddlewareStack#use
|
|
674
674
|
#
|
|
675
675
|
# @example
|
|
676
676
|
# require 'hanami'
|
|
@@ -684,7 +684,7 @@ module Hanami
|
|
|
684
684
|
# end
|
|
685
685
|
# end
|
|
686
686
|
def middleware
|
|
687
|
-
@middleware ||= Hanami::
|
|
687
|
+
@middleware ||= Hanami::MiddlewareStack.new(self)
|
|
688
688
|
end
|
|
689
689
|
|
|
690
690
|
# Adapter configuration.
|
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)
|
|
@@ -97,19 +97,6 @@ module <%= app.classify %>
|
|
|
97
97
|
#
|
|
98
98
|
# default_response_format :html
|
|
99
99
|
|
|
100
|
-
# HTTP Body parsers
|
|
101
|
-
# Parse non GET responses body for a specific mime type
|
|
102
|
-
# Argument: Symbol, which represent the format of the mime type
|
|
103
|
-
# (only `:json` is supported)
|
|
104
|
-
# Object, the parser
|
|
105
|
-
#
|
|
106
|
-
# body_parsers :json
|
|
107
|
-
|
|
108
|
-
# When it's true and the router receives a non-encrypted request (http),
|
|
109
|
-
# it redirects to the secure equivalent (https). Disabled by default.
|
|
110
|
-
#
|
|
111
|
-
# force_ssl true
|
|
112
|
-
|
|
113
100
|
##
|
|
114
101
|
# TEMPLATES
|
|
115
102
|
#
|
|
@@ -135,7 +122,7 @@ module <%= app.classify %>
|
|
|
135
122
|
# * :yui
|
|
136
123
|
# * :closure
|
|
137
124
|
#
|
|
138
|
-
# See:
|
|
125
|
+
# See: https://guides.hanamirb.org/assets/compressors
|
|
139
126
|
#
|
|
140
127
|
# In order to skip JavaScript compression comment the following line
|
|
141
128
|
javascript_compressor :builtin
|
|
@@ -148,7 +135,7 @@ module <%= app.classify %>
|
|
|
148
135
|
# * :yui
|
|
149
136
|
# * :sass
|
|
150
137
|
#
|
|
151
|
-
# See:
|
|
138
|
+
# See: https://guides.hanamirb.org/assets/compressors
|
|
152
139
|
#
|
|
153
140
|
# In order to skip stylesheet compression comment the following line
|
|
154
141
|
stylesheet_compressor :builtin
|
|
@@ -305,12 +292,12 @@ module <%= app.classify %>
|
|
|
305
292
|
|
|
306
293
|
# Use fingerprint file name for asset paths
|
|
307
294
|
#
|
|
308
|
-
# See:
|
|
295
|
+
# See: https://guides.hanamirb.org/assets/overview
|
|
309
296
|
fingerprint true
|
|
310
297
|
|
|
311
298
|
# Content Delivery Network (CDN)
|
|
312
299
|
#
|
|
313
|
-
# See:
|
|
300
|
+
# See: https://guides.hanamirb.org/assets/content-delivery-network
|
|
314
301
|
#
|
|
315
302
|
# scheme 'https'
|
|
316
303
|
# host 'cdn.example.org'
|
|
@@ -318,7 +305,7 @@ module <%= app.classify %>
|
|
|
318
305
|
|
|
319
306
|
# Subresource Integrity
|
|
320
307
|
#
|
|
321
|
-
# See:
|
|
308
|
+
# See: https://guides.hanamirb.org/assets/content-delivery-network/#subresource-integrity
|
|
322
309
|
subresource_integrity :sha256
|
|
323
310
|
end
|
|
324
311
|
end
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
describe <%= app.classify %>::Views::ApplicationLayout do
|
|
4
|
-
let(:layout) { <%= app.classify %>::Views::ApplicationLayout.new(
|
|
4
|
+
let(:layout) { <%= app.classify %>::Views::ApplicationLayout.new({ format: :html }, "contents") }
|
|
5
5
|
let(:rendered) { layout.render }
|
|
6
|
-
let(:template) { Hanami::View::Template.new('apps/<%= app %>/templates/application.html.<%= template %>') }
|
|
7
6
|
|
|
8
7
|
it 'contains application name' do
|
|
9
|
-
rendered.must_include('<%= app.classify %>')
|
|
8
|
+
_(rendered).must_include('<%= app.classify %>')
|
|
10
9
|
end
|
|
11
10
|
end
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
RSpec.describe <%= app.classify %>::Views::ApplicationLayout, type: :view do
|
|
4
|
-
let(:layout) { <%= app.classify %>::Views::ApplicationLayout.new(
|
|
4
|
+
let(:layout) { <%= app.classify %>::Views::ApplicationLayout.new({ format: :html }, "contents") }
|
|
5
5
|
let(:rendered) { layout.render }
|
|
6
|
-
let(:template) { Hanami::View::Template.new('apps/<%= app %>/templates/application.html.<%= template %>') }
|
|
7
6
|
|
|
8
7
|
it 'contains application name' do
|
|
9
8
|
expect(rendered).to include('<%= app.classify %>')
|