hanami 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/FEATURES.md +5 -1
- data/README.md +47 -64
- data/hanami.gemspec +1 -1
- data/lib/hanami.rb +18 -1
- data/lib/hanami/application_configuration.rb +10 -3
- data/lib/hanami/environment.rb +10 -0
- data/lib/hanami/generators/action/view_spec.minitest.tt +3 -0
- data/lib/hanami/generators/action/view_spec.rspec.tt +3 -0
- data/lib/hanami/generators/app/application.rb.tt +4 -4
- data/lib/hanami/generators/application/app/config/application.rb.tt +4 -4
- data/lib/hanami/generators/generator.rb +1 -1
- data/lib/hanami/rake_helper.rb +4 -2
- data/lib/hanami/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dac74bd1407b2a277b071bfd1c678d561b5d1385
|
4
|
+
data.tar.gz: df791585b6be2709032db1ac7d492ab5d165da3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '00007885789a92bc354914bdaf4a35330b33bdf066d01bccc438f35e5ddc606fe7464284893a49cbab28225a0d590d84265acc5ccb3ef88044c3d82082140968'
|
7
|
+
data.tar.gz: 0b9bfe9ec4eb0924f44a43dc053cadaf86fdf6b30dc9f393e4806710845ed2e254424719b3e4d657f6e20808f5cd2f228b1d4535b312e4eb40f0c6332f01e390
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
# Hanami
|
2
2
|
The web, with simplicity.
|
3
3
|
|
4
|
+
## v0.9.2 - 2016-12-19
|
5
|
+
## Added
|
6
|
+
- [The Crab] Mark unit tests/specs as pending for generated actions and views
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
- [Luca Guidi] Rake task `:environment` no longer depends on the removed `:preload` task
|
10
|
+
- [Luca Guidi] Ensure force SSL to use the default port, or the configured one
|
11
|
+
- [Luca Guidi] Boot the project when other it's started without `hanami server` (eg. `puma` or `rackup`)
|
12
|
+
|
4
13
|
## v0.9.1 - 2016-11-18
|
5
14
|
### Fixed
|
6
15
|
- [Luca Guidi] Ensure JSON body parser to not eval untrusted input
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/FEATURES.md
CHANGED
data/README.md
CHANGED
@@ -1,23 +1,50 @@
|
|
1
|
-
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/hanami.svg)](http://badge.fury.io/rb/hanami)
|
2
|
+
[![Build Status](https://secure.travis-ci.org/hanami/hanami.svg?branch=master)](http://travis-ci.org/hanami/hanami?branch=master)
|
3
|
+
[![Coverage](https://coveralls.io/repos/hanami/hanami/badge.svg?branch=master)](https://coveralls.io/r/hanami/hanami)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/hanami/hanami.svg)](https://codeclimate.com/github/hanami/hanami)
|
5
|
+
[![Dependencies](https://gemnasium.com/hanami/hanami.svg)](https://gemnasium.com/hanami/hanami)
|
6
|
+
[![Inline docs](http://inch-ci.org/github/hanami/hanami.svg)](http://inch-ci.org/github/hanami/hanami)
|
7
|
+
|
8
|
+
# Hanami :cherry_blossom:
|
2
9
|
|
3
10
|
The web, with simplicity.
|
4
11
|
|
5
12
|
## Frameworks
|
6
13
|
|
7
|
-
Hanami
|
14
|
+
Hanami is a **full-stack** Ruby web framework.
|
15
|
+
It's made up of smaller, single-purpose libraries.
|
8
16
|
|
9
|
-
|
10
|
-
|
17
|
+
This repository is for the full-stack framework,
|
18
|
+
which provides the glue that ties all the parts together:
|
19
|
+
|
20
|
+
* [**Hanami::Model**](https://github.com/hanami/model) - Persistence with entities, repositories and data mapper
|
21
|
+
* [**Hanami::View**](https://github.com/hanami/view) - Presentation with a separation between views and templates
|
22
|
+
* [**Hanami::Controller**](https://github.com/hanami/controller) - Full featured, fast and testable actions for Rack
|
11
23
|
* [**Hanami::Validations**](https://github.com/hanami/validations) - Validations mixin for Ruby objects
|
24
|
+
* [**Hanami::Router**](https://github.com/hanami/router) - Rack compatible HTTP router for Ruby
|
12
25
|
* [**Hanami::Helpers**](https://github.com/hanami/helpers) - View helpers for Ruby applications
|
13
26
|
* [**Hanami::Mailer**](https://github.com/hanami/mailer) - Mail for Ruby applications
|
14
|
-
* [**Hanami::Model**](https://github.com/hanami/model) - Persistence with entities, repositories and data mapper
|
15
27
|
* [**Hanami::Assets**](https://github.com/hanami/assets) - Assets management for Ruby
|
16
|
-
* [**Hanami::
|
17
|
-
* [**Hanami::Controller**](https://github.com/hanami/controller) - Full featured, fast and testable actions for Rack
|
28
|
+
* [**Hanami::Utils**](https://github.com/hanami/utils) - Ruby core extensions and class utilities
|
18
29
|
|
19
30
|
These components are designed to be used independently or together in a Hanami application.
|
20
|
-
|
31
|
+
|
32
|
+
## Installation
|
33
|
+
__Hanami__ supports Ruby (MRI) 2.3+
|
34
|
+
|
35
|
+
```shell
|
36
|
+
gem install hanami
|
37
|
+
```
|
38
|
+
|
39
|
+
## Usage
|
40
|
+
|
41
|
+
```shell
|
42
|
+
hanami new bookshelf
|
43
|
+
cd bookshelf && bundle
|
44
|
+
bundle exec hanami server # visit http://localhost:2300
|
45
|
+
```
|
46
|
+
|
47
|
+
Please follow along with the [Getting Started guide](http://hanamirb.org/guides/getting-started).
|
21
48
|
|
22
49
|
## Donations
|
23
50
|
|
@@ -27,15 +54,6 @@ You can give back to Open Source, by supporting Hanami development via a [donati
|
|
27
54
|
|
28
55
|
* [James Carlson](https://github.com/jxxcarlson)
|
29
56
|
|
30
|
-
## Status
|
31
|
-
|
32
|
-
[![Gem Version](https://badge.fury.io/rb/hanami.svg)](http://badge.fury.io/rb/hanami)
|
33
|
-
[![Build Status](https://secure.travis-ci.org/hanami/hanami.svg?branch=master)](http://travis-ci.org/hanami/hanami?branch=master)
|
34
|
-
[![Coverage](https://coveralls.io/repos/hanami/hanami/badge.svg?branch=master)](https://coveralls.io/r/hanami/hanami)
|
35
|
-
[![Code Climate](https://codeclimate.com/github/hanami/hanami.svg)](https://codeclimate.com/github/hanami/hanami)
|
36
|
-
[![Dependencies](https://gemnasium.com/hanami/hanami.svg)](https://gemnasium.com/hanami/hanami)
|
37
|
-
[![Inline docs](http://inch-ci.org/github/hanami/hanami.svg)](http://inch-ci.org/github/hanami/hanami)
|
38
|
-
|
39
57
|
## Contact
|
40
58
|
|
41
59
|
* Home page: http://hanamirb.org
|
@@ -44,53 +62,17 @@ You can give back to Open Source, by supporting Hanami development via a [donati
|
|
44
62
|
* Mailing List: http://hanamirb.org/mailing-list
|
45
63
|
* API Doc: http://rdoc.info/gems/hanami
|
46
64
|
* Bugs/Issues: https://github.com/hanami/hanami/issues
|
47
|
-
*
|
48
|
-
* Forum: https://
|
49
|
-
* Chat
|
50
|
-
|
51
|
-
## Rubies
|
52
|
-
|
53
|
-
__Hanami__ supports Ruby (MRI) 2.3+
|
54
|
-
|
55
|
-
## Installation
|
56
|
-
|
57
|
-
```shell
|
58
|
-
% gem install hanami
|
59
|
-
```
|
60
|
-
|
61
|
-
## Usage
|
62
|
-
|
63
|
-
```shell
|
64
|
-
% hanami new bookshelf
|
65
|
-
% cd bookshelf && bundle
|
66
|
-
% bundle exec hanami server # visit http://localhost:2300
|
67
|
-
```
|
68
|
-
|
69
|
-
Please follow along with the [Getting Started guide](http://hanamirb.org/guides/getting-started).
|
65
|
+
* Stack Overflow: http://stackoverflow.com/questions/tagged/hanami
|
66
|
+
* Forum: https://discourse.hanamirb.org
|
67
|
+
* **Chat**: http://chat.hanamirb.org
|
70
68
|
|
71
69
|
## Community
|
72
70
|
|
73
|
-
We strive for
|
71
|
+
We strive for an inclusive and helpful community.
|
74
72
|
We have a [Code of Conduct](http://hanamirb.org/community/#code-of-conduct) to handle controversial cases.
|
75
73
|
In general, we expect **you** to be **nice** with other people.
|
76
74
|
Our hope is for a great software and a great Community.
|
77
75
|
|
78
|
-
### Contributor Code of Conduct
|
79
|
-
|
80
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
81
|
-
|
82
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
83
|
-
|
84
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
85
|
-
|
86
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
87
|
-
|
88
|
-
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
89
|
-
|
90
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
91
|
-
|
92
|
-
This Code of Conduct is adapted from the Contributor Covenant, version 1.1.0, available from http://contributor-covenant.org/version/1/1/0/
|
93
|
-
|
94
76
|
## Contributing
|
95
77
|
|
96
78
|
1. Fork it ( https://github.com/hanami/hanami/fork )
|
@@ -116,7 +98,7 @@ bundle
|
|
116
98
|
|
117
99
|
* Ruby 2.3+ / JRuby 9.1.5.0+
|
118
100
|
* Bundler
|
119
|
-
*
|
101
|
+
* [PhantomJS](http://phantomjs.org/download.html)
|
120
102
|
* Node.js (MacOS)
|
121
103
|
|
122
104
|
### Testing
|
@@ -127,16 +109,14 @@ all the gems locally in `vendor/cache`, including `hanami` code from `lib/`.
|
|
127
109
|
**Before running a test, please make sure you have a fresh version of the code:**
|
128
110
|
|
129
111
|
```shell
|
130
|
-
|
131
|
-
|
112
|
+
./script/setup
|
113
|
+
bundle exec rspec spec/path/to/file_spec.rb
|
132
114
|
```
|
133
115
|
|
134
|
-
### Build / CI
|
135
|
-
|
136
116
|
To run all the tests, please use:
|
137
117
|
|
138
118
|
```shell
|
139
|
-
|
119
|
+
./script/ci
|
140
120
|
```
|
141
121
|
|
142
122
|
## Versioning
|
@@ -145,5 +125,8 @@ __Hanami__ uses [Semantic Versioning 2.0.0](http://semver.org)
|
|
145
125
|
|
146
126
|
## Copyright
|
147
127
|
|
148
|
-
|
128
|
+
Released under MIT License.
|
129
|
+
|
149
130
|
This project was formerly known as Lotus (`lotusrb`).
|
131
|
+
|
132
|
+
Copyright © 2014-2016 Luca Guidi.
|
data/hanami.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = 'http://hanamirb.org'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files = `git ls-files -c -o --exclude-standard -z -- lib/* bin/* LICENSE.md README.md CHANGELOG.md FEATURES.md hanami.gemspec`.split("\x0")
|
16
|
+
spec.files = `git ls-files -c -o --exclude-standard -z -- lib/* bin/* LICENSE.md README.md CODE_OF_CONDUCT.md CHANGELOG.md FEATURES.md hanami.gemspec`.split("\x0")
|
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']
|
data/lib/hanami.rb
CHANGED
@@ -77,7 +77,15 @@ module Hanami
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
# Boot Hanami project
|
80
|
+
# Boot your Hanami project
|
81
|
+
#
|
82
|
+
# NOTE: In case this is invoked many times, it guarantees that the boot
|
83
|
+
# process happens only once.
|
84
|
+
#
|
85
|
+
# NOTE: There is no reason to cache the result with `@_booted`, because it
|
86
|
+
# already caches it internally.
|
87
|
+
#
|
88
|
+
# NOTE: This MUST NOT be wrapped by a Mutex, because it would cause a deadlock.
|
81
89
|
#
|
82
90
|
# @since 0.9.0
|
83
91
|
# @api private
|
@@ -92,11 +100,20 @@ module Hanami
|
|
92
100
|
# * `config.ru` (`run Hanami.app`)
|
93
101
|
# * Feature tests (`Capybara.app = Hanami.app`)
|
94
102
|
#
|
103
|
+
#
|
104
|
+
#
|
105
|
+
# It lazily loads your Hanami project, in case it wasn't booted on before.
|
106
|
+
# This is the case when `hanami server` isn't invoked, but we use different
|
107
|
+
# ways to run the project (eg. `rackup`).
|
108
|
+
#
|
95
109
|
# @return [Hanami::App] the app
|
96
110
|
#
|
97
111
|
# @since 0.9.0
|
98
112
|
# @api private
|
113
|
+
#
|
114
|
+
# @see Hanami.boot
|
99
115
|
def self.app
|
116
|
+
boot
|
100
117
|
App.new(configuration, environment)
|
101
118
|
end
|
102
119
|
|
@@ -21,6 +21,10 @@ module Hanami
|
|
21
21
|
# @see Hanami::Configuration#ssl?
|
22
22
|
SSL_SCHEME = 'https'.freeze
|
23
23
|
|
24
|
+
# @since x.x.x
|
25
|
+
# @api private
|
26
|
+
DEFAULT_SSL_PORT = 443
|
27
|
+
|
24
28
|
# @since 0.1.0
|
25
29
|
# @api private
|
26
30
|
attr_reader :namespace
|
@@ -37,11 +41,11 @@ module Hanami
|
|
37
41
|
#
|
38
42
|
# @since 0.1.0
|
39
43
|
# @api private
|
40
|
-
def initialize(namespace, configurations, path_prefix)
|
44
|
+
def initialize(namespace, configurations, path_prefix, env: Environment.new)
|
41
45
|
@namespace = namespace
|
42
46
|
@configurations = configurations
|
43
47
|
@path_prefix = path_prefix
|
44
|
-
@env =
|
48
|
+
@env = env
|
45
49
|
|
46
50
|
evaluate_configurations!
|
47
51
|
end
|
@@ -1012,7 +1016,10 @@ module Hanami
|
|
1012
1016
|
if value
|
1013
1017
|
@port = Integer(value)
|
1014
1018
|
else
|
1015
|
-
@port
|
1019
|
+
return @port if defined?(@port)
|
1020
|
+
return @env.port unless @env.default_port?
|
1021
|
+
return DEFAULT_SSL_PORT if force_ssl
|
1022
|
+
@env.port
|
1016
1023
|
end
|
1017
1024
|
end
|
1018
1025
|
|
data/lib/hanami/environment.rb
CHANGED
@@ -329,6 +329,16 @@ module Hanami
|
|
329
329
|
end.to_i
|
330
330
|
end
|
331
331
|
|
332
|
+
# Check if the current port is the default one
|
333
|
+
#
|
334
|
+
# @since x.x.x
|
335
|
+
# @api private
|
336
|
+
#
|
337
|
+
# @see Hanami::ApplicationConfiguration#port
|
338
|
+
def default_port?
|
339
|
+
port == DEFAULT_PORT
|
340
|
+
end
|
341
|
+
|
332
342
|
# Path to the Rack configuration file
|
333
343
|
#
|
334
344
|
# In order to decide the value, it looks up the following sources:
|
@@ -8,6 +8,9 @@ describe <%= config[:app] %>::Views::<%= config[:controller] %>::<%= config[:act
|
|
8
8
|
let(:rendered) { view.render }
|
9
9
|
|
10
10
|
it 'exposes #foo' do
|
11
|
+
skip 'This is an auto-generated test. Edit it and add your own tests.'
|
12
|
+
|
13
|
+
# Example
|
11
14
|
view.foo.must_equal exposures.fetch(:foo)
|
12
15
|
end
|
13
16
|
end
|
@@ -7,6 +7,9 @@ RSpec.describe <%= config[:app] %>::Views::<%= config[:controller] %>::<%= confi
|
|
7
7
|
let(:rendered) { view.render }
|
8
8
|
|
9
9
|
it 'exposes #foo' do
|
10
|
+
pending 'This is an auto-generated test. Edit it and add your own tests.'
|
11
|
+
|
12
|
+
# Example
|
10
13
|
expect(view.foo).to eq exposures.fetch(:foo)
|
11
14
|
end
|
12
15
|
end
|
@@ -273,7 +273,7 @@ module <%= config[:classified_app_name] %>
|
|
273
273
|
handle_exceptions false
|
274
274
|
|
275
275
|
# Logger
|
276
|
-
# See: http://hanamirb.org/guides/
|
276
|
+
# See: http://hanamirb.org/guides/projects/logging
|
277
277
|
#
|
278
278
|
# Logger stream. It defaults to STDOUT.
|
279
279
|
# logger.stream "log/development.log"
|
@@ -293,7 +293,7 @@ module <%= config[:classified_app_name] %>
|
|
293
293
|
handle_exceptions false
|
294
294
|
|
295
295
|
# Logger
|
296
|
-
# See: http://hanamirb.org/guides/
|
296
|
+
# See: http://hanamirb.org/guides/projects/logging
|
297
297
|
#
|
298
298
|
# Logger level. It defaults to ERROR
|
299
299
|
logger.level :error
|
@@ -308,7 +308,7 @@ module <%= config[:classified_app_name] %>
|
|
308
308
|
# port 443
|
309
309
|
|
310
310
|
# Logger
|
311
|
-
# See: http://hanamirb.org/guides/
|
311
|
+
# See: http://hanamirb.org/guides/projects/logging
|
312
312
|
#
|
313
313
|
# Logger stream. It defaults to STDOUT.
|
314
314
|
# logger.stream "log/production.log"
|
@@ -340,7 +340,7 @@ module <%= config[:classified_app_name] %>
|
|
340
340
|
|
341
341
|
# Subresource Integrity
|
342
342
|
#
|
343
|
-
# See: http://hanamirb.org/guides/assets/subresource-integrity
|
343
|
+
# See: http://hanamirb.org/guides/assets/content-delivery-network/#subresource-integrity
|
344
344
|
subresource_integrity :sha256
|
345
345
|
end
|
346
346
|
end
|
@@ -272,7 +272,7 @@ module <%= config[:classified_app_name] %>
|
|
272
272
|
handle_exceptions false
|
273
273
|
|
274
274
|
# Logger
|
275
|
-
# See: http://hanamirb.org/guides/
|
275
|
+
# See: http://hanamirb.org/guides/projects/logging
|
276
276
|
#
|
277
277
|
# Logger stream. It defaults to STDOUT.
|
278
278
|
# logger.stream "log/development.log"
|
@@ -292,7 +292,7 @@ module <%= config[:classified_app_name] %>
|
|
292
292
|
handle_exceptions false
|
293
293
|
|
294
294
|
# Logger
|
295
|
-
# See: http://hanamirb.org/guides/
|
295
|
+
# See: http://hanamirb.org/guides/projects/logging
|
296
296
|
#
|
297
297
|
# Logger level. It defaults to ERROR
|
298
298
|
logger.level :error
|
@@ -307,7 +307,7 @@ module <%= config[:classified_app_name] %>
|
|
307
307
|
# port 443
|
308
308
|
|
309
309
|
# Logger
|
310
|
-
# See: http://hanamirb.org/guides/
|
310
|
+
# See: http://hanamirb.org/guides/projects/logging
|
311
311
|
#
|
312
312
|
# Logger stream. It defaults to STDOUT.
|
313
313
|
# logger.stream "log/production.log"
|
@@ -339,7 +339,7 @@ module <%= config[:classified_app_name] %>
|
|
339
339
|
|
340
340
|
# Subresource Integrity
|
341
341
|
#
|
342
|
-
# See: http://hanamirb.org/guides/assets/subresource-integrity
|
342
|
+
# See: http://hanamirb.org/guides/assets/content-delivery-network/#subresource-integrity
|
343
343
|
subresource_integrity :sha256
|
344
344
|
end
|
345
345
|
end
|
@@ -36,7 +36,7 @@ module Hanami
|
|
36
36
|
config = args.last.is_a?(Hash) ? args.pop : {}
|
37
37
|
# Either prepend after the last comment line,
|
38
38
|
# or the first line in the file, if there are no comments
|
39
|
-
config
|
39
|
+
config[:after] = /\A(?:^#.*$\s)*/
|
40
40
|
@processor.insert_into_file(path, *(args << config), &block)
|
41
41
|
end
|
42
42
|
end
|
data/lib/hanami/rake_helper.rb
CHANGED
@@ -21,8 +21,10 @@ module Hanami
|
|
21
21
|
# rubocop:disable Metrics/MethodLength
|
22
22
|
def install
|
23
23
|
desc "Load the full project"
|
24
|
-
task environment
|
25
|
-
|
24
|
+
task :environment do
|
25
|
+
require 'hanami/environment'
|
26
|
+
Hanami::Environment.new.require_project_environment
|
27
|
+
Components.resolve('all')
|
26
28
|
end
|
27
29
|
|
28
30
|
# Ruby ecosystem compatibility
|
data/lib/hanami/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hanami-utils
|
@@ -239,6 +239,7 @@ extensions: []
|
|
239
239
|
extra_rdoc_files: []
|
240
240
|
files:
|
241
241
|
- CHANGELOG.md
|
242
|
+
- CODE_OF_CONDUCT.md
|
242
243
|
- FEATURES.md
|
243
244
|
- LICENSE.md
|
244
245
|
- README.md
|