rails_template_18f 0.4.0 → 0.4.1
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 +5 -0
- data/Gemfile +0 -2
- data/Gemfile.lock +2 -2
- data/lib/generators/rails_template18f/active_storage/active_storage_generator.rb +14 -7
- data/lib/generators/rails_template18f/circleci/circleci_generator.rb +4 -1
- data/lib/generators/rails_template18f/cloud_gov_config/cloud_gov_config_generator.rb +2 -1
- data/lib/generators/rails_template18f/i18n/i18n_generator.rb +8 -9
- data/lib/generators/rails_template18f/i18n_js/i18n_js_generator.rb +7 -8
- data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +2 -0
- data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +3 -1
- data/lib/rails_template18f/generators/base.rb +15 -0
- data/lib/rails_template18f/version.rb +1 -1
- data/rails-template-18f.gemspec +1 -0
- data/template.rb +3 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf6b140f15f85229d716db5c0b51db5b88b41172000f89a613bdc09975c61f7
|
4
|
+
data.tar.gz: 6a3a14efb4cb1373236a53260cf06b161375346d37097563ef65197862e538a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fb2a0c4a4adf9fa72ea8078a6b1001671f2e562ece7b3d74b64ffa39c113b96c280f64a3eacc0233b67c8bc2b6ec160b2867c78e49363100d1cdc7055352516
|
7
|
+
data.tar.gz: 48e96e771a2fb4dd8ca03719f923ae2749b6b212577c88c8e72a3e2788d71b1a6a6bda768611509aa2001e129a7a29c833ad99a93433bf954c46552671d40c2b
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_template_18f (0.4.
|
4
|
+
rails_template_18f (0.4.1)
|
5
5
|
activesupport (~> 7.0.0)
|
6
|
+
colorize (~> 0.8)
|
6
7
|
railties (~> 7.0.0)
|
7
8
|
thor (~> 1.0)
|
8
9
|
|
@@ -125,7 +126,6 @@ PLATFORMS
|
|
125
126
|
DEPENDENCIES
|
126
127
|
ammeter (~> 1.1)
|
127
128
|
byebug
|
128
|
-
colorize (~> 0.8)
|
129
129
|
rails_template_18f!
|
130
130
|
rake (~> 13.0)
|
131
131
|
rspec (~> 3.11)
|
@@ -13,8 +13,8 @@ module RailsTemplate18f
|
|
13
13
|
DESC
|
14
14
|
|
15
15
|
def configure_active_storage
|
16
|
-
generate "rails_template18f:cloud_gov_config"
|
17
|
-
rails_command "active_storage:install"
|
16
|
+
generate "rails_template18f:cloud_gov_config", inline: true
|
17
|
+
rails_command "active_storage:install", inline: true
|
18
18
|
comment_lines "config/environments/production.rb", /active_storage\.service/
|
19
19
|
insert_into_file "config/environments/production.rb", "\n config.active_storage.service = :amazon", after: /active_storage\.service.*$/
|
20
20
|
environment "config.active_storage.service = :local", env: "ci"
|
@@ -30,15 +30,22 @@ module RailsTemplate18f
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def install_gems
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
faraday_installed = gem_installed?("faraday")
|
34
|
+
middleware_installed = gem_installed?("faraday-multipart")
|
35
|
+
sdk_installed = gem_installed?("aws-sdk-s3")
|
36
|
+
return if faraday_installed && middleware_installed && sdk_installed
|
37
|
+
gem "faraday", "~> 2.2" unless faraday_installed
|
38
|
+
gem "faraday-multipart", "~> 1.0" unless middleware_installed
|
39
|
+
unless sdk_installed
|
40
|
+
gem_group :production do
|
41
|
+
gem "aws-sdk-s3", "~> 1.112"
|
42
|
+
end
|
37
43
|
end
|
44
|
+
bundle_install
|
38
45
|
end
|
39
46
|
|
40
47
|
def create_scanned_upload_model_and_job
|
41
|
-
generate :migration, "CreateFileUploads", "file:attachment", "record:references{polymorphic}", "scan_status:string"
|
48
|
+
generate :migration, "CreateFileUploads", "file:attachment", "record:references{polymorphic}", "scan_status:string", inline: true
|
42
49
|
migration_file = Dir.glob(File.expand_path(File.join("db", "migrate", "[0-9]*_*.rb"), destination_root)).grep(/\d+_create_file_uploads.rb$/).first
|
43
50
|
unless migration_file.nil?
|
44
51
|
gsub_file migration_file, ":scan_status", ":scan_status, null: false, default: \"uploaded\""
|
@@ -14,7 +14,10 @@ module RailsTemplate18f
|
|
14
14
|
DESC
|
15
15
|
|
16
16
|
def install_needed_gems
|
17
|
-
|
17
|
+
gem_name = "rspec_junit_formatter"
|
18
|
+
return if gem_installed? gem_name
|
19
|
+
gem gem_name, "~> 0.5", group: :test
|
20
|
+
bundle_install
|
18
21
|
end
|
19
22
|
|
20
23
|
def install_pipeline
|
@@ -13,10 +13,11 @@ module RailsTemplate18f
|
|
13
13
|
DESC
|
14
14
|
|
15
15
|
def install_climate_control
|
16
|
-
return if
|
16
|
+
return if gem_installed?("climate_control")
|
17
17
|
gem_group :test do
|
18
18
|
gem "climate_control", "~> 1.0"
|
19
19
|
end
|
20
|
+
bundle_install
|
20
21
|
end
|
21
22
|
|
22
23
|
def install_model_and_test
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "rails/generators"
|
4
|
-
require "bundler"
|
5
4
|
|
6
5
|
module RailsTemplate18f
|
7
6
|
module Generators
|
@@ -16,17 +15,17 @@ module RailsTemplate18f
|
|
16
15
|
Always installs configuration for English
|
17
16
|
DESC
|
18
17
|
|
19
|
-
def
|
20
|
-
return if
|
18
|
+
def install_gem
|
19
|
+
return if gem_installed?("i18n-tasks")
|
21
20
|
gem_group :development, :test do
|
22
21
|
gem "i18n-tasks", "~> 0.9"
|
23
22
|
end
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
end
|
24
|
+
|
25
|
+
def install_helper_tasks
|
26
|
+
bundle_install do
|
27
|
+
run "cp $(i18n-tasks gem-path)/templates/config/i18n-tasks.yml config/"
|
28
|
+
run "cp $(i18n-tasks gem-path)/templates/rspec/i18n_spec.rb spec/"
|
30
29
|
end
|
31
30
|
insert_into_file "config/i18n-tasks.yml", "\n#{indent("- app/assets/builds", 4)}", after: "exclude:"
|
32
31
|
uncomment_lines "config/i18n-tasks.yml", "ignore_missing:"
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "rails/generators"
|
4
|
-
require "bundler"
|
5
4
|
|
6
5
|
module RailsTemplate18f
|
7
6
|
module Generators
|
@@ -16,15 +15,15 @@ module RailsTemplate18f
|
|
16
15
|
DESC
|
17
16
|
|
18
17
|
def install_gem_and_tasks
|
19
|
-
return if
|
18
|
+
return if gem_installed?("i18n-js")
|
20
19
|
gem "i18n-js", "~> 3.9"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
run "yarn add i18n-js"
|
25
|
-
generate "i18n:js:config"
|
26
|
-
end
|
20
|
+
bundle_install do
|
21
|
+
run "yarn add i18n-js"
|
22
|
+
generate "i18n:js:config"
|
27
23
|
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def configure_translation_yaml
|
28
27
|
append_to_file "config/i18n-js.yml", <<~EOYAML
|
29
28
|
# remove `only` to include all translations
|
30
29
|
translations:
|
@@ -13,7 +13,9 @@ module RailsTemplate18f
|
|
13
13
|
DESC
|
14
14
|
|
15
15
|
def install_gem
|
16
|
+
return if gem_installed?("sidekiq")
|
16
17
|
gem "sidekiq", "~> 6.4"
|
18
|
+
bundle_install
|
17
19
|
end
|
18
20
|
|
19
21
|
def configure_server_runner
|
@@ -38,7 +40,7 @@ module RailsTemplate18f
|
|
38
40
|
end
|
39
41
|
|
40
42
|
def configure_active_job
|
41
|
-
generate "rails_template18f:cloud_gov_config"
|
43
|
+
generate "rails_template18f:cloud_gov_config", inline: true
|
42
44
|
copy_file "config/initializers/redis.rb"
|
43
45
|
application "config.active_job.queue_adapter = :sidekiq"
|
44
46
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "bundler"
|
4
|
+
|
3
5
|
module RailsTemplate18f
|
4
6
|
module Generators
|
5
7
|
module Base
|
@@ -20,6 +22,19 @@ module RailsTemplate18f
|
|
20
22
|
|
21
23
|
private
|
22
24
|
|
25
|
+
def bundle_install
|
26
|
+
Bundler.with_original_env do
|
27
|
+
in_root do
|
28
|
+
run "bundle install"
|
29
|
+
yield if block_given?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def gem_installed?(gem_name)
|
35
|
+
file_content("Gemfile").match?(/gem "#{gem_name}"/)
|
36
|
+
end
|
37
|
+
|
23
38
|
def file_content(filename)
|
24
39
|
file_path = File.expand_path(filename, destination_root)
|
25
40
|
if File.exist? file_path
|
data/rails-template-18f.gemspec
CHANGED
@@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "railties", "~> 7.0.0"
|
35
35
|
spec.add_dependency "activesupport", "~> 7.0.0"
|
36
36
|
spec.add_dependency "thor", "~> 1.0"
|
37
|
+
spec.add_dependency "colorize", "~> 0.8"
|
37
38
|
|
38
39
|
spec.add_development_dependency "rspec", "~> 3.11"
|
39
40
|
spec.add_development_dependency "ammeter", "~> 1.1"
|
data/template.rb
CHANGED
@@ -191,7 +191,9 @@ copy_file "env", ".env"
|
|
191
191
|
copy_file "githooks/pre-commit", ".githooks/pre-commit", mode: :preserve
|
192
192
|
|
193
193
|
unless skip_git?
|
194
|
-
|
194
|
+
after_bundle do
|
195
|
+
rails_command "credentials:diff --enroll"
|
196
|
+
end
|
195
197
|
append_to_file ".gitignore", <<~EOM
|
196
198
|
|
197
199
|
# Ignore local dotenv overrides
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_template_18f
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Ahearn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: colorize
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.8'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.8'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
263
|
- !ruby/object:Gem::Version
|
250
264
|
version: '0'
|
251
265
|
requirements: []
|
252
|
-
rubygems_version: 3.
|
266
|
+
rubygems_version: 3.3.7
|
253
267
|
signing_key:
|
254
268
|
specification_version: 4
|
255
269
|
summary: Generators for creating an 18F-flavored Rails app
|