rails_template_18f 0.4.1 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccf6b140f15f85229d716db5c0b51db5b88b41172000f89a613bdc09975c61f7
4
- data.tar.gz: 6a3a14efb4cb1373236a53260cf06b161375346d37097563ef65197862e538a8
3
+ metadata.gz: c9452d60916a767ee1b00bb0a76e6582d4d1ed760b3bf0c4d68a07c8225ddfd4
4
+ data.tar.gz: 481c2ee7693849f2c21d382d78edd08a59370b8c2b440bef8502d22a039a2243
5
5
  SHA512:
6
- metadata.gz: 8fb2a0c4a4adf9fa72ea8078a6b1001671f2e562ece7b3d74b64ffa39c113b96c280f64a3eacc0233b67c8bc2b6ec160b2867c78e49363100d1cdc7055352516
7
- data.tar.gz: 48e96e771a2fb4dd8ca03719f923ae2749b6b212577c88c8e72a3e2788d71b1a6a6bda768611509aa2001e129a7a29c833ad99a93433bf954c46552671d40c2b
6
+ metadata.gz: 8a5b1be47db25412b0ba04dd19a395401f86b6d5ee14b907c2de54e95bfae159a6407851bfcd83b07ac20ca9423de568580c5cfdec0c5d49bfd5e2f7f62e59df
7
+ data.tar.gz: 75ff52ec4661f95c4da617217d7eb7dc993192610d9209ab3f9a438504111281a8c779db3074c1d6506073b126d437c6aaebe328b11add1363797938f70d006e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.0] - 2022-03-04
4
+
5
+ - use Brewfile for installing homebrew-based dependencies
6
+ - move test site banner to the _usa_banner.html.erb partial
7
+ - use dockerize within bin/with-server to wait for rails to start
8
+
3
9
  ## [0.4.1] - 2022-02-25
4
10
 
5
11
  - update gem dependencies
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_template_18f (0.4.1)
4
+ rails_template_18f (0.5.0)
5
5
  activesupport (~> 7.0.0)
6
6
  colorize (~> 0.8)
7
7
  railties (~> 7.0.0)
@@ -47,9 +47,9 @@ GEM
47
47
  nokogiri (>= 1.5.9)
48
48
  method_source (1.0.0)
49
49
  minitest (5.15.0)
50
- nokogiri (1.13.1-x86_64-darwin)
50
+ nokogiri (1.13.3-x86_64-darwin)
51
51
  racc (~> 1.4)
52
- nokogiri (1.13.1-x86_64-linux)
52
+ nokogiri (1.13.3-x86_64-linux)
53
53
  racc (~> 1.4)
54
54
  parallel (1.21.0)
55
55
  parser (3.1.0.0)
@@ -61,7 +61,6 @@ module RailsTemplate18f
61
61
  def configure_clamav_env_var
62
62
  append_to_file ".env", <<~EOM
63
63
 
64
-
65
64
  # CLAMAV_API_URL tells FileScanJob where to send files for virus scans
66
65
  CLAMAV_API_URL=https://localhost:9443
67
66
  EOM
@@ -18,6 +18,15 @@ module RailsTemplate18f
18
18
  bundle_install
19
19
  end
20
20
 
21
+ def install_redis
22
+ append_to_file "Brewfile", <<~EOB
23
+
24
+ # queue for sidekiq jobs
25
+ brew "redis"
26
+ EOB
27
+ insert_into_file "README.md", indent("* [redis]()\n"), after: /\* Install homebrew dependencies: `brew bundle`\n/
28
+ end
29
+
21
30
  def configure_server_runner
22
31
  append_to_file "Procfile.dev", "worker: bundle exec sidekiq\n"
23
32
  insert_into_file "manifest.yml", indent(<<~EOYAML), after: /processes:$\n/
@@ -2,7 +2,7 @@
2
2
 
3
3
  This directory holds the terraform modules for maintaining your complete persistent infrastructure.
4
4
 
5
- Prerequisite: install the `jq` JSON processor: `brew install jq`
5
+ Prerequisite: install the `jq` JSON processor: `brew bundle` or `brew install jq`
6
6
 
7
7
  ## Initial setup
8
8
 
@@ -19,6 +19,15 @@ module RailsTemplate18f
19
19
  chmod "terraform/bootstrap/teardown_creds.sh", 0o755
20
20
  end
21
21
 
22
+ def install_jq
23
+ append_to_file "Brewfile", <<~EOB
24
+
25
+ # used in terraform/create_space_deployer.sh
26
+ brew "jq"
27
+ EOB
28
+ insert_into_file "README.md", indent("* [jq](https://stedolan.github.io/jq/)\n"), after: /\* Install homebrew dependencies: `brew bundle`\n/
29
+ end
30
+
22
31
  def ignore_files
23
32
  unless skip_git?
24
33
  append_to_file ".gitignore", <<~EOM
@@ -34,7 +43,7 @@ module RailsTemplate18f
34
43
  end
35
44
 
36
45
  def update_readme
