rails_template_18f 0.5.0 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9452d60916a767ee1b00bb0a76e6582d4d1ed760b3bf0c4d68a07c8225ddfd4
4
- data.tar.gz: 481c2ee7693849f2c21d382d78edd08a59370b8c2b440bef8502d22a039a2243
3
+ metadata.gz: 69b1bf665be20b3234b5a6cc358a35167cf3ab4dc7833ba1f8a3615970f2a617
4
+ data.tar.gz: ec93203edd447a12699c94d57583b7971f846e70f415ad91915860386f83e862
5
5
  SHA512:
6
- metadata.gz: 8a5b1be47db25412b0ba04dd19a395401f86b6d5ee14b907c2de54e95bfae159a6407851bfcd83b07ac20ca9423de568580c5cfdec0c5d49bfd5e2f7f62e59df
7
- data.tar.gz: 75ff52ec4661f95c4da617217d7eb7dc993192610d9209ab3f9a438504111281a8c779db3074c1d6506073b126d437c6aaebe328b11add1363797938f70d006e
6
+ metadata.gz: dec9d9bcd8c8111fbcfc826d995fd8197751e93c0c4463fd0d321d3a71b71a920f39340b60df4011cf0ab3ccbce9a6ec71258044cfc11bdae29f271fcde4d978
7
+ data.tar.gz: 22e0ce9181cef72c2081326175b314e865f752422e9d72a54e74f01fca39e23c70b23659ba5c7372ec4dc141a826f48a691d0f68690ba810ce7fe9e6eab6269b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.3] - 2022-06-06
4
+
5
+ - check that server started properly before running anything in `bin/with-server`
6
+ - add helper script for setting cloud.gov egress rules
7
+
8
+ ## [0.5.2] - 2022-03-24
9
+
10
+ - add extra branch test coverage to CloudGovConfig
11
+ - replace forked version of @csstools/postcss-sass with released version
12
+ - upgrade i18n-tasks gem to 1.0
13
+
14
+ ## [0.5.1] - 2022-03-17
15
+
16
+ - fix interaction between foreman and dotenv by disabling foreman's env loading
17
+
3
18
  ## [0.5.0] - 2022-03-04
4
19
 
5
20
  - use Brewfile for installing homebrew-based dependencies
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_template_18f (0.5.0)
4
+ rails_template_18f (0.5.3)
5
5
  activesupport (~> 7.0.0)
6
6
  colorize (~> 0.8)
7
7
  railties (~> 7.0.0)
@@ -10,20 +10,20 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (7.0.2.2)
14
- actionview (= 7.0.2.2)
15
- activesupport (= 7.0.2.2)
13
+ actionpack (7.0.3)
14
+ actionview (= 7.0.3)
15
+ activesupport (= 7.0.3)
16
16
  rack (~> 2.0, >= 2.2.0)
17
17
  rack-test (>= 0.6.3)
18
18
  rails-dom-testing (~> 2.0)
19
19
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
20
- actionview (7.0.2.2)
21
- activesupport (= 7.0.2.2)
20
+ actionview (7.0.3)
21
+ activesupport (= 7.0.3)
22
22
  builder (~> 3.1)
23
23
  erubi (~> 1.4)
24
24
  rails-dom-testing (~> 2.0)
25
25
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
26
- activesupport (7.0.2.2)
26
+ activesupport (7.0.3)
27
27
  concurrent-ruby (~> 1.0, >= 1.0.2)
28
28
  i18n (>= 1.6, < 2)
29
29
  minitest (>= 5.1)
@@ -36,26 +36,26 @@ GEM
36
36
  builder (3.2.4)
37
37
  byebug (11.1.3)
38
38
  colorize (0.8.1)
39
- concurrent-ruby (1.1.9)
39
+ concurrent-ruby (1.1.10)
40
40
  crass (1.0.6)
41
41
  diff-lcs (1.5.0)
42
42
  erubi (1.10.0)
43
- i18n (1.9.1)
43
+ i18n (1.10.0)
44
44
  concurrent-ruby (~> 1.0)
45
- loofah (2.14.0)
45
+ loofah (2.18.0)
46
46
  crass (~> 1.0.2)
