underlay 1.50.1 → 1.52.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/underlay/app_builder.rb +7 -2
- data/lib/underlay/generators/app_generator.rb +22 -2
- data/lib/underlay/version.rb +1 -1
- data/templates/Gemfile.erb +1 -0
- data/templates/application.example.yml +1 -0
- data/templates/redis.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dde78cb7d8ba8f2c8c7f93250425fb19b24ebb44907faacf37453e5d293a109
|
4
|
+
data.tar.gz: 1a5a24be479c3750e32430ffa8e08fe2eb595e7a4c6657d06cd9661c76dfa247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbd4a1c9931e083852d4d11af6b644a735ee9ea4f83b5ec956d38de51e2360f7e1bcd1799b58e6bf15c0740c78246797b31d21b25375d5c042a16b0819f20608
|
7
|
+
data.tar.gz: cba387c279816491b9ea3fac214480750b48391842baf47d26e8bc2bd34cfde93700f50dc5278d6400d74d229cee1c6c997137ddb81439b8abb48ec2798b6c81
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Then run:
|
|
12
12
|
|
13
13
|
underlay projectname
|
14
14
|
|
15
|
-
This will create a Rails app in `projectname` using the latest version of Rails.
|
15
|
+
This will create a Rails API app in `projectname` using the latest version of Rails.
|
16
16
|
|
17
17
|
### Associated services
|
18
18
|
|
@@ -155,13 +155,13 @@ around stale code not being refreshed.
|
|
155
155
|
If you think your application is running old code, run `spring stop`.
|
156
156
|
And if you'd rather not use spring, add `DISABLE_SPRING=1` to your login file.
|
157
157
|
|
158
|
-
##
|
158
|
+
## Application mode
|
159
159
|
|
160
|
-
You can set
|
160
|
+
You can set Application mode:
|
161
161
|
|
162
|
-
`underlay app --
|
162
|
+
`underlay app --application_mode true`
|
163
163
|
|
164
|
-
This creates
|
164
|
+
This creates full Rails application including assets and action cable.
|
165
165
|
|
166
166
|
## Dependencies
|
167
167
|
|
@@ -173,10 +173,10 @@ PostgreSQL needs to be installed and running for the `db:create` rake task.
|
|
173
173
|
|
174
174
|
- [X] Install TwilioBase gem (if the option is set)
|
175
175
|
- [x] Remove duplicate application.html.erb layout
|
176
|
-
- [
|
176
|
+
- [X] Fix issue with flashes.scss partial not being added to assets
|
177
177
|
- [ ] Configure s3 buckets and ENV vars
|
178
|
-
- [
|
179
|
-
- [
|
178
|
+
- [X] Manually check all files are created and in place
|
179
|
+
- [X] Configure Redis on heroku (with config vars + initializer)
|
180
180
|
- [X] Update rake (in generated project) to run lints
|
181
181
|
- [X] Prevent views and static sites from generating in API mode
|
182
182
|
- [ ] Setup default front-end libraries and depencies
|
data/lib/underlay/app_builder.rb
CHANGED
@@ -429,6 +429,7 @@ module Underlay
|
|
429
429
|
copy_file 'errors.rb', 'config/initializers/errors.rb'
|
430
430
|
copy_file 'json_encoding.rb', 'config/initializers/json_encoding.rb'
|
431
431
|
copy_file 'lograge.rb', 'config/initializers/lograge.rb'
|
432
|
+
copy_file 'redis.rb', 'config/initializers/redis.rb'
|
432
433
|
copy_file 'sentry.rb', 'config/initializers/sentry.rb'
|
433
434
|
end
|
434
435
|
|
@@ -504,7 +505,7 @@ module Underlay
|
|
504
505
|
"if Rails.root.join('tmp', 'caching-dev.txt').exist?"
|
505
506
|
)
|
506
507
|
|
507
|
-
simple_form_corrections unless
|
508
|
+
simple_form_corrections unless api_mode?
|
508
509
|
end
|
509
510
|
|
510
511
|
def non_api_files_removal
|
@@ -546,11 +547,15 @@ module Underlay
|
|
546
547
|
end
|
547
548
|
|
548
549
|
def mode_dependent_files
|
549
|
-
if
|
550
|
+
if api_mode?
|
550
551
|
['initializers/cors.rb']
|
551
552
|
else
|
552
553
|
['initializers/simple_form.rb']
|
553
554
|
end
|
554
555
|
end
|
556
|
+
|
557
|
+
def api_mode?
|
558
|
+
options[:application_mode].blank?
|
559
|
+
end
|
555
560
|
end
|
556
561
|
end
|
@@ -7,6 +7,10 @@ module Underlay
|
|
7
7
|
class AppGenerator < Rails::Generators::AppGenerator
|
8
8
|
hide!
|
9
9
|
|
10
|
+
class_option :application_mode,
|
11
|
+
type: :boolean, default: false,
|
12
|
+
desc: 'Application mode is enabled'
|
13
|
+
|
10
14
|
class_option :database,
|
11
15
|
type: :string, aliases: '-d', default: 'postgresql',
|
12
16
|
desc: "Configure for selected database (options: #{DATABASES.join('/')})"
|
@@ -47,6 +51,18 @@ module Underlay
|
|
47
51
|
type: :boolean, aliases: '-v', group: :underlay,
|
48
52
|
desc: 'Show Underlay version number and quit'
|
49
53
|
|
54
|
+
def initialize(*args)
|
55
|
+
super
|
56
|
+
|
57
|
+
if api_mode?
|
58
|
+
self.options = options.merge(
|
59
|
+
api: true,
|
60
|
+
skip_sprockets: true,
|
61
|
+
skip_javascript: true
|
62
|
+
).freeze
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
50
66
|
def finish_template
|
51
67
|
invoke :underlay_customization
|
52
68
|
super
|
@@ -266,15 +282,19 @@ module Underlay
|
|
266
282
|
end
|
267
283
|
|
268
284
|
def build_for_non_api(args)
|
269
|
-
return if
|
285
|
+
return if api_mode?
|
270
286
|
|
271
287
|
build args
|
272
288
|
end
|
273
289
|
|
274
290
|
def build_for_api(args)
|
275
|
-
return unless
|
291
|
+
return unless api_mode?
|
276
292
|
|
277
293
|
build args
|
278
294
|
end
|
295
|
+
|
296
|
+
def api_mode?
|
297
|
+
options[:application_mode].blank?
|
298
|
+
end
|
279
299
|
end
|
280
300
|
end
|
data/lib/underlay/version.rb
CHANGED
data/templates/Gemfile.erb
CHANGED
data/templates/redis.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: underlay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.52.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dvelp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- templates/puma.rb
|
139
139
|
- templates/rack_mini_profiler.rb
|
140
140
|
- templates/rails_helper.rb
|
141
|
+
- templates/redis.rb
|
141
142
|
- templates/rubocop.yml.erb
|
142
143
|
- templates/scss-lint.yml.erb
|
143
144
|
- templates/secrets.yml
|