37
- gsub_file "README.md", /^(### Automatic linting)/, '\1 and terraform formatting'
46
+ gsub_file "README.md", /^(### Automatic linting)\s*$/, '\1 and terraform formatting'
38
47
  gsub_file "README.md", /(ruby linting) (on every)/, '\1 and terraform formatting \2'
39
48
  gsub_file "README.md", /^Before the first deploy only.*$/, "Follow the instructions in `terraform/README.md` to create the supporting services."
40
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsTemplate18f
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
data/template.rb CHANGED
@@ -87,6 +87,13 @@ register_announcement("Documentation", <<~EOM)
87
87
  * Review any TBD sections of the README and update where appropriate.
88
88
  EOM
89
89
 
90
+ # ensure dependencies are installed
91
+ copy_file "Brewfile"
92
+ insert_into_file "bin/setup", <<EOSETUP, after: /Add necessary setup steps to this file.\n/
93
+ puts "== Installing homebrew dependencies =="
94
+ system("brew bundle --no-lock")
95
+ EOSETUP
96
+
90
97
  # setup nvmrc
91
98
  file ".nvmrc", @node_version
92
99
 
@@ -196,6 +203,9 @@ unless skip_git?
196
203
  end
197
204
  append_to_file ".gitignore", <<~EOM
198
205
 
206
+ # Ignore Brewfile debug info
207
+ Brewfile.lock.json
208
+
199
209
  # Ignore local dotenv overrides
200
210
  .env*.local
201
211
 
@@ -0,0 +1,14 @@
1
+ # Brewfile
2
+ # add any dependencies that must be installed from homebrew here
3
+
4
+ # cloud.gov RDS is on postgres 12
5
+ brew "postgresql@12", link: true
6
+
7
+ # used in bin/with-server script
8
+ brew "dockerize"
9
+
10
+ # helper scripts for creating new ADRs
11
+ brew "adr-tools"
12
+
13
+ # chromedriver for integration tests
14
+ cask "chromedriver"
@@ -12,16 +12,15 @@ guide for an introduction to the framework.
12
12
 
13
13
  * Install Ruby <%= @ruby_version %>
14
14
  * Install NodeJS <%= @node_version %>
15
- * Install PostgreSQL: `brew install postgresql`
16
- * Add postgres to your PATH if it wasn't done automatically
17
- `echo 'export PATH="/usr/local/opt/postgresql/bin:$PATH"' >> ~/.zshrc`
18
- * Start the server
19
- `brew services start postgresql`
15
+ * Install homebrew dependencies: `brew bundle`
16
+ * [PostgreSQL](https://www.postgresql.org/)
17
+ * [Dockerize](https://github.com/jwilder/dockerize)
18
+ * [ADR Tools](https://github.com/npryce/adr-tools)
19
+ * [Chromedriver](https://sites.google.com/chromium.org/driver/)
20
+ * Chromedriver must be allowed to run. You can either do that by:
21
+ * The command line: `xattr -d com.apple.quarantine $(which chromedriver)` (this is the only option if you are on Big Sur)
22
+ * Manually: clicking "allow" when you run the integration tests for the first time and a dialogue opens up
20
23
  * Install Ruby dependencies: `bundle install`
21
- * Install chromedriver for integration tests: `brew install --cask chromedriver`
22
- * Chromedriver must be allowed to run. You can either do that by:
23
- * The command line: `xattr -d com.apple.quarantine $(which chromedriver)` (this is the only option if you are on Big Sur)
24
- * Manually: clicking "allow" when you run the integration tests for the first time and a dialogue opens up
25
24
  * Install JS dependencies: `yarn install`
26
25
  * Create database: `bundle exec rake db:create`
27
26
  * Run migrations: `bundle exec rake db:migrate`
@@ -145,7 +144,7 @@ Configuration that changes from staging to production, but is public, should be
145
144
  Architectural Decision Records (ADR) are stored in `doc/adr`
146
145
  To create a new ADR, first install [ADR-tools](https://github.com/npryce/adr-tools) if you don't
147
146
  already have it installed.
148
- * `brew install adr-tools`
147
+ * `brew bundle` or `brew install adr-tools`
149
148
 
150
149
  Then create the ADR:
151
150
  * `adr new Title Of Architectural Decision`
@@ -1,6 +1,5 @@
1
1
  <div class="usa-overlay"></div>
2
2
  <header class="usa-header usa-header--basic">
3
- <%= render "application/demo_site_banner" if Rails.configuration.x.show_demo_banner %>
4
3
  <div class="usa-nav-container">
5
4
  <div class="usa-navbar">
6
5
  <div class="usa-logo">
@@ -49,3 +49,5 @@
49
49
  </div>
50
50
  </div>
51
51
  </section>
52
+
53
+ <%= render "application/demo_site_banner" if Rails.configuration.x.show_demo_banner %>
@@ -20,9 +20,8 @@ bundle exec rake assets:precompile
20
20
  # run the server
21
21
  bundle exec rails server &
22
22
  server_pid=$!
23
- # pause to ensure the server has started
24
- sleep 5
25
23
 
24
+ dockerize -wait http://localhost:3000 -timeout 1m
26
25
 
27
26
  $@
28
27
  exit_status=$?
data/templates/env CHANGED
@@ -7,4 +7,4 @@
7
7
  ###################################################################################################
8
8
 
9
9
  # SHOW_DEMO_BANNER controls whether to show the TEST SITE banner in Rails.env.development
10
- SHOW_DEMO_BANNER=false
10
+ SHOW_DEMO_BANNER=false
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.1
4
+ version: 0.5.0
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-25 00:00:00.000000000 Z
11
+ date: 2022-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -210,6 +210,7 @@ files:
210
210
  - railsrc
211
211
  - railsrc-hotwire
212
212
  - template.rb
213
+ - templates/Brewfile
213
214
  - templates/README.md.tt
214
215
  - templates/app/assets/images/uswds.js
215
216
  - templates/app/assets/stylesheets/uswds-settings.scss
@@ -263,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
264
  - !ruby/object:Gem::Version
264
265
  version: '0'
265
266
  requirements: []
266
- rubygems_version: 3.3.7
267
+ rubygems_version: 3.2.32
267
268
  signing_key:
268
269
  specification_version: 4
269
270
  summary: Generators for creating an 18F-flavored Rails app