hanami 0.9.2 → 1.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/FEATURES.md +5 -0
- data/hanami.gemspec +8 -8
- data/lib/hanami.rb +25 -1
- data/lib/hanami/app.rb +4 -0
- data/lib/hanami/application.rb +1 -14
- data/lib/hanami/application_configuration.rb +2 -37
- data/lib/hanami/cli_base.rb +15 -0
- data/lib/hanami/cli_sub_commands/destroy.rb +2 -2
- data/lib/hanami/cli_sub_commands/generate.rb +2 -1
- data/lib/hanami/commands/generate/abstract.rb +5 -0
- data/lib/hanami/commands/generate/mailer.rb +2 -2
- data/lib/hanami/commands/generate/model.rb +24 -8
- data/lib/hanami/commands/new/abstract.rb +1 -1
- data/lib/hanami/commands/new/container.rb +1 -0
- data/lib/hanami/common_logger.rb +73 -0
- data/lib/hanami/components.rb +11 -0
- data/lib/hanami/components/app/controller.rb +1 -0
- data/lib/hanami/components/components.rb +73 -20
- data/lib/hanami/configuration.rb +12 -0
- data/lib/hanami/env.rb +2 -0
- data/lib/hanami/environment.rb +5 -1
- data/lib/hanami/generators/app/application.rb.tt +0 -30
- data/lib/hanami/generators/application/container/Gemfile.tt +0 -1
- data/lib/hanami/generators/application/container/config/boot.rb.tt +2 -0
- data/lib/hanami/generators/application/container/config/environment.rb.tt +14 -5
- data/lib/hanami/generators/database_config.rb +1 -1
- data/lib/hanami/generators/mailer/{mailer_spec.rb.tt → mailer_spec.rb.minitest.tt} +0 -0
- data/lib/hanami/generators/mailer/mailer_spec.rb.rspec.tt +5 -0
- data/lib/hanami/generators/model/migration.rb.tt +10 -0
- data/lib/hanami/mailer/glue.rb +4 -46
- data/lib/hanami/server.rb +4 -12
- data/lib/hanami/static.rb +4 -8
- data/lib/hanami/version.rb +1 -1
- metadata +25 -62
- data/lib/hanami/components/app/logger.rb +0 -30
- data/lib/hanami/config/logger.rb +0 -200
- data/lib/hanami/generators/application/app/.env.development.tt +0 -4
- data/lib/hanami/generators/application/app/.env.test.tt +0 -4
- data/lib/hanami/generators/application/app/.gitignore +0 -0
- data/lib/hanami/generators/application/app/.gitkeep +0 -1
- data/lib/hanami/generators/application/app/Gemfile.tt +0 -57
- data/lib/hanami/generators/application/app/Rakefile.minitest.tt +0 -12
- data/lib/hanami/generators/application/app/Rakefile.rspec.tt +0 -9
- data/lib/hanami/generators/application/app/apps/.gitkeep.tt +0 -1
- data/lib/hanami/generators/application/app/capybara.rb.rspec.tt +0 -8
- data/lib/hanami/generators/application/app/config.ru.tt +0 -3
- data/lib/hanami/generators/application/app/config/application.rb.tt +0 -347
- data/lib/hanami/generators/application/app/config/environment.rb.tt +0 -4
- data/lib/hanami/generators/application/app/config/initializers/.gitkeep +0 -0
- data/lib/hanami/generators/application/app/config/routes.rb.tt +0 -5
- data/lib/hanami/generators/application/app/db/.gitkeep +0 -1
- data/lib/hanami/generators/application/app/favicon.ico +0 -0
- data/lib/hanami/generators/application/app/features_helper.rb.minitest.tt +0 -11
- data/lib/hanami/generators/application/app/features_helper.rb.rspec.tt +0 -12
- data/lib/hanami/generators/application/app/gitignore.tt +0 -2
- data/lib/hanami/generators/application/app/gitignore_with_db.tt +0 -4
- data/lib/hanami/generators/application/app/gitignore_with_sqlite.tt +0 -3
- data/lib/hanami/generators/application/app/hanamirc.tt +0 -4
- data/lib/hanami/generators/application/app/lib/app_name.rb.tt +0 -35
- data/lib/hanami/generators/application/app/lib/chirp/entities/.gitkeep +0 -1
- data/lib/hanami/generators/application/app/lib/chirp/repositories/.gitkeep +0 -1
- data/lib/hanami/generators/application/app/rspec.rspec.tt +0 -2
- data/lib/hanami/generators/application/app/schema.sql.tt +0 -0
- data/lib/hanami/generators/application/app/spec_helper.rb.minitest.tt +0 -7
- data/lib/hanami/generators/application/app/spec_helper.rb.rspec.tt +0 -104
- data/lib/hanami/generators/application/app/templates/application.html.erb.tt +0 -10
- data/lib/hanami/generators/application/app/templates/application.html.haml.tt +0 -7
- data/lib/hanami/generators/application/app/templates/application.html.slim.tt +0 -8
- data/lib/hanami/generators/application/app/views/application_layout.rb.tt +0 -7
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
#
|
Binary file
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# Require this file for feature tests
|
2
|
-
require_relative './spec_helper'
|
3
|
-
|
4
|
-
require 'capybara'
|
5
|
-
require 'capybara/rspec'
|
6
|
-
|
7
|
-
RSpec.configure do |config|
|
8
|
-
config.include RSpec::FeatureExampleGroup
|
9
|
-
|
10
|
-
config.include Capybara::DSL, feature: true
|
11
|
-
config.include Capybara::RSpecMatchers, feature: true
|
12
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'hanami/model'
|
2
|
-
require 'hanami/mailer'
|
3
|
-
Dir["#{ __dir__ }/<%= config[:app_name] %>/**/*.rb"].each { |file| require_relative file }
|
4
|
-
|
5
|
-
Hanami::Model.configure do
|
6
|
-
# Database adapter
|
7
|
-
#
|
8
|
-
# Available options:
|
9
|
-
#
|
10
|
-
# * SQL adapter
|
11
|
-
# adapter :sql, 'sqlite://db/<%= config[:app_name] %>_development.sqlite3'
|
12
|
-
# adapter :sql, 'postgres://localhost/<%= config[:app_name] %>_development'
|
13
|
-
# adapter :sql, 'mysql://localhost/<%= config[:app_name] %>_development'
|
14
|
-
#
|
15
|
-
adapter :<%= config[:database_config][:type] %>, ENV['DATABASE_URL']
|
16
|
-
|
17
|
-
<%- if config[:database_config][:type] == :sql -%>
|
18
|
-
##
|
19
|
-
# Migrations
|
20
|
-
#
|
21
|
-
migrations 'db/migrations'
|
22
|
-
schema 'db/schema.sql'
|
23
|
-
<%- end -%>
|
24
|
-
end.load!
|
25
|
-
|
26
|
-
Hanami::Mailer.configure do
|
27
|
-
root "#{ __dir__ }/<%= config[:app_name] %>/mailers"
|
28
|
-
|
29
|
-
# See http://hanamirb.org/guides/mailers/delivery
|
30
|
-
delivery do
|
31
|
-
development :test
|
32
|
-
test :test
|
33
|
-
# production :smtp, address: ENV['SMTP_PORT'], port: 1025
|
34
|
-
end
|
35
|
-
end.load!
|
@@ -1 +0,0 @@
|
|
1
|
-
#
|
@@ -1 +0,0 @@
|
|
1
|
-
#
|
File without changes
|
@@ -1,104 +0,0 @@
|
|
1
|
-
# Require this file for unit tests
|
2
|
-
ENV['HANAMI_ENV'] ||= 'test'
|
3
|
-
|
4
|
-
require_relative '../config/environment'
|
5
|
-
Hanami.boot
|
6
|
-
|
7
|
-
Dir[__dir__ + '/support/**/*.rb'].each { |f| require f }
|
8
|
-
|
9
|
-
# This file was generated by the `rspec --init` command. Conventionally, all
|
10
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
11
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
12
|
-
# this file to always be loaded, without a need to explicitly require it in any
|
13
|
-
# files.
|
14
|
-
#
|
15
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
16
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
17
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
18
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
19
|
-
# a separate helper file that requires the additional dependencies and performs
|
20
|
-
# the additional setup, and require it from the spec files that actually need
|
21
|
-
# it.
|
22
|
-
#
|
23
|
-
# The `.rspec` file also contains a few flags that are not defaults but that
|
24
|
-
# users commonly want.
|
25
|
-
#
|
26
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
27
|
-
RSpec.configure do |config|
|
28
|
-
# rspec-expectations config goes here. You can use an alternate
|
29
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
30
|
-
# assertions if you prefer.
|
31
|
-
config.expect_with :rspec do |expectations|
|
32
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
33
|
-
# and `failure_message` of custom matchers include text for helper methods
|
34
|
-
# defined using `chain`, e.g.:
|
35
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
36
|
-
# # => "be bigger than 2 and smaller than 4"
|
37
|
-
# ...rather than:
|
38
|
-
# # => "be bigger than 2"
|
39
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
40
|
-
end
|
41
|
-
|
42
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
43
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
44
|
-
config.mock_with :rspec do |mocks|
|
45
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
46
|
-
# a real object. This is generally recommended, and will default to
|
47
|
-
# `true` in RSpec 4.
|
48
|
-
mocks.verify_partial_doubles = true
|
49
|
-
end
|
50
|
-
|
51
|
-
# The settings below are suggested to provide a good initial experience
|
52
|
-
# with RSpec, but feel free to customize to your heart's content.
|
53
|
-
=begin
|
54
|
-
# These two settings work together to allow you to limit a spec run
|
55
|
-
# to individual examples or groups you care about by tagging them with
|
56
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
57
|
-
# get run.
|
58
|
-
config.filter_run :focus
|
59
|
-
config.run_all_when_everything_filtered = true
|
60
|
-
|
61
|
-
# Allows RSpec to persist some state between runs in order to support
|
62
|
-
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
63
|
-
# you configure your source control system to ignore this file.
|
64
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
65
|
-
|
66
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
67
|
-
# recommended. For more details, see:
|
68
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
69
|
-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
70
|
-
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
71
|
-
config.disable_monkey_patching!
|
72
|
-
|
73
|
-
# This setting enables warnings. It's recommended, but in many cases may
|
74
|
-
# be too noisy due to issues in dependencies.
|
75
|
-
config.warnings = false
|
76
|
-
|
77
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
78
|
-
# file, and it's useful to allow more verbose output when running an
|
79
|
-
# individual spec file.
|
80
|
-
if config.files_to_run.one?
|
81
|
-
# Use the documentation formatter for detailed output,
|
82
|
-
# unless a formatter has already been configured
|
83
|
-
# (e.g. via a command-line flag).
|
84
|
-
config.default_formatter = 'doc'
|
85
|
-
end
|
86
|
-
|
87
|
-
# Print the 10 slowest examples and example groups at the
|
88
|
-
# end of the spec run, to help surface which specs are running
|
89
|
-
# particularly slow.
|
90
|
-
config.profile_examples = 10
|
91
|
-
|
92
|
-
# Run specs in random order to surface order dependencies. If you find an
|
93
|
-
# order dependency and want to debug it, you can fix the order by providing
|
94
|
-
# the seed, which is printed after each run.
|
95
|
-
# --seed 1234
|
96
|
-
config.order = :random
|
97
|
-
|
98
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
99
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
100
|
-
# test failures related to randomization by passing the same `--seed` value
|
101
|
-
# as the one that triggered the failure.
|
102
|
-
Kernel.srand config.seed
|
103
|
-
=end
|
104
|
-
end
|