lotusrb 0.5.0 → 0.6.0
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 +57 -14
- data/FEATURES.md +21 -0
- data/LICENSE.md +1 -1
- data/README.md +8 -7
- data/bin/lotus +1 -0
- data/lib/lotus.rb +6 -0
- data/lib/lotus/action/csrf_protection.rb +1 -1
- data/lib/lotus/application.rb +4 -4
- data/lib/lotus/application_name.rb +8 -6
- data/lib/lotus/cli.rb +75 -66
- data/lib/lotus/cli_sub_commands/assets.rb +29 -0
- data/lib/lotus/{commands → cli_sub_commands}/db.rb +24 -29
- data/lib/lotus/cli_sub_commands/destroy.rb +102 -0
- data/lib/lotus/cli_sub_commands/generate.rb +127 -0
- data/lib/lotus/commands/assets/precompile.rb +35 -0
- data/lib/lotus/commands/console.rb +28 -8
- data/lib/lotus/commands/db/abstract.rb +6 -2
- data/lib/lotus/commands/db/console.rb +5 -5
- data/lib/lotus/commands/generate/abstract.rb +63 -0
- data/lib/lotus/commands/generate/action.rb +262 -0
- data/lib/lotus/commands/generate/app.rb +116 -0
- data/lib/lotus/commands/generate/mailer.rb +118 -0
- data/lib/lotus/commands/generate/migration.rb +63 -0
- data/lib/lotus/commands/generate/model.rb +96 -0
- data/lib/lotus/commands/new/abstract.rb +128 -0
- data/lib/lotus/commands/new/app.rb +116 -0
- data/lib/lotus/commands/new/container.rb +102 -0
- data/lib/lotus/commands/routes.rb +19 -2
- data/lib/lotus/commands/server.rb +16 -2
- data/lib/lotus/config/framework_configuration.rb +13 -1
- data/lib/lotus/configuration.rb +24 -76
- data/lib/lotus/container.rb +15 -2
- data/lib/lotus/environment.rb +43 -4
- data/lib/lotus/frameworks.rb +1 -0
- data/lib/lotus/generators/action/action_spec.minitest.tt +1 -1
- data/lib/lotus/generators/action/action_spec.rspec.tt +1 -1
- data/lib/lotus/generators/action/view_spec.minitest.tt +1 -1
- data/lib/lotus/generators/action/view_spec.rspec.tt +1 -1
- data/lib/lotus/generators/{slice → app}/.gitkeep.tt +0 -0
- data/lib/lotus/generators/{slice → app}/application.rb.tt +61 -23
- data/lib/lotus/generators/app/config/initializers/.gitkeep +0 -0
- data/lib/lotus/generators/{slice → app}/config/routes.rb.tt +0 -0
- data/lib/lotus/generators/app/favicon.ico +0 -0
- data/lib/lotus/generators/{slice → app}/templates/application.html.erb.tt +2 -1
- data/lib/lotus/generators/app/views/application_layout.rb.tt +7 -0
- data/lib/lotus/generators/application/app/.env.development.tt +1 -0
- data/lib/lotus/generators/application/app/.env.test.tt +1 -0
- data/lib/lotus/generators/application/app/Gemfile.tt +1 -0
- data/lib/lotus/generators/application/app/Rakefile.minitest.tt +1 -0
- data/lib/lotus/generators/application/app/Rakefile.rspec.tt +1 -0
- data/lib/lotus/generators/application/app/config/application.rb.tt +56 -18
- data/lib/lotus/generators/application/app/config/initializers/.gitkeep +0 -0
- data/lib/lotus/generators/application/app/favicon.ico +0 -0
- data/lib/lotus/generators/application/app/gitignore.tt +2 -0
- data/lib/lotus/generators/application/app/lotusrc.tt +3 -3
- data/lib/lotus/generators/application/app/spec_helper.rb.rspec.tt +5 -1
- data/lib/lotus/generators/application/app/templates/application.html.erb.tt +1 -0
- data/lib/lotus/generators/application/container/.env.development.tt +1 -0
- data/lib/lotus/generators/application/container/.env.test.tt +1 -0
- data/lib/lotus/generators/application/container/Gemfile.tt +1 -1
- data/lib/lotus/generators/application/container/Rakefile.minitest.tt +1 -0
- data/lib/lotus/generators/application/container/Rakefile.rspec.tt +1 -0
- data/lib/lotus/generators/application/container/config/initializers/.gitkeep +0 -0
- data/lib/lotus/generators/application/container/gitignore.tt +2 -0
- data/lib/lotus/generators/application/container/lib/chirp/mailers/.gitkeep +0 -0
- data/lib/lotus/generators/application/container/lib/chirp/mailers/templates/.gitkeep +0 -0
- data/lib/lotus/generators/application/container/lotusrc.tt +3 -3
- data/lib/lotus/generators/application/container/spec_helper.rb.rspec.tt +5 -1
- data/lib/lotus/generators/database_config.rb +17 -4
- data/lib/lotus/generators/generatable.rb +51 -0
- data/lib/lotus/generators/generator.rb +35 -0
- data/lib/lotus/generators/test_framework.rb +42 -0
- data/lib/lotus/loader.rb +43 -0
- data/lib/lotus/lotusrc.rb +50 -49
- data/lib/lotus/middleware.rb +28 -10
- data/lib/lotus/rake_helper.rb +68 -0
- data/lib/lotus/rake_tasks.rb +2 -0
- data/lib/lotus/rendering_policy.rb +2 -2
- data/lib/lotus/repositories/car_repository.rb +3 -0
- data/lib/lotus/repositories/name_repository.rb +3 -0
- data/lib/lotus/setup.rb +1 -3
- data/lib/lotus/static.rb +77 -0
- data/lib/lotus/templates/welcome.html.erb +7 -4
- data/lib/lotus/version.rb +1 -1
- data/lib/lotus/views/default.rb +2 -1
- data/lib/lotus/views/default_template_finder.rb +4 -3
- data/lotusrb.gemspec +11 -9
- metadata +79 -60
- data/lib/lotus/commands/generate.rb +0 -97
- data/lib/lotus/commands/new.rb +0 -43
- data/lib/lotus/config/assets.rb +0 -81
- data/lib/lotus/generators/abstract.rb +0 -31
- data/lib/lotus/generators/action.rb +0 -235
- data/lib/lotus/generators/app.rb +0 -39
- data/lib/lotus/generators/app/.gitkeep +0 -1
- data/lib/lotus/generators/application/app.rb +0 -129
- data/lib/lotus/generators/application/container.rb +0 -111
- data/lib/lotus/generators/mailer.rb +0 -112
- data/lib/lotus/generators/migration.rb +0 -58
- data/lib/lotus/generators/model.rb +0 -90
- data/lib/lotus/generators/slice.rb +0 -94
- data/lib/lotus/generators/slice/views/application_layout.rb.tt +0 -7
data/lib/lotus/frameworks.rb
CHANGED
@@ -5,7 +5,7 @@ describe <%= config[:app] %>::Controllers::<%= config[:controller] %>::<%= confi
|
|
5
5
|
let(:action) { <%= config[:app] %>::Controllers::<%= config[:controller] %>::<%= config[:action] %>.new }
|
6
6
|
let(:params) { Hash[] }
|
7
7
|
|
8
|
-
it
|
8
|
+
it 'is successful' do
|
9
9
|
response = action.call(params)
|
10
10
|
response[0].must_equal 200
|
11
11
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '<%= config[:relative_action_path] %>'
|
2
2
|
|
3
|
-
describe <%= config[:app] %>::Controllers::<%= config[:controller] %>::<%= config[:action] %> do
|
3
|
+
RSpec.describe <%= config[:app] %>::Controllers::<%= config[:controller] %>::<%= config[:action] %> do
|
4
4
|
let(:action) { described_class.new }
|
5
5
|
let(:params) { Hash[] }
|
6
6
|
|
@@ -7,7 +7,7 @@ describe <%= config[:app] %>::Views::<%= config[:controller] %>::<%= config[:act
|
|
7
7
|
let(:view) { <%= config[:app] %>::Views::<%= config[:controller] %>::<%= config[:action] %>.new(template, exposures) }
|
8
8
|
let(:rendered) { view.render }
|
9
9
|
|
10
|
-
it
|
10
|
+
it 'exposes #foo' do
|
11
11
|
view.foo.must_equal exposures.fetch(:foo)
|
12
12
|
end
|
13
13
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '<%= config[:relative_view_path] %>'
|
2
2
|
|
3
|
-
describe <%= config[:app] %>::Views::<%= config[:controller] %>::<%= config[:action] %> do
|
3
|
+
RSpec.describe <%= config[:app] %>::Views::<%= config[:controller] %>::<%= config[:action] %> do
|
4
4
|
let(:exposures) { Hash[foo: 'bar'] }
|
5
5
|
let(:template) { Lotus::View::Template.new('<%= config[:template_path] %>') }
|
6
6
|
let(:view) { described_class.new(template, exposures) }
|
File without changes
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'lotus/helpers'
|
2
|
+
require 'lotus/assets'
|
2
3
|
|
3
|
-
module <%= config[:
|
4
|
+
module <%= config[:classified_app_name] %>
|
4
5
|
class Application < Lotus::Application
|
5
6
|
configure do
|
6
7
|
##
|
@@ -73,7 +74,7 @@ module <%= config[:classified_slice_name] %>
|
|
73
74
|
#
|
74
75
|
# See: http://www.rubydoc.info/gems/rack/Rack/Session/Cookie
|
75
76
|
#
|
76
|
-
# sessions :cookie, secret: ENV['<%= config[:
|
77
|
+
# sessions :cookie, secret: ENV['<%= config[:upcase_app_name] %>_SESSIONS_SECRET']
|
77
78
|
|
78
79
|
# Configure Rack middleware for this application
|
79
80
|
#
|
@@ -107,7 +108,7 @@ module <%= config[:classified_slice_name] %>
|
|
107
108
|
|
108
109
|
# The layout to be used by all views
|
109
110
|
#
|
110
|
-
layout :application # It will load <%= config[:
|
111
|
+
layout :application # It will load <%= config[:classified_app_name] %>::Views::ApplicationLayout
|
111
112
|
|
112
113
|
# The relative path to templates
|
113
114
|
#
|
@@ -116,18 +117,40 @@ module <%= config[:classified_slice_name] %>
|
|
116
117
|
##
|
117
118
|
# ASSETS
|
118
119
|
#
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
120
|
+
assets do
|
121
|
+
# JavaScript compressor
|
122
|
+
#
|
123
|
+
# Supported engines:
|
124
|
+
#
|
125
|
+
# * :builtin
|
126
|
+
# * :uglifier
|
127
|
+
# * :yui
|
128
|
+
# * :closure
|
129
|
+
#
|
130
|
+
# See: http://lotusrb.org/guides/assets/compressors
|
131
|
+
#
|
132
|
+
# In order to skip JavaScript compression comment the following line
|
133
|
+
javascript_compressor :builtin
|
134
|
+
|
135
|
+
# Stylesheet compressor
|
136
|
+
#
|
137
|
+
# Supported engines:
|
138
|
+
#
|
139
|
+
# * :builtin
|
140
|
+
# * :yui
|
141
|
+
# * :sass
|
142
|
+
#
|
143
|
+
# See: http://lotusrb.org/guides/assets/compressors
|
144
|
+
#
|
145
|
+
# In order to skip stylesheet compression comment the following line
|
146
|
+
stylesheet_compressor :builtin
|
147
|
+
|
148
|
+
# Specify sources for assets
|
149
|
+
#
|
150
|
+
sources << [
|
151
|
+
'assets'
|
152
|
+
]
|
153
|
+
end
|
131
154
|
|
132
155
|
##
|
133
156
|
# SECURITY
|
@@ -183,7 +206,7 @@ module <%= config[:classified_slice_name] %>
|
|
183
206
|
# FRAMEWORKS
|
184
207
|
#
|
185
208
|
|
186
|
-
# Configure the code that will yield each time <%= config[:
|
209
|
+
# Configure the code that will yield each time <%= config[:classified_app_name] %>::Action is included
|
187
210
|
# This is useful for sharing common functionality
|
188
211
|
#
|
189
212
|
# See: http://www.rubydoc.info/gems/lotus-controller#Configuration
|
@@ -192,12 +215,13 @@ module <%= config[:classified_slice_name] %>
|
|
192
215
|
# before :authenticate! # run an authentication before callback
|
193
216
|
end
|
194
217
|
|
195
|
-
# Configure the code that will yield each time <%= config[:
|
218
|
+
# Configure the code that will yield each time <%= config[:classified_app_name] %>::View is included
|
196
219
|
# This is useful for sharing common functionality
|
197
220
|
#
|
198
221
|
# See: http://www.rubydoc.info/gems/lotus-view#Configuration
|
199
222
|
view.prepare do
|
200
223
|
include Lotus::Helpers
|
224
|
+
include <%= config[:classified_app_name] %>::Assets::Helpers
|
201
225
|
end
|
202
226
|
end
|
203
227
|
|
@@ -207,9 +231,6 @@ module <%= config[:classified_slice_name] %>
|
|
207
231
|
configure :development do
|
208
232
|
# Don't handle exceptions, render the stack trace
|
209
233
|
handle_exceptions false
|
210
|
-
|
211
|
-
# Serve static assets during development
|
212
|
-
serve_assets true
|
213
234
|
end
|
214
235
|
|
215
236
|
##
|
@@ -218,9 +239,6 @@ module <%= config[:classified_slice_name] %>
|
|
218
239
|
configure :test do
|
219
240
|
# Don't handle exceptions, render the stack trace
|
220
241
|
handle_exceptions false
|
221
|
-
|
222
|
-
# Serve static assets during development
|
223
|
-
serve_assets true
|
224
242
|
end
|
225
243
|
|
226
244
|
##
|
@@ -230,6 +248,26 @@ module <%= config[:classified_slice_name] %>
|
|
230
248
|
# scheme 'https'
|
231
249
|
# host 'example.org'
|
232
250
|
# port 443
|
251
|
+
|
252
|
+
assets do
|
253
|
+
# Don't compile static assets in production mode (eg. Sass, ES6)
|
254
|
+
#
|
255
|
+
# See: http://www.rubydoc.info/gems/lotus-assets#Configuration
|
256
|
+
compile false
|
257
|
+
|
258
|
+
# Use digest file name for asset paths
|
259
|
+
#
|
260
|
+
# See: http://lotusrb.org/guides/assets/digest
|
261
|
+
digest true
|
262
|
+
|
263
|
+
# Content Delivery Network (CDN)
|
264
|
+
#
|
265
|
+
# See: http://lotusrb.org/guides/assets/content-delivery-network
|
266
|
+
#
|
267
|
+
# scheme 'https'
|
268
|
+
# host 'cdn.example.org'
|
269
|
+
# port 443
|
270
|
+
end
|
233
271
|
end
|
234
272
|
end
|
235
273
|
end
|
File without changes
|
File without changes
|
Binary file
|
@@ -12,6 +12,7 @@ gem 'lotus-controller', require: false, github: 'lotus/controller'
|
|
12
12
|
gem 'lotus-view', require: false, github: 'lotus/view'
|
13
13
|
gem 'lotus-model', require: false, github: 'lotus/model'
|
14
14
|
gem 'lotus-mailer', require: false, github: 'lotus/mailer'
|
15
|
+
gem 'lotus-assets', require: false, github: 'lotus/assets'
|
15
16
|
gem 'lotusrb', github: 'lotus/lotus'
|
16
17
|
<%- else -%>
|
17
18
|
gem 'lotusrb', '<%= Lotus::VERSION %>'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'lotus/helpers'
|
2
|
+
require 'lotus/assets'
|
2
3
|
|
3
4
|
module <%= config[:classified_app_name] %>
|
4
5
|
class Application < Lotus::Application
|
@@ -113,18 +114,40 @@ module <%= config[:classified_app_name] %>
|
|
113
114
|
##
|
114
115
|
# ASSETS
|
115
116
|
#
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
117
|
+
assets do
|
118
|
+
# JavaScript compressor
|
119
|
+
#
|
120
|
+
# Supported engines:
|
121
|
+
#
|
122
|
+
# * :builtin
|
123
|
+
# * :uglifier
|
124
|
+
# * :yui
|
125
|
+
# * :closure
|
126
|
+
#
|
127
|
+
# See: http://lotusrb.org/guides/assets/compressors
|
128
|
+
#
|
129
|
+
# In order to skip JavaScript compression comment the following line
|
130
|
+
javascript_compressor :builtin
|
131
|
+
|
132
|
+
# Stylesheet compressor
|
133
|
+
#
|
134
|
+
# Supported engines:
|
135
|
+
#
|
136
|
+
# * :builtin
|
137
|
+
# * :yui
|
138
|
+
# * :sass
|
139
|
+
#
|
140
|
+
# See: http://lotusrb.org/guides/assets/compressors
|
141
|
+
#
|
142
|
+
# In order to skip stylesheet compression comment the following line
|
143
|
+
stylesheet_compressor :builtin
|
144
|
+
|
145
|
+
# Specify sources for assets
|
146
|
+
#
|
147
|
+
sources << [
|
148
|
+
'app/assets'
|
149
|
+
]
|
150
|
+
end
|
128
151
|
|
129
152
|
##
|
130
153
|
# SECURITY
|
@@ -195,6 +218,7 @@ module <%= config[:classified_app_name] %>
|
|
195
218
|
# See: http://www.rubydoc.info/gems/lotus-view#Configuration
|
196
219
|
view.prepare do
|
197
220
|
include Lotus::Helpers
|
221
|
+
include <%= config[:classified_app_name] %>::Assets::Helpers
|
198
222
|
end
|
199
223
|
end
|
200
224
|
|
@@ -204,9 +228,6 @@ module <%= config[:classified_app_name] %>
|
|
204
228
|
configure :development do
|
205
229
|
# Don't handle exceptions, render the stack trace
|
206
230
|
handle_exceptions false
|
207
|
-
|
208
|
-
# Serve static assets during development
|
209
|
-
serve_assets true
|
210
231
|
end
|
211
232
|
|
212
233
|
##
|
@@ -215,9 +236,6 @@ module <%= config[:classified_app_name] %>
|
|
215
236
|
configure :test do
|
216
237
|
# Don't handle exceptions, render the stack trace
|
217
238
|
handle_exceptions false
|
218
|
-
|
219
|
-
# Serve static assets during development
|
220
|
-
serve_assets true
|
221
239
|
end
|
222
240
|
|
223
241
|
##
|
@@ -227,6 +245,26 @@ module <%= config[:classified_app_name] %>
|
|
227
245
|
# scheme 'https'
|
228
246
|
# host 'example.org'
|
229
247
|
# port 443
|
248
|
+
|
249
|
+
assets do
|
250
|
+
# Don't compile static assets in production mode (eg. Sass, ES6)
|
251
|
+
#
|
252
|
+
# See: http://www.rubydoc.info/gems/lotus-assets#Configuration
|
253
|
+
compile false
|
254
|
+
|
255
|
+
# Use digest file name for asset paths
|
256
|
+
#
|
257
|
+
# See: http://lotusrb.org/guides/assets/digest
|
258
|
+
digest true
|
259
|
+
|
260
|
+
# Content Delivery Network (CDN)
|
261
|
+
#
|
262
|
+
# See: http://lotusrb.org/guides/assets/content-delivery-network
|
263
|
+
#
|
264
|
+
# scheme 'https'
|
265
|
+
# host 'cdn.example.org'
|
266
|
+
# port 443
|
267
|
+
end
|
230
268
|
end
|
231
269
|
end
|
232
270
|
end
|
File without changes
|
Binary file
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
<%= Lotus::Lotusrc::ARCHITECTURE_KEY %>=<%= Lotus::Lotusrc::APP_ARCHITECTURE %>
|
2
|
+
<%= Lotus::Lotusrc::TEST_KEY %>=<%= config[:test] %>
|
3
|
+
<%= Lotus::Lotusrc::TEMPLATE_KEY %>=<%= Lotus::Lotusrc::DEFAULT_TEMPLATE %>
|
@@ -58,6 +58,11 @@ RSpec.configure do |config|
|
|
58
58
|
config.filter_run :focus
|
59
59
|
config.run_all_when_everything_filtered = true
|
60
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
|
+
|
61
66
|
# Limits the available syntax to the non-monkey patched syntax that is
|
62
67
|
# recommended. For more details, see:
|
63
68
|
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
@@ -97,4 +102,3 @@ RSpec.configure do |config|
|
|
97
102
|
Kernel.srand config.seed
|
98
103
|
=end
|
99
104
|
end
|
100
|
-
|
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'bundler'
|
4
4
|
gem 'rake'
|
5
|
-
|
6
5
|
<%- if config[:lotus_head] -%>
|
7
6
|
gem 'lotus-utils', require: false, github: 'lotus/utils'
|
8
7
|
gem 'lotus-router', require: false, github: 'lotus/router'
|
@@ -12,6 +11,7 @@ gem 'lotus-controller', require: false, github: 'lotus/controller'
|
|
12
11
|
gem 'lotus-view', require: false, github: 'lotus/view'
|
13
12
|
gem 'lotus-model', require: false, github: 'lotus/model'
|
14
13
|
gem 'lotus-mailer', require: false, github: 'lotus/mailer'
|
14
|
+
gem 'lotus-assets', require: false, github: 'lotus/assets'
|
15
15
|
gem 'lotusrb', github: 'lotus/lotus'
|
16
16
|
<%- else -%>
|
17
17
|
gem 'lotusrb', '<%= Lotus::VERSION %>'
|