47
47
  nokogiri (>= 1.5.9)
48
48
  method_source (1.0.0)
49
49
  minitest (5.15.0)
50
- nokogiri (1.13.3-x86_64-darwin)
50
+ nokogiri (1.13.6-x86_64-darwin)
51
51
  racc (~> 1.4)
52
- nokogiri (1.13.3-x86_64-linux)
52
+ nokogiri (1.13.6-x86_64-linux)
53
53
  racc (~> 1.4)
54
- parallel (1.21.0)
55
- parser (3.1.0.0)
54
+ parallel (1.22.1)
55
+ parser (3.1.2.0)
56
56
  ast (~> 2.4.1)
57
57
  racc (1.6.0)
58
- rack (2.2.3)
58
+ rack (2.2.3.1)
59
59
  rack-test (1.1.0)
60
60
  rack (>= 1.0, < 3)
61
61
  rails-dom-testing (2.0.3)
@@ -63,16 +63,16 @@ GEM
63
63
  nokogiri (>= 1.6)
64
64
  rails-html-sanitizer (1.4.2)
65
65
  loofah (~> 2.3)
66
- railties (7.0.2.2)
67
- actionpack (= 7.0.2.2)
68
- activesupport (= 7.0.2.2)
66
+ railties (7.0.3)
67
+ actionpack (= 7.0.3)
68
+ activesupport (= 7.0.3)
69
69
  method_source
70
70
  rake (>= 12.2)
71
71
  thor (~> 1.0)
72
72
  zeitwerk (~> 2.5)
73
73
  rainbow (3.1.1)
74
74
  rake (13.0.6)
75
- regexp_parser (2.2.0)
75
+ regexp_parser (2.4.0)
76
76
  rexml (3.2.5)
77
77
  rspec (3.11.0)
78
78
  rspec-core (~> 3.11.0)
@@ -83,10 +83,10 @@ GEM
83
83
  rspec-expectations (3.11.0)
84
84
  diff-lcs (>= 1.2.0, < 2.0)
85
85
  rspec-support (~> 3.11.0)
86
- rspec-mocks (3.11.0)
86
+ rspec-mocks (3.11.1)
87
87
  diff-lcs (>= 1.2.0, < 2.0)
88
88
  rspec-support (~> 3.11.0)
89
- rspec-rails (5.1.0)
89
+ rspec-rails (5.1.2)
90
90
  actionpack (>= 5.2)
91
91
  activesupport (>= 5.2)
92
92
  railties (>= 5.2)
@@ -95,24 +95,24 @@ GEM
95
95
  rspec-mocks (~> 3.10)
96
96
  rspec-support (~> 3.10)
97
97
  rspec-support (3.11.0)
98
- rubocop (1.25.1)
98
+ rubocop (1.29.0)
99
99
  parallel (~> 1.10)
100
100
  parser (>= 3.1.0.0)
101
101
  rainbow (>= 2.2.2, < 4.0)
102
102
  regexp_parser (>= 1.8, < 3.0)
103
- rexml
104
- rubocop-ast (>= 1.15.1, < 2.0)
103
+ rexml (>= 3.2.5, < 4.0)
104
+ rubocop-ast (>= 1.17.0, < 2.0)
105
105
  ruby-progressbar (~> 1.7)
106
106
  unicode-display_width (>= 1.4.0, < 3.0)
107
- rubocop-ast (1.15.1)
108
- parser (>= 3.0.1.1)
109
- rubocop-performance (1.13.2)
107
+ rubocop-ast (1.17.0)
108
+ parser (>= 3.1.1.0)
109
+ rubocop-performance (1.13.3)
110
110
  rubocop (>= 1.7.0, < 2.0)
111
111
  rubocop-ast (>= 0.4.0)
112
112
  ruby-progressbar (1.11.0)
113
- standard (1.7.1)
114
- rubocop (= 1.25.1)
115
- rubocop-performance (= 1.13.2)
113
+ standard (1.12.0)
114
+ rubocop (= 1.29.0)
115
+ rubocop-performance (= 1.13.3)
116
116
  thor (1.2.1)
117
117
  tzinfo (2.0.4)
