hoboken 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
- data/.github/ISSUE_TEMPLATE/code_change.md +11 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +25 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +13 -5
- data/.tool-versions +1 -0
- data/CHANGELOG.md +131 -0
- data/CODE_OF_CONDUCT.md +8 -0
- data/CONTRIBUTING.md +16 -0
- data/README.md +10 -14
- data/Rakefile +7 -16
- data/hoboken.gemspec +18 -8
- data/lib/hoboken/add_ons/active_record.rb +142 -0
- data/lib/hoboken/add_ons/airbrake.rb +64 -0
- data/lib/hoboken/add_ons/heroku.rb +5 -1
- data/lib/hoboken/add_ons/internationalization.rb +2 -2
- data/lib/hoboken/add_ons/metrics.rb +3 -2
- data/lib/hoboken/add_ons/omniauth.rb +9 -8
- data/lib/hoboken/add_ons/rubocop.rb +10 -4
- data/lib/hoboken/add_ons/sequel.rb +55 -29
- data/lib/hoboken/add_ons/sidekiq.rb +137 -0
- data/lib/hoboken/add_ons/turnip.rb +109 -0
- data/lib/hoboken/add_ons/twbs.rb +5 -35
- data/lib/hoboken/add_ons/vcr.rb +54 -0
- data/lib/hoboken/generate.rb +18 -10
- data/lib/hoboken/templates/Gemfile.erb.tt +13 -3
- data/lib/hoboken/templates/README.md.tt +18 -6
- data/lib/hoboken/templates/Rakefile.tt +11 -0
- data/lib/hoboken/templates/active_record.rake +11 -0
- data/lib/hoboken/templates/airbrake.rb.tt +13 -0
- data/lib/hoboken/templates/classic.rb.tt +6 -20
- data/lib/hoboken/templates/classic_environment.rb.tt +51 -0
- data/lib/hoboken/templates/config.ru.tt +2 -4
- data/lib/hoboken/templates/console +19 -0
- data/lib/hoboken/templates/example_worker.rb.tt +14 -0
- data/lib/hoboken/templates/metrics.rake.tt +3 -1
- data/lib/hoboken/templates/modular.rb.tt +8 -25
- data/lib/hoboken/templates/modular_environment.rb.tt +62 -0
- data/lib/hoboken/templates/rspec.rake.tt +7 -3
- data/lib/hoboken/templates/rubocop.yml.tt +23 -3
- data/lib/hoboken/templates/seeds.rb +12 -0
- data/lib/hoboken/templates/server +15 -0
- data/lib/hoboken/templates/setup +28 -0
- data/lib/hoboken/templates/sidekiq.rb.tt +21 -0
- data/lib/hoboken/templates/spec/app_spec.rb.tt +0 -2
- data/lib/hoboken/templates/spec/example_worker_spec.rb.tt +16 -0
- data/lib/hoboken/templates/spec/rack_matchers.rb.tt +8 -6
- data/lib/hoboken/templates/spec/spec_helper.rb.tt +2 -6
- data/lib/hoboken/templates/spec/turnip_helper.rb.tt +10 -0
- data/lib/hoboken/templates/styles.css.tt +1 -1
- data/lib/hoboken/templates/support/rack_test_assertions.rb.tt +5 -3
- data/lib/hoboken/templates/test/test_helper.rb.tt +2 -5
- data/lib/hoboken/templates/test/unit/example_worker_test.rb.tt +20 -0
- data/lib/hoboken/templates/vcr_setup.rb.tt +15 -0
- data/lib/hoboken/templates/views/index.erb.tt +1 -1
- data/lib/hoboken/templates/views/layout.erb.tt +3 -3
- data/lib/hoboken/version.rb +1 -1
- data/lib/hoboken.rb +54 -10
- data/test/integration/active_record_test.rb +66 -0
- data/test/integration/airbrake_test.rb +31 -0
- data/test/integration/generate_classic_test.rb +75 -0
- data/test/integration/generate_modular_test.rb +83 -0
- data/test/integration/github_action_test.rb +13 -0
- data/test/integration/heroku_test.rb +14 -0
- data/test/integration/internationalization_test.rb +26 -0
- data/test/integration/metrics_test.rb +54 -0
- data/test/integration/omniauth_test.rb +143 -0
- data/test/integration/rubocop_test.rb +39 -0
- data/test/integration/sequel_test.rb +64 -0
- data/test/integration/sidekiq_test.rb +105 -0
- data/test/integration/travis_test.rb +13 -0
- data/test/integration/turnip_test.rb +51 -0
- data/test/integration/twitter_bootstrap_test.rb +39 -0
- data/test/integration/vcr_test.rb +54 -0
- data/test/test_helper.rb +21 -10
- data/www/Gemfile +4 -0
- data/www/README.md +2 -0
- data/www/config.rb +11 -0
- data/www/source/documentation.html.erb +274 -0
- data/www/source/images/hoboken-running.png +0 -0
- data/www/source/images/hoboken.png +0 -0
- data/www/source/images/sinatra.png +0 -0
- data/www/source/index.html.erb +44 -0
- data/www/source/javascripts/all.js +1 -0
- data/www/source/layouts/layout.erb +38 -0
- data/www/source/stylesheets/all.css.scss +116 -0
- data/www/source/stylesheets/normalize.css +375 -0
- metadata +230 -44
- data/lib/hoboken/add_ons/sprockets.rb +0 -99
- data/lib/hoboken/templates/console.sh +0 -5
- data/lib/hoboken/templates/server.sh +0 -12
- data/lib/hoboken/templates/setup.sh +0 -7
- data/lib/hoboken/templates/sprockets.rake +0 -39
- data/lib/hoboken/templates/sprockets_chain.rb +0 -30
- data/lib/hoboken/templates/sprockets_helper.rb +0 -17
- data/test/integration/add_on_test.rb +0 -505
- data/test/integration/generate_test.rb +0 -203
@@ -1,203 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../test_helper'
|
4
|
-
|
5
|
-
# rubocop:disable Metrics/ClassLength
|
6
|
-
class GenerateTest < IntegrationTestCase
|
7
|
-
# rubocop:disable Metrics/MethodLength
|
8
|
-
# rubocop:disable Metrics/AbcSize
|
9
|
-
def test_generate_classic
|
10
|
-
run_hoboken(:generate) do
|
11
|
-
assert_file '.env'
|
12
|
-
assert_file 'Gemfile'
|
13
|
-
assert_file('Procfile')
|
14
|
-
assert_file 'README.md'
|
15
|
-
assert_file 'Rakefile'
|
16
|
-
assert_file 'app.rb', /require 'sinatra'/
|
17
|
-
assert_file 'app.rb', %r{require 'sinatra/flash'}
|
18
|
-
assert_file 'app.rb', /require 'erubi'/
|
19
|
-
assert_file 'app.rb', /erb :index/
|
20
|
-
assert_file 'app.rb', /set :erb, { escape_html: true }/
|
21
|
-
assert_file 'app.rb', /require 'better_errors'/
|
22
|
-
assert_file_does_not_have_content 'app.rb', /json message:/
|
23
|
-
assert_file 'bin/console'
|
24
|
-
assert_file 'bin/server'
|
25
|
-
assert_file 'bin/setup'
|
26
|
-
assert_file 'config.ru', /run Sinatra::Application/
|
27
|
-
assert_directory 'public'
|
28
|
-
assert_directory 'test'
|
29
|
-
assert_file 'views/index.erb'
|
30
|
-
assert_file 'views/layout.erb', /styled_flash/
|
31
|
-
end
|
32
|
-
end
|
33
|
-
# rubocop:enable Metrics/MethodLength
|
34
|
-
# rubocop:enable Metrics/AbcSize
|
35
|
-
|
36
|
-
def test_generate_classic_tiny
|
37
|
-
run_hoboken(:generate, tiny: true) do
|
38
|
-
refute_directory('public')
|
39
|
-
assert_file 'app.rb', /__END__/, /@@layout/, /@@index/
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_generate_classic_api_only
|
44
|
-
run_hoboken(:generate, api_only: true) do
|
45
|
-
refute_directory('public')
|
46
|
-
refute_directory('views')
|
47
|
-
assert_file 'app.rb', %r{require 'sinatra/json'}
|
48
|
-
assert_file 'app.rb', /json message:/
|
49
|
-
assert_file_does_not_have_content 'app.rb', %r{require 'sinatra/flash'}
|
50
|
-
assert_file_does_not_have_content 'app.rb', /erb :index/
|
51
|
-
assert_file_does_not_have_content 'app.rb', /set :erb, { escape_html: true }/
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_generate_api_only_with_tiny
|
56
|
-
run_hoboken(:generate, api_only: true, tiny: true) do
|
57
|
-
assert_file_does_not_have_content 'app.rb', /__END__/, /@@layout/, /@@index/
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_generate_classic_can_run_tests
|
62
|
-
run_hoboken(:generate) do
|
63
|
-
result = execute('rake test:all')
|
64
|
-
assert_match(/1 tests, 3 assertions, 0 failures, 0 errors/, result)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def test_generate_classic_can_run_specs
|
69
|
-
run_hoboken(:generate, test_framework: 'rspec') do
|
70
|
-
result = execute('rake spec')
|
71
|
-
assert_match(/3 examples, 0 failures/, result)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def test_generate_classic_api_only_can_run_tests
|
76
|
-
run_hoboken(:generate, api_only: true) do
|
77
|
-
result = execute('rake test:all')
|
78
|
-
assert_match(/1 tests, 3 assertions, 0 failures, 0 errors/, result)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def test_generate_classic_api_only_can_run_specs
|
83
|
-
run_hoboken(:generate, api_only: true, test_framework: 'rspec') do
|
84
|
-
result = execute('rake spec')
|
85
|
-
assert_match(/3 examples, 0 failures/, result)
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_generate_classic_passes_rubocop_inspection
|
90
|
-
run_hoboken(:generate) do
|
91
|
-
assert_match(/no offenses detected/, execute('rubocop'))
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_generate_classic_api_only_passes_rubocop_inspection
|
96
|
-
run_hoboken(:generate, api_only: true) do
|
97
|
-
assert_match(/no offenses detected/, execute('rubocop'))
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
# rubocop:disable Metrics/MethodLength
|
102
|
-
# rubocop:disable Metrics/AbcSize
|
103
|
-
def test_generate_modular
|
104
|
-
run_hoboken(:generate, type: :modular) do
|
105
|
-
assert_file '.env'
|
106
|
-
assert_file 'Gemfile'
|
107
|
-
assert_file('Procfile')
|
108
|
-
assert_file 'README.md'
|
109
|
-
assert_file 'Rakefile'
|
110
|
-
assert_file('app.rb', %r{require 'sinatra/base'})
|
111
|
-
assert_file 'app.rb', %r{require 'sinatra/flash'}
|
112
|
-
assert_file('app.rb', /require 'erubi'/)
|
113
|
-
assert_file('app.rb', /module Sample/)
|
114
|
-
assert_file('app.rb', /class App < Sinatra::Base/)
|
115
|
-
assert_file 'app.rb', /set :erb, { escape_html: true }/
|
116
|
-
assert_file 'app.rb', /register Sinatra::Flash/
|
117
|
-
assert_file 'app.rb', /require 'better_errors'/
|
118
|
-
assert_file 'bin/console'
|
119
|
-
assert_file 'bin/server'
|
120
|
-
assert_file 'bin/setup'
|
121
|
-
assert_file 'config.ru', /run Sample::App/
|
122
|
-
assert_directory 'public'
|
123
|
-
assert_file 'test/support/rack_helpers.rb', /Sample::App/
|
124
|
-
assert_file 'views/index.erb'
|
125
|
-
assert_file 'views/layout.erb', /styled_flash/
|
126
|
-
end
|
127
|
-
end
|
128
|
-
# rubocop:enable Metrics/MethodLength
|
129
|
-
# rubocop:enable Metrics/AbcSize
|
130
|
-
|
131
|
-
def test_generate_modular_tiny
|
132
|
-
run_hoboken(:generate, tiny: true, type: :modular) do
|
133
|
-
refute_directory('public')
|
134
|
-
assert_file 'app.rb', /__END__/, /@@layout/, /@@index/
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
def test_generate_modular_api_only
|
139
|
-
run_hoboken(:generate, type: :modular, api_only: true) do
|
140
|
-
refute_directory('public')
|
141
|
-
refute_directory('views')
|
142
|
-
assert_file 'app.rb', %r{require 'sinatra/json'}
|
143
|
-
assert_file 'app.rb', /json message:/
|
144
|
-
assert_file_does_not_have_content 'app.rb', %r{require 'sinatra/flash'}
|
145
|
-
assert_file_does_not_have_content 'app.rb', /register Sinatra::Flash/
|
146
|
-
assert_file_does_not_have_content 'app.rb', /erb :index/
|
147
|
-
assert_file_does_not_have_content 'app.rb', /set :erb, { escape_html: true }/
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
def test_generate_modular_can_run_tests
|
152
|
-
run_hoboken(:generate, type: :modular) do
|
153
|
-
result = execute('rake test:all')
|
154
|
-
assert_match(/1 tests, 3 assertions, 0 failures, 0 errors/, result)
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
def test_generate_modular_can_run_specs
|
159
|
-
run_hoboken(:generate, test_framework: 'rspec', type: :modular) do
|
160
|
-
result = execute('rake spec')
|
161
|
-
assert_match(/3 examples, 0 failures/, result)
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
def test_generate_modular_api_only_can_run_tests
|
166
|
-
run_hoboken(:generate, api_only: true, type: :modular) do
|
167
|
-
result = execute('rake test:all')
|
168
|
-
assert_match(/1 tests, 3 assertions, 0 failures, 0 errors/, result)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
|
172
|
-
def test_generate_modular_api_only_can_run_specs
|
173
|
-
run_hoboken(:generate, test_framework: 'rspec', api_only: true, type: :modular) do
|
174
|
-
result = execute('rake spec')
|
175
|
-
assert_match(/3 examples, 0 failures/, result)
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
def test_generate_modular_passes_rubocop_inspection
|
180
|
-
run_hoboken(:generate, type: :modular) do
|
181
|
-
assert_match(/no offenses detected/, execute('rubocop'))
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
def test_generate_modular_api_only_passes_rubocop_inspection
|
186
|
-
run_hoboken(:generate, api_only: true, type: :modular) do
|
187
|
-
assert_match(/no offenses detected/, execute('rubocop'))
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
def test_generate_with_ruby_version
|
192
|
-
run_hoboken(:generate, ruby_version: '2.1.0') do
|
193
|
-
assert_file 'Gemfile', /ruby '2\.1\.0'/
|
194
|
-
end
|
195
|
-
end
|
196
|
-
|
197
|
-
def test_generate_with_git
|
198
|
-
run_hoboken(:generate, git: true) do
|
199
|
-
assert_directory '.git'
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
# rubocop:enable Metrics/ClassLength
|