118
118
  concurrent-ruby (~> 1.0)
@@ -121,6 +121,7 @@ GEM
121
121
 
122
122
  PLATFORMS
123
123
  x86_64-darwin-20
124
+ x86_64-darwin-21
124
125
  x86_64-linux
125
126
 
126
127
  DEPENDENCIES
@@ -132,4 +133,4 @@ DEPENDENCIES
132
133
  standard (~> 1.3)
133
134
 
134
135
  BUNDLED WITH
135
- 2.2.32
136
+ 2.3.15
@@ -37,7 +37,11 @@ RSpec.describe CloudGovConfig, type: :model do
37
37
  end
38
38
 
39
39
  it "returns nil for a missing path" do
40
- expect(subject.dig(:s3, :credentials, :other)).to be_nil
40
+ expect(subject.dig(:s3, :missing)).to be_nil
41
+ end
42
+
43
+ it "returns nil for a missing service" do
44
+ expect(subject.dig(:rds, :credentials)).to be_nil
41
45
  end
42
46
  end
43
47
  end
@@ -18,7 +18,7 @@ module RailsTemplate18f
18
18
  def install_gem
19
19
  return if gem_installed?("i18n-tasks")
20
20
  gem_group :development, :test do
21
- gem "i18n-tasks", "~> 0.9"
21
+ gem "i18n-tasks", "~> 1.0"
22
22
  end
23
23
  end
24
24
 
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env bash
2
+
3
+ org="<%= cloud_gov_organization %>"
4
+
5
+ usage="
6
+ $0: Set egress rules for given space
7
+
8
+ Usage:
9
+ $0 -h
10
+ $0 -s <SPACE NAME> [-o <ORG NAME>] [-p] [-t]
11
+
12
+ Options:
13
+ -h: show help and exit
14
+ -s <SPACE NAME>: configure the space to act on. Required
15
+ -o <ORG NAME>: configure the organization to act on. Default: $org
16
+ -p: Add the public egress rules
17
+ -t: Add the trusted egress rules
18
+
19
+ Notes:
20
+ * If -p or -t are not passed, the related security groups will be removed, if they were present
21
+ "
22
+
23
+ set -e
24
+
25
+ space=""
26
+ public=false
27
+ trusted=false
28
+
29
+ while getopts ":hs:o:pt" opt; do
30
+ case "$opt" in
31
+ s)
32
+ space=${OPTARG}
33
+ ;;
34
+ o)
35
+ org=${OPTARG}
36
+ ;;
37
+ p)
38
+ public=true
39
+ ;;
40
+ t)
41
+ trusted=true
42
+ ;;
43
+ h)
44
+ echo "$usage"
45
+ exit 0
46
+ ;;
47
+ esac
48
+ done
49
+
50
+ if [[ $space = "" ]]; then
51
+ echo "$usage"
52
+ exit 1
53
+ fi
54
+
55
+ if [[ $public = true ]]; then
56
+ cf bind-security-group public_networks_egress $org --space $space
57
+ else
58
+ cf unbind-security-group public_networks_egress $org $space
59
+ fi
60
+
61
+ if [[ $trusted = true ]]; then
62
+ cf bind-security-group trusted_local_networks_egress $org --space $space
63
+ else
64
+ cf unbind-security-group trusted_local_networks_egress $org $space
65
+ fi
66
+
67
+ echo "Done"
@@ -15,6 +15,7 @@ module RailsTemplate18f
15
15
 
16
16
  def install
17
17
  directory "terraform", mode: :preserve
18
+ chmod "terraform/set_space_egress.sh", 0o755
18
19
  chmod "terraform/bootstrap/run.sh", 0o755
19
20
  chmod "terraform/bootstrap/teardown_creds.sh", 0o755
20
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsTemplate18f
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.3"
5
5
  end
data/template.rb CHANGED
@@ -192,6 +192,12 @@ if ENV["RT_DEV"] == "true"
192
192
  else
193
193
  gem "rails_template_18f", group: :development
194
194
  end
195
+ after_bundle do
196
+ gsub_file "bin/dev", /foreman start -f (.*)$/, <<~'EOM'
197
+ # pass /dev/null for the environment file to prevent weird interactions between foreman and dotenv
198
+ foreman start -e /dev/null -f \1
199
+ EOM
200
+ end
195
201
 
196
202
  copy_file "lib/tasks/scanning.rake"
197
203
  copy_file "env", ".env"
@@ -233,10 +239,11 @@ after_bundle do
233
239
  "build:css": "postcss ./app/assets/stylesheets/application.postcss.css -o ./app/assets/builds/application.css"
234
240
  },
235
241
  EOJSON
242
+ # include verbose flag for dev postcss output
243
+ gsub_file "Procfile.dev", "yarn build:css --watch", "yarn build:css --verbose --watch"
236
244
  # Replace postcss-nesting with sass since USWDS uses sass
237
245
  run "yarn remove postcss-nesting"
238
- # include fork of @csstools/postcss-sass until that library is updated for postcss 8
239
- run "yarn add https://github.com/sinankeskin/postcss-sass"
246
+ run "yarn add @csstools/postcss-sass"
240
247
  run "yarn add postcss-scss"
241
248
  insert_into_file "postcss.config.js", " syntax: 'postcss-scss',\n", before: /^\s+plugins/
242
249
  gsub_file "postcss.config.js", "postcss-nesting", "@csstools/postcss-sass"
@@ -265,8 +272,6 @@ after_bundle do
265
272
  end
266
273
  directory "app/assets"
267
274
  append_to_file "app/assets/stylesheets/application.postcss.css", <<~EOCSS
268
- /* KNOWN ISSUE: only changes to application.postcss.css will trigger an automatic rebuild */
269
- /* restart your server or run `yarn build:css` when changing other files */
270
275
  @import "uswds-settings.scss";
271
276
  @import "../../../node_modules/uswds/dist/scss/uswds.scss";
272
277
  EOCSS
@@ -31,9 +31,9 @@ guide for an introduction to the framework.
31
31
 
32
32
  Environment variables can be set in development using the [dotenv](https://github.com/bkeepers/dotenv) gem.
33
33
 
34
- Consistent but sensitive credentials should be added to `config/credentials.yml.env` by using `$ rails credentials:edit`
34
+ Consistent but sensitive credentials should be added to `config/credentials.yml.enc` by using `$ rails credentials:edit`
35
35
 
36
- Production credentials should be added to `config/credentials/production.yml.env` by using `$ rails credentials:edit --environment production`
36
+ Production credentials should be added to `config/credentials/production.yml.enc` by using `$ rails credentials:edit --environment production`
37
37
 
38
38
  Any changes to variables in `.env` that should not be checked into git should be set
39
39
  in `.env.local`.
@@ -22,13 +22,15 @@ bundle exec rails server &
22
22
  server_pid=$!
23
23
 
24
24
  dockerize -wait http://localhost:3000 -timeout 1m
25
-
26
- $@
27
25
  exit_status=$?
28
26
 
27
+ if [[ $exit_status -eq 0 ]]; then
28
+ $@
29
+ exit_status=$?
30
+ fi
29
31
 
30
32
  # shut down the server and cleanup after ourselves
31
- bundle exec rake assets:clobber
32
33
  kill $server_pid
34
+ bundle exec rake assets:clobber
33
35
 
34
36
  exit $exit_status
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.5.0
4
+ version: 0.5.3
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-03-04 00:00:00.000000000 Z
11
+ date: 2022-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -180,6 +180,7 @@ files:
180
180
  - lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt
181
181
  - lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt
182
182
  - lib/generators/rails_template18f/terraform/templates/terraform/production/variables.tf
183
+ - lib/generators/rails_template18f/terraform/templates/terraform/set_space_egress.sh.tt
183
184
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/main.tf.tt
184
185
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/providers.tf
185
186
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/variables.tf
@@ -264,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
265
  - !ruby/object:Gem::Version
265
266
  version: '0'
266
267
  requirements: []
267
- rubygems_version: 3.2.32
268
+ rubygems_version: 3.3.7
268
269
  signing_key:
269
270
  specification_version: 4
270
271
  summary: Generators for creating an 18F-flavored Rails app