boring_generators 0.10.0 → 0.12.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.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql-analysis.yml +70 -0
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +16 -0
  5. data/Gemfile.lock +10 -12
  6. data/README.md +9 -1
  7. data/lib/boring_generators/version.rb +1 -1
  8. data/lib/generators/boring/bootstrap/install/install_generator.rb +15 -1
  9. data/lib/generators/boring/ci/github_action/install/install_generator.rb +1 -1
  10. data/lib/generators/boring/ci/github_action/install/templates/ci.yml.tt +15 -2
  11. data/lib/generators/boring/factory_bot/install/install_generator.rb +46 -0
  12. data/lib/generators/boring/factory_bot/install/templates/users.rb +8 -0
  13. data/lib/generators/boring/faker/install/install_generator.rb +17 -0
  14. data/lib/generators/boring/flipper/install/install_generator.rb +37 -0
  15. data/lib/generators/boring/flipper/install/templates/initializer.rb.tt +19 -0
  16. data/lib/generators/boring/overcommit/base_generator.rb +45 -0
  17. data/lib/generators/boring/overcommit/pre_commit/rubocop/install/install_generator.rb +62 -0
  18. data/lib/generators/boring/paper_trail/install/install_generator.rb +40 -0
  19. data/lib/generators/boring/rails_admin/install/install_generator.rb +36 -0
  20. data/lib/generators/boring/rspec/install/install_generator.rb +50 -0
  21. data/lib/generators/boring/rubocop/install/install_generator.rb +32 -6
  22. data/lib/generators/boring/rubocop/install/templates/.rubocop.yml.tt +6 -3
  23. data/lib/generators/boring/stimulus/install/install_generator.rb +24 -0
  24. data/tmp/templates/app_template/yarn.lock +65 -104
  25. metadata +15 -4
  26. data/tmp/templates/app_template/log/development.log +0 -72
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0270bea161b8e7aa0cce68a2f79bd8456865f7f0ee00c3fef81b0ecddbfba1e1
4
- data.tar.gz: 19e58c07ef090636ca05c1e7c620e750994c72e052ae3dc51e6b1887783582cb
3
+ metadata.gz: 359acba051da88cd0afd42b265845dd57da2ac688e57466cfca79a87fdba8dec
4
+ data.tar.gz: cf6b4543e010b57774ce160a49e02c962b4c90b1764cd6ff504725dffeced453
5
5
  SHA512:
6
- metadata.gz: 1dd9d49410e16f73b13116f490fca9407313bf845f21ce45e403b5e4ced43e7647e0ed52b020f175cae2571ad6b6a5ff16b2ade2d271a338905837c93b58317a
7
- data.tar.gz: '092146185b12c44adad625d7c67a19253759a4d7b7a8a520ec4b541bf066f49aa98dba50787dc46ad535ad2318c79e31fb6e2fc60d7e14733872948f738ee83a'
6
+ metadata.gz: a0895d2a677ff5c80e2249a0f5dca86f6f1ab1b74b0d53e2d08d5c2f8f437daef054511e4b6a6c15854e40721e5a21e81a41dec74267a072031628ecb86332fa
7
+ data.tar.gz: 5e31f9a9804338af68046deb67f081e5754a9a09b2b61c651eb0191e259936878af814ff67241234ea802a4311887a8ed81cf7e5354514ba88333f8c585d6674
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ main ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ main ]
20
+ schedule:
21
+ - cron: '41 1 * * 3'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'javascript', 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v2
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v1
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v1
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v1
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /tmp/
9
9
  /log/
10
10
  .byebug_history
11
+
12
+ *.log
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.12.0 (May 8th, 2023)
6
+ * Adds Flipper generator. ([@abhaynikam][])
7
+ * Adds FactoryBot generator. ([@abhaynikam][])
8
+ * Adds Faker generator. ([@abhaynikam][])
9
+ * Adds RSpec generator. ([@abhaynikam][])
10
+ * Update default node-version for GitHub Action generator and fixes PG setup issues. ([@abhaynikam][])
11
+ * Updates Bootstrap generator for supporting Bootstrap 5 with popper.js. ([@abhaynikam][])
12
+ * Adds Overcommit generator for RuboCop. ([@coolprobn][])
13
+ * Updates RuboCop generator to add rubocop-rake extension and support test frameworks ([@coolprobn][])
14
+
15
+ ## 0.11.0 (June 23rd, 2021)
16
+ * Adds Stimulus generator. ([@abhaynikam][])
17
+ * Adds Rails Admin generator. ([@abhaynikam][])
18
+ * Adds Paper Trail generator. ([@abhaynikam][])
19
+
5
20
  ## 0.10.0 (May 26th, 2021)
6
21
  * Updates Stripe payment generator. ([@abhaynikam][])
7
22
  * Fixes many generators which install ruby gems to not hardcode gem version. ([@abhaynikam][])
@@ -61,3 +76,4 @@
61
76
  [@CiTroNaK]: https://github.com/CiTroNaK
62
77
  [@jamesglover]: https://github.com/JamesGlover
63
78
  [@luathn]: https://github.com/luathn
79
+ [@coolprobn]: https://github.com/coolprobn
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boring_generators (0.9.0)
4
+ boring_generators (0.11.0)
5
5
  railties
6
6
 
7
7
  GEM
@@ -71,7 +71,7 @@ GEM
71
71
  activesupport (>= 4.2.0)
72
72
  i18n (1.8.10)
73
73
  concurrent-ruby (~> 1.0)
74
- loofah (2.9.1)
74
+ loofah (2.20.0)
75
75
  crass (~> 1.0.2)
76
76
  nokogiri (>= 1.5.9)
77
77
  mail (2.7.1)
@@ -79,14 +79,12 @@ GEM
79
79
  marcel (1.0.1)
80
80
  method_source (1.0.0)
81
81
  mini_mime (1.1.0)
82
- mini_portile2 (2.5.0)
82
+ mini_portile2 (2.4.0)
83
83
  minitest (5.14.4)
84
84
  nio4r (2.5.7)
85
- nokogiri (1.11.3)
86
- mini_portile2 (~> 2.5.0)
87
- racc (~> 1.4)
88
- racc (1.5.2)
89
- rack (2.2.3)
85
+ nokogiri (1.10.10)
86
+ mini_portile2 (~> 2.4.0)
87
+ rack (2.2.6.4)
90
88
  rack-test (1.1.0)
91
89
  rack (>= 1.0, < 3)
92
90
  rails (6.0.3.6)
@@ -107,8 +105,8 @@ GEM
107
105
  rails-dom-testing (2.0.3)
108
106
  activesupport (>= 4.2.0)
109
107
  nokogiri (>= 1.6)
110
- rails-html-sanitizer (1.3.0)
111
- loofah (~> 2.3)
108
+ rails-html-sanitizer (1.5.0)
109
+ loofah (~> 2.19, >= 2.19.1)
112
110
  railties (6.0.3.6)
113
111
  actionpack (= 6.0.3.6)
114
112
  activesupport (= 6.0.3.6)
@@ -126,7 +124,7 @@ GEM
126
124
  sqlite3 (1.4.2)
127
125
  thor (1.1.0)
128
126
  thread_safe (0.3.6)
129
- tzinfo (1.2.9)
127
+ tzinfo (1.2.10)
130
128
  thread_safe (~> 0.1)
131
129
  websocket-driver (0.7.3)
132
130
  websocket-extensions (>= 0.1.0)
@@ -145,4 +143,4 @@ DEPENDENCIES
145
143
  sqlite3 (~> 1.4)
146
144
 
147
145
  BUNDLED WITH
148
- 2.1.4
146
+ 2.3.12
data/README.md CHANGED
@@ -54,7 +54,7 @@ The boring generator introduces following generators:
54
54
  - [Install CircleCI](https://www.boringgenerators.com/blog/2021-01-02-configure-circleci/): `rails generate boring:ci:circleci:install --repository_name=<name> --ruby_version=<version>`
55
55
  - [Install GitHub Actions](https://www.boringgenerators.com/blog/2020-12-17-configure-github-actions/): `rails generate boring:ci:github_action:install --repository_name=<name> --ruby_version=<version>`
56
56
  - Install Travis CI: `rails generate boring:ci:travisci:install --ruby_version=<version>`
57
- - Install Rubocop: `rails generate boring:rubocop:install --ruby_version=<version>`
57
+ - Install Rubocop: `rails generate boring:rubocop:install --ruby_version=<version> --test_gem=<test_framework_name>`
58
58
  - Build Favicon: `rails generate boring:favicon:build --application_name=<application_name> --favico_letter=<favico_letter> --primary_color=<color>`
59
59
  - Install Pundit: `rails generate boring:pundit:install`
60
60
  - Install GraphQL: `rails generate boring:graphql:install`
@@ -67,6 +67,14 @@ The boring generator introduces following generators:
67
67
  - Install Twilio: `rails generate boring:twilio:install`
68
68
  - Install Ahoy: `rails generate boring:ahoy:install`
69
69
  - Install Stripe: `rails generate boring:payments:stripe:install`
70
+ - Install Stimulus: `rails generate boring:stimulus:install`
71
+ - Install Rails Admin: `rails generate boring:rails_admin:install`
72
+ - Install Paper Trail: `rails generate boring:paper_trail:install`
73
+ - Install Flipper: `rails generate boring:flipper:install`
74
+ - Install RSpec: `rails generate boring:rspec:install`
75
+ - Install FactoryBot: `rails generate boring:factory_bot:install`
76
+ - Install Faker: `rails generate boring:faker:install`
77
+ - Install Overcommit with RuboCop: `rails generate boring:overcommit:pre_commit:rubocop:install`
70
78
 
71
79
  ## Screencasts
72
80
 
@@ -1,3 +1,3 @@
1
1
  module BoringGenerators
2
- VERSION = "0.10.0"
2
+ VERSION = "0.12.0"
3
3
  end
@@ -8,7 +8,7 @@ module Boring
8
8
 
9
9
  def add_bootstrap_package
10
10
  say "Adding bootstrap packages", :green
11
- run "yarn add bootstrap jquery popper.js"
11
+ run "yarn add bootstrap jquery @popperjs/core"
12
12
  end
13
13
 
14
14
  def add_jquery_plugin_provider_to_webpack_environment
@@ -48,6 +48,20 @@ module Boring
48
48
  \n
49
49
  import "bootstrap"
50
50
  import "stylesheets/application"
51
+ import { Tooltip, Popover } from "bootstrap"
52
+
53
+ document.addEventListener("turbolinks:load", () => {
54
+ // Both of these are from the Bootstrap 5 docs
55
+ var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
56
+ var tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) {
57
+ return new Tooltip(tooltipTriggerEl)
58
+ })
59
+
60
+ var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
61
+ var popoverList = popoverTriggerList.map(function(popoverTriggerEl) {
62
+ return new Popover(popoverTriggerEl)
63
+ })
64
+ })
51
65
  RUBY
52
66
  append_to_file "app/javascript/packs/application.js", application_js_content
53
67
  else
@@ -10,7 +10,7 @@ module Boring
10
10
  RUBY_VERSION_FILE = ".ruby-version"
11
11
 
12
12
  DEFAULT_RUBY_VERSION = ".ruby-version"
13
- DEFAULT_NODE_VERSION = "10.13.0"
13
+ DEFAULT_NODE_VERSION = "14"
14
14
  DEFAULT_REPOSITORY_NAME = "boring_generators"
15
15
 
16
16
  class_option :ruby_version, type: :string, aliases: "-v",
@@ -1,5 +1,9 @@
1
1
  name: CI
2
- on: [push]
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+ pull_request:
6
+ branches: [ main ]
3
7
  jobs:
4
8
  test:
5
9
  name: Tests
@@ -10,8 +14,9 @@ jobs:
10
14
  env:
11
15
  POSTGRES_USER: <%= @repository_name %>
12
16
  POSTGRES_DB: <%= "#{@repository_name}_test" %>
13
- POSTGRES_PASSWORD: ""
17
+ POSTGRES_PASSWORD: postgres
14
18
  ports: ["5432:5432"]
19
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
15
20
 
16
21
  steps:
17
22
  - name: Checkout code
@@ -25,6 +30,8 @@ jobs:
25
30
  uses: actions/setup-node@v1
26
31
  with:
27
32
  node-version: <%= @node_version %>
33
+ - name: Install library for postgres
34
+ run: sudo apt-get install libpq-dev
28
35
  - name: Find yarn cache location
29
36
  id: yarn-cache
30
37
  run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -43,7 +50,13 @@ jobs:
43
50
  RAILS_ENV: test
44
51
  PGHOST: localhost
45
52
  PGUSER: <%= @repository_name %>
53
+ PGPASSWORD: postgres
46
54
  run: |
47
55
  bin/rails db:setup
48
56
  - name: Run tests
57
+ env:
58
+ RAILS_ENV: test
59
+ PGHOST: localhost
60
+ PGUSER: <%= @repository_name %>
61
+ PGPASSWORD: postgres
49
62
  run: bundle exec rails test # TODO: Update the test runner command as per your requirement.
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boring
4
+ module FactoryBot
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Adds FactoryBot to the application"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ class_option :skip_factory, type: :boolean, aliases: "-s",
10
+ desc: "Skips adding sample factory"
11
+ class_option :skip_faker, type: :boolean, aliases: "-s",
12
+ desc: "Skips faker install"
13
+
14
+ def add_factory_bot_gem
15
+ log :adding, "FactoryBot"
16
+ Bundler.with_unbundled_env do
17
+ run "bundle add factory_bot_rails --group='developement,test'"
18
+ end
19
+ end
20
+
21
+ def add_sample_factory
22
+ return if options[:skip_factory]
23
+
24
+ log :adding, "Sample users factory"
25
+ copy_file "users.rb", "test/factories/users.rb"
26
+ end
27
+
28
+ def add_factory_bot_helper_method
29
+ log :adding, "factory_bot helper"
30
+ data = <<~RUBY
31
+ include FactoryBot::Syntax::Methods
32
+ RUBY
33
+
34
+ inject_into_file "test/test_helper.rb", optimize_indentation(data, 2),
35
+ after: /ActiveSupport::TestCase*\n/,
36
+ verbose: false
37
+ end
38
+
39
+ def add_faker_gem
40
+ return if options[:skip_faker]
41
+
42
+ Rails::Command.invoke :generate, ["boring:faker:install"]
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ FactoryBot.define do
4
+ factory :user do
5
+ email { "boring+generators@example.com" }
6
+ password { "boring+generators" }
7
+ end
8
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boring
4
+ module Faker
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Adds Faker to the application"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ def add_faker_gem
10
+ log :adding, "faker"
11
+ Bundler.with_unbundled_env do
12
+ run "bundle add faker --group='developement,test'"
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boring
4
+ module Flipper
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Adds Active Record Flipper to the application"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ def add_flipper_gem
10
+ say "Adding Flipper gem", :green
11
+ Bundler.with_unbundled_env do
12
+ run "bundle add flipper-active_record flipper-ui"
13
+ end
14
+ end
15
+
16
+ def run_flipper_active_record_generator
17
+ say "Running Active Record Flipper generator", :green
18
+ Bundler.with_unbundled_env do
19
+ run "bundle exec rails generate flipper:active_record"
20
+ run "bundle exec rails db:migrate"
21
+ end
22
+ end
23
+
24
+ def add_flipper_initializer
25
+ say "Adding Flipper initializer", :green
26
+ copy_file "initializer.rb", "config/initializers/flipper.rb"
27
+ end
28
+
29
+ def add_flipper_routes
30
+ say "Adding Flipper UI routes", :green
31
+ route <<~ROUTE
32
+ mount Flipper::UI.app(Flipper) => '/admins/flipper'
33
+ ROUTE
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,19 @@
1
+ require 'flipper/ui'
2
+ require "flipper/adapters/active_record"
3
+
4
+ Flipper::UI.configure do |config|
5
+ if Rails.env.production?
6
+ config.banner_text = "Production Environment"
7
+ else
8
+ config.banner_text = "Non-Production Environment"
9
+ config.banner_class = "primary"
10
+ end
11
+
12
+ config.fun = false
13
+ config.cloud_recommendation = false
14
+ end
15
+
16
+ # - Define All Actor here -
17
+ Flipper.register(:admins) do |actor, context|
18
+ actor.respond_to?(:admin?) && actor.admin?
19
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler'
4
+
5
+ module Boring
6
+ module Overcommit
7
+ class BaseGenerator < Rails::Generators::Base
8
+ desc "Adds and configures overcommit gem in the application"
9
+
10
+ class_option :skip_configuration,
11
+ type: :boolean, aliases: "-s",
12
+ desc: "Skips adding overcommit development configuration"
13
+
14
+ def add_overcommit_gem
15
+ say "Adding overcommit gem", :green
16
+
17
+ if overcommit_gem_exists?
18
+ say "Overcommit gem is already installed!", :yellow
19
+ else
20
+ Bundler.with_unbundled_env do
21
+ run "bundle add overcommit --group development,test"
22
+ end
23
+ end
24
+ end
25
+
26
+ def add_git_hooks_with_overcommit
27
+ return if options[:skip_configuration]
28
+
29
+ say "\nInstalling git hooks to your project", :green
30
+
31
+ Bundler.with_unbundled_env do
32
+ run "bundle exec overcommit --install"
33
+ end
34
+ end
35
+
36
+ private
37
+
38
+ def overcommit_gem_exists?
39
+ gem_file_content_array = File.readlines("Gemfile")
40
+
41
+ gem_file_content_array.any? { |line| line.include?("overcommit") }
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "generators/boring/overcommit/base_generator"
4
+
5
+ module Boring
6
+ module Overcommit
7
+ module PreCommit
8
+ module Rubocop
9
+ class InstallGenerator < Boring::Overcommit::BaseGenerator
10
+ DEFAULT_RUBY_VERSION = "2.7.1"
11
+
12
+ class_option :ruby_version, type: :string, aliases: "-v",
13
+ desc: "Tell us the ruby version you use for the application. Defaults to Ruby #{DEFAULT_RUBY_VERSION}"
14
+
15
+ def check_and_install_rubocop
16
+ return if rubocop_gem_exists?
17
+
18
+ say "\nRuboCop gem is not installed. Running the generator to install it!\n", :red
19
+
20
+ ruby_version = options[:ruby_version].presence || DEFAULT_RUBY_VERSION
21
+
22
+ run "bundle exec rails generate boring:rubocop:install --ruby_version=#{ruby_version}"
23
+ end
24
+
25
+ def configure_rubocop
26
+ say "\nAdding configurations for running RuboCop on pre-commit", :green
27
+
28
+ uncomment_lines(".overcommit.yml", /PreCommit:/)
29
+
30
+ gsub_file(".overcommit.yml", /PreCommit:/) do
31
+ <<~YAML
32
+ PreCommit:
33
+ RuboCop:
34
+ enabled: true
35
+ on_warn: fail # Treat all warnings as failures
36
+ problem_on_unmodified_line: ignore # run RuboCop only on modified code'
37
+ YAML
38
+ end
39
+ end
40
+
41
+ def enable_overcommit_configurations
42
+ say "\nEnabling new configurations", :green
43
+
44
+ run "git add .overcommit.yml"
45
+
46
+ Bundler.with_unbundled_env do
47
+ run "bundle exec overcommit --sign"
48
+ end
49
+ end
50
+
51
+ private
52
+
53
+ def rubocop_gem_exists?
54
+ gem_file_content_array = File.readlines("Gemfile")
55
+
56
+ gem_file_content_array.any? { |line| line.include?("rubocop") }
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boring
4
+ module PaperTrail
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Adds paper trail to the application"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ class_option :skip_generator, type: :boolean, aliases: "-sg",
10
+ desc: "Skip running paper_trail install generator"
11
+ class_option :skip_user_track_config, type: :boolean, aliases: "-sutc",
12
+ desc: "Skip adding config for tracking devise user in paper_trail"
13
+
14
+ def add_bullet_gem
15
+ say "Adding paper trail gems", :green
16
+ Bundler.with_unbundled_env do
17
+ run "bundle add paper_trail"
18
+ end
19
+ end
20
+
21
+ def run_paper_trail_generator
22
+ return if options[:skip_generator]
23
+
24
+ say "Running rails_admin generator", :green
25
+ Bundler.with_unbundled_env do
26
+ run "DISABLE_SPRING=1 bundle exec rails generate paper_trail:install --with-changes"
27
+ end
28
+ end
29
+
30
+ def set_configuration_to_track_whodunnit
31
+ return if options[:skip_user_track_config]
32
+
33
+ say "Setting configuration to track devise current_user", :green
34
+ insert_into_file "app/controllers/application_controller.rb", <<~RUBY, after: /class ApplicationController < ActionController::Base/
35
+ \tbefore_action :set_paper_trail_whodunnit
36
+ RUBY
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boring
4
+ module RailsAdmin
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Adds rails_admin to the application"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ class_option :skip_generator, type: :boolean, aliases: "-sg",
10
+ desc: "Skip running rails_admin install generator"
11
+ class_option :route_name, type: :string, aliases: "-r",
12
+ desc: "Mount the rails_admin engine on route"
13
+
14
+ def add_rails_admin_ruby_gem
15
+ say "Adding rails_admin gem", :green
16
+ Bundler.with_unbundled_env do
17
+ run "bundle add rails_admin"
18
+ end
19
+ end
20
+
21
+ def run_rails_admin_generator
22
+ return if options[:skip_generator]
23
+ if options[:route_name].present?
24
+ say "Running rails_admin generator", :green
25
+ Bundler.with_unbundled_env do
26
+ run "DISABLE_SPRING=1 bundle exec rails generate rails_admin:install #{options[:route_name]}"
27
+ end
28
+ else
29
+ say <<~WARNING, :red
30
+ ERROR: Please specify the --route_name=<name> where you want to mount the rails_admin engine
31
+ WARNING
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boring
4
+ module Rspec
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Adds RSpec to the application"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ class_option :skip_factory_bot, type: :boolean, aliases: "-sfb",
10
+ desc: "Skips installing factory bot"
11
+ class_option :skip_faker, type: :boolean, aliases: "-sf",
12
+ desc: "Skips faker install"
13
+
14
+ def add_rspec_gem
15
+ log :adding, "rspec-rails"
16
+ Bundler.with_unbundled_env do
17
+ run "bundle add rspec-rails --group='developement,test'"
18
+ end
19
+ end
20
+
21
+ def run_rspec_active_record_generator
22
+ log :running, "rspec generator"
23
+ Bundler.with_unbundled_env do
24
+ run "rails generate rspec:install"
25
+ end
26
+ end
27
+
28
+ def add_rspec_initializer
29
+ log :override, "test_framework to rspec"
30
+ environment <<~end_of_config
31
+ config.generators do |g|
32
+ g.test_framework :rspec
33
+ end
34
+ end_of_config
35
+ end
36
+
37
+ def add_factory_bot
38
+ return if options[:skip_factory_bot]
39
+
40
+ Rails::Command.invoke :generate, ["boring:factory_bot:install"]
41
+ end
42
+
43
+ def add_faker_gem
44
+ return if options[:skip_faker]
45
+
46
+ Rails::Command.invoke :generate, ["boring:faker:install"]
47
+ end
48
+ end
49
+ end
50
+ end
@@ -9,20 +9,24 @@ module Boring
9
9
  DEFAULT_RUBY_VERSION = "2.7.1"
10
10
 
11
11
  class_option :skip_adding_rubocop_rules, type: :boolean, aliases: "-s",
12
- desc: "Skip adding rubocop rules and add empty file."
13
- class_option :ruby_version, type: :string, aliases: "-v",
14
- desc: "Tell us the ruby version which you use for the application. Default to Ruby #{DEFAULT_RUBY_VERSION}"
12
+ desc: "Skip adding rubocop rules and add empty file."
13
+ class_option :ruby_version, type: :string, aliases: "-v",
14
+ desc: "Tell us the ruby version which you use for the application. Default to Ruby #{DEFAULT_RUBY_VERSION}", default: DEFAULT_RUBY_VERSION
15
+ class_option :test_gem, type: :string,
16
+ desc: "Tell us the framework you use for writing tests in your application. Supported options are ['rspec', 'minitest']"
15
17
 
16
18
  def add_rubocop_gems
17
19
  say "Adding rubocop gems", :green
18
- bullet_gem_content = <<~RUBY
20
+ rubocop_gem_content = <<~RUBY
19
21
  \n
20
22
  \t# A Ruby static code analyzer, based on the community Ruby style guide
21
23
  \tgem "rubocop", require: false
22
24
  \tgem "rubocop-rails", require: false
23
25
  \tgem "rubocop-performance", require: false
26
+ \tgem "rubocop-rake", require: false
27
+ #{rubocop_test_gem_content}
24
28
  RUBY
25
- insert_into_file "Gemfile", bullet_gem_content, after: /group :development do/
29
+ insert_into_file "Gemfile", rubocop_gem_content, after: /group :development do/
26
30
  Bundler.with_unbundled_env do
27
31
  run "bundle install"
28
32
  end
@@ -31,9 +35,31 @@ module Boring
31
35
  def add_rails_prefered_rubocop_rules
32
36
  say "Adding rubocop style guides", :green
33
37
  @skip_adding_rules = options[:skip_adding_rubocop_rules]
34
- @target_ruby_version = options[:ruby_version] ? options[:ruby_version] : DEFAULT_RUBY_VERSION
38
+ @target_ruby_version = options[:ruby_version]
35
39
  template(".rubocop.yml", ".rubocop.yml")
36
40
  end
41
+
42
+ private
43
+
44
+ def rubocop_test_gem_content
45
+ test_gem = options[:test_gem]
46
+
47
+ return if test_gem.blank?
48
+
49
+ if %w[rspec minitest].exclude?(test_gem)
50
+ raise(NotImplementedError, "#{test_gem} is not supported as a test_gem option! Supported options are ['rspec', 'minitest']")
51
+ end
52
+
53
+ if test_gem.eql?('rspec')
54
+ @test_gem_extension = 'rubocop-rspec'
55
+
56
+ "\tgem \"rubocop-rspec\", require: false"
57
+ else
58
+ @test_gem_extension = 'rubocop-minitest'
59
+
60
+ "\tgem \"rubocop-minitest\", require: false"
61
+ end
62
+ end
37
63
  end
38
64
  end
39
65
  end
@@ -1,8 +1,12 @@
1
1
  require:
2
2
  - rubocop-performance
3
3
  - rubocop-rails
4
+ - rubocop-rake
5
+ <%- if @test_gem_extension -%>
6
+ - <%= @test_gem_extension %>
7
+ <%- end -%>
4
8
 
5
- <%- unless @skip_adding_rules %>
9
+ <%- unless @skip_adding_rules -%>
6
10
  AllCops:
7
11
  TargetRubyVersion: <%= @target_ruby_version %>
8
12
  # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
@@ -258,5 +262,4 @@ Performance/DeletePrefix:
258
262
 
259
263
  Performance/DeleteSuffix:
260
264
  Enabled: true
261
-
262
- <% end %>
265
+ <%- end -%>
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boring
4
+ module Stimulus
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Adds Stimulus to the application"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ def add_stimulus_ruby_gem
10
+ say "Adding Stimulus gem", :green
11
+ Bundler.with_unbundled_env do
12
+ run "bundle add stimulus-rails"
13
+ end
14
+ end
15
+
16
+ def generating_devise_defaults
17
+ say "Generating stimulus defaults", :green
18
+ Bundler.with_unbundled_env do
19
+ run "DISABLE_SPRING=1 bundle exec rails stimulus:install"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1295,9 +1295,9 @@ babel-plugin-macros@^2.8.0:
1295
1295
  resolve "^1.12.0"
1296
1296
 
1297
1297
  balanced-match@^1.0.0:
1298
- version "1.0.0"
1299
- resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
1300
- integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
1298
+ version "1.0.2"
1299
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
1300
+ integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
1301
1301
 
1302
1302
  base64-js@^1.0.2:
1303
1303
  version "1.5.1"
@@ -1470,31 +1470,21 @@ browserify-zlib@^0.2.0:
1470
1470
  dependencies:
1471
1471
  pako "~1.0.5"
1472
1472
 
1473
- browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.0, browserslist@^4.6.4:
1474
- version "4.16.1"
1475
- resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.1.tgz#bf757a2da376b3447b800a16f0f1c96358138766"
1476
- integrity sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA==
1473
+ browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.16.0, browserslist@^4.6.4:
1474
+ version "4.16.6"
1475
+ resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2"
1476
+ integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==
1477
1477
  dependencies:
1478
- caniuse-lite "^1.0.30001173"
1479
- colorette "^1.2.1"
1480
- electron-to-chromium "^1.3.634"
1478
+ caniuse-lite "^1.0.30001219"
1479
+ colorette "^1.2.2"
1480
+ electron-to-chromium "^1.3.723"
1481
1481
  escalade "^3.1.1"
1482
- node-releases "^1.1.69"
1483
-
1484
- browserslist@^4.12.0:
1485
- version "4.14.0"
1486
- resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.0.tgz#2908951abfe4ec98737b72f34c3bcedc8d43b000"
1487
- integrity sha512-pUsXKAF2lVwhmtpeA3LJrZ76jXuusrNyhduuQs7CDFf9foT4Y38aQOserd2lMe5DSSrjf3fx34oHwryuvxAUgQ==
1488
- dependencies:
1489
- caniuse-lite "^1.0.30001111"
1490
- electron-to-chromium "^1.3.523"
1491
- escalade "^3.0.2"
1492
- node-releases "^1.1.60"
1482
+ node-releases "^1.1.71"
1493
1483
 
1494
1484
  buffer-from@^1.0.0:
1495
- version "1.1.1"
1496
- resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
1497
- integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
1485
+ version "1.1.2"
1486
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
1487
+ integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
1498
1488
 
1499
1489
  buffer-xor@^1.0.3:
1500
1490
  version "1.0.3"
@@ -1634,15 +1624,10 @@ caniuse-api@^3.0.0:
1634
1624
  lodash.memoize "^4.1.2"
1635
1625
  lodash.uniq "^4.5.0"
1636
1626
 
1637
- caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001173:
1638
- version "1.0.30001173"
1639
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001173.tgz#3c47bbe3cd6d7a9eda7f50ac016d158005569f56"
1640
- integrity sha512-R3aqmjrICdGCTAnSXtNyvWYMK3YtV5jwudbq0T7nN9k4kmE4CBuwPqyJ+KBzepSTh0huivV2gLbSMEzTTmfeYw==
1641
-
1642
- caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001111:
1643
- version "1.0.30001116"
1644
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001116.tgz#f3a3dea347f9294a3bdc4292309039cc84117fb8"
1645
- integrity sha512-f2lcYnmAI5Mst9+g0nkMIznFGsArRmZ0qU+dnq8l91hymdc2J3SFbiPhOJEeDqC1vtE8nc1qNQyklzB8veJefQ==
1627
+ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219:
1628
+ version "1.0.30001230"
1629
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71"
1630
+ integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==
1646
1631
 
1647
1632
  case-sensitive-paths-webpack-plugin@^2.3.0:
1648
1633
  version "2.3.0"
@@ -1806,9 +1791,9 @@ color-name@^1.0.0:
1806
1791
  integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
1807
1792
 
1808
1793
  color-string@^1.5.4:
1809
- version "1.5.4"
1810
- resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.4.tgz#dd51cd25cfee953d138fe4002372cc3d0e504cb6"
1811
- integrity sha512-57yF5yt8Xa3czSEW1jfQDE79Idk0+AkN/4KWad6tbdxUmAs3MvjxlWSWD4deYytcRfoZ9nhKyFl1kj5tBvidbw==
1794
+ version "1.9.0"
1795
+ resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.0.tgz#63b6ebd1bec11999d1df3a79a7569451ac2be8aa"
1796
+ integrity sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==
1812
1797
  dependencies:
1813
1798
  color-name "^1.0.0"
1814
1799
  simple-swizzle "^0.2.2"
@@ -1821,10 +1806,10 @@ color@^3.0.0:
1821
1806
  color-convert "^1.9.1"
1822
1807
  color-string "^1.5.4"
1823
1808
 
1824
- colorette@^1.2.1:
1825
- version "1.2.1"
1826
- resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
1827
- integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
1809
+ colorette@^1.2.1, colorette@^1.2.2:
1810
+ version "1.2.2"
1811
+ resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
1812
+ integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
1828
1813
 
1829
1814
  combined-stream@^1.0.6, combined-stream@~1.0.6:
1830
1815
  version "1.0.8"
@@ -1862,7 +1847,7 @@ compression-webpack-plugin@^4.0.0:
1862
1847
  concat-map@0.0.1:
1863
1848
  version "0.0.1"
1864
1849
  resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
1865
- integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
1850
+ integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
1866
1851
 
1867
1852
  concat-stream@^1.5.0:
1868
1853
  version "1.6.2"
@@ -2238,9 +2223,9 @@ decamelize@^1.1.2, decamelize@^1.2.0:
2238
2223
  integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
2239
2224
 
2240
2225
  decode-uri-component@^0.2.0:
2241
- version "0.2.0"
2242
- resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
2243
- integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
2226
+ version "0.2.2"
2227
+ resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
2228
+ integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
2244
2229
 
2245
2230
  define-properties@^1.1.3:
2246
2231
  version "1.1.3"
@@ -2359,15 +2344,10 @@ ecc-jsbn@~0.1.1:
2359
2344
  jsbn "~0.1.0"
2360
2345
  safer-buffer "^2.1.0"
2361
2346
 
2362
- electron-to-chromium@^1.3.523:
2363
- version "1.3.538"
2364
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.538.tgz#15226638ee9db5d8e74f4c860cef6078d8e1e871"
2365
- integrity sha512-rlyYXLlOoZkJuvY4AJXUpP7CHRVtwZz311HPVoEO1UHo/kqDCsP1pNas0A9paZuPEiYGdLwrjllF2hs69NEaTw==
2366
-
2367
- electron-to-chromium@^1.3.634:
2368
- version "1.3.635"
2369
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.635.tgz#8d1591eeca6b257d380061a2c04f0b3cc6c9e33b"
2370
- integrity sha512-RRriZOLs9CpW6KTLmgBqyUdnY0QNqqWs0HOtuQGGEMizOTNNn1P7sGRBxARnUeLejOsgwjDyRqT3E/CSst02ZQ==
2347
+ electron-to-chromium@^1.3.723:
2348
+ version "1.3.739"
2349
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz#f07756aa92cabd5a6eec6f491525a64fe62f98b9"
2350
+ integrity sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A==
2371
2351
 
2372
2352
  elliptic@^6.5.3:
2373
2353
  version "6.5.4"
@@ -2471,11 +2451,6 @@ es-to-primitive@^1.2.1:
2471
2451
  is-date-object "^1.0.1"
2472
2452
  is-symbol "^1.0.2"
2473
2453
 
2474
- escalade@^3.0.2:
2475
- version "3.0.2"
2476
- resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.0.2.tgz#6a580d70edb87880f22b4c91d0d56078df6962c4"
2477
- integrity sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==
2478
-
2479
2454
  escalade@^3.1.1:
2480
2455
  version "3.1.1"
2481
2456
  resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
@@ -3542,9 +3517,9 @@ json-stringify-safe@~5.0.1:
3542
3517
  integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
3543
3518
 
3544
3519
  json5@^1.0.1:
3545
- version "1.0.1"
3546
- resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
3547
- integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
3520
+ version "1.0.2"
3521
+ resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
3522
+ integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==
3548
3523
  dependencies:
3549
3524
  minimist "^1.2.0"
3550
3525
 
@@ -3619,9 +3594,9 @@ loader-runner@^2.4.0:
3619
3594
  integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==
3620
3595
 
3621
3596
  loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0:
3622
- version "1.4.0"
3623
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
3624
- integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==
3597
+ version "1.4.2"
3598
+ resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3"
3599
+ integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==
3625
3600
  dependencies:
3626
3601
  big.js "^5.2.2"
3627
3602
  emojis-list "^3.0.0"
@@ -3874,16 +3849,16 @@ minimalistic-crypto-utils@^1.0.1:
3874
3849
  integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
3875
3850
 
3876
3851
  minimatch@^3.0.4, minimatch@~3.0.2:
3877
- version "3.0.4"
3878
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
3879
- integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
3852
+ version "3.0.8"
3853
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1"
3854
+ integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==
3880
3855
  dependencies:
3881
3856
  brace-expansion "^1.1.7"
3882
3857
 
3883
3858
  minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5:
3884
- version "1.2.5"
3885
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
3886
- integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
3859
+ version "1.2.7"
3860
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
3861
+ integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
3887
3862
 
3888
3863
  minipass-collect@^1.0.2:
3889
3864
  version "1.0.2"
@@ -4058,15 +4033,10 @@ node-libs-browser@^2.2.1:
4058
4033
  util "^0.11.0"
4059
4034
  vm-browserify "^1.0.1"
4060
4035
 
4061
- node-releases@^1.1.60:
4062
- version "1.1.60"
4063
- resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.60.tgz#6948bdfce8286f0b5d0e5a88e8384e954dfe7084"
4064
- integrity sha512-gsO4vjEdQaTusZAEebUWp2a5d7dF5DYoIpDG7WySnk7BuZDW+GPpHXoXXuYawRBr/9t5q54tirPz79kFIWg4dA==
4065
-
4066
- node-releases@^1.1.69:
4067
- version "1.1.69"
4068
- resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.69.tgz#3149dbde53b781610cd8b486d62d86e26c3725f6"
4069
- integrity sha512-DGIjo79VDEyAnRlfSqYTsy+yoHd2IOjJiKUozD2MV2D85Vso6Bug56mb9tT/fY5Urt0iqk01H7x+llAruDR2zA==
4036
+ node-releases@^1.1.71:
4037
+ version "1.1.72"
4038
+ resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe"
4039
+ integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==
4070
4040
 
4071
4041
  node-sass@^4.14.1:
4072
4042
  version "4.14.1"
@@ -4427,9 +4397,9 @@ path-key@^2.0.1:
4427
4397
  integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
4428
4398
 
4429
4399
  path-parse@^1.0.6:
4430
- version "1.0.6"
4431
- resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
4432
- integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
4400
+ version "1.0.7"
4401
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
4402
+ integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
4433
4403
 
4434
4404
  path-type@^1.0.0:
4435
4405
  version "1.1.0"
@@ -5149,19 +5119,10 @@ postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1:
5149
5119
  indexes-of "^1.0.1"
5150
5120
  uniq "^1.0.1"
5151
5121
 
5152
- postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.5, postcss@^7.0.6:
5153
- version "7.0.35"
5154
- resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24"
5155
- integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==
5156
- dependencies:
5157
- chalk "^2.4.2"
5158
- source-map "^0.6.1"
5159
- supports-color "^6.1.0"
5160
-
5161
- postcss@^7.0.32:
5162
- version "7.0.32"
5163
- resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.32.tgz#4310d6ee347053da3433db2be492883d62cec59d"
5164
- integrity sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==
5122
+ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6:
5123
+ version "7.0.36"
5124
+ resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb"
5125
+ integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==
5165
5126
  dependencies:
5166
5127
  chalk "^2.4.2"
5167
5128
  source-map "^0.6.1"
@@ -5260,9 +5221,9 @@ q@^1.1.2:
5260
5221
  integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
5261
5222
 
5262
5223
  qs@~6.5.2:
5263
- version "6.5.2"
5264
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
5265
- integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
5224
+ version "6.5.3"
5225
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
5226
+ integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==
5266
5227
 
5267
5228
  query-string@^4.1.0:
5268
5229
  version "4.3.4"
@@ -5793,9 +5754,9 @@ source-map-resolve@^0.5.0:
5793
5754
  urix "^0.1.0"
5794
5755
 
5795
5756
  source-map-support@~0.5.12, source-map-support@~0.5.19:
5796
- version "0.5.19"
5797
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
5798
- integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
5757
+ version "0.5.21"
5758
+ resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
5759
+ integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
5799
5760
  dependencies:
5800
5761
  buffer-from "^1.0.0"
5801
5762
  source-map "^0.6.0"
@@ -6161,9 +6122,9 @@ terser-webpack-plugin@^4.0.0:
6161
6122
  webpack-sources "^1.4.3"
6162
6123
 
6163
6124
  terser@^4.1.2:
6164
- version "4.8.0"
6165
- resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17"
6166
- integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==
6125
+ version "4.8.1"
6126
+ resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f"
6127
+ integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==
6167
6128
  dependencies:
6168
6129
  commander "^2.20.0"
6169
6130
  source-map "~0.6.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boring_generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abhay Nikam
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -37,6 +37,7 @@ files:
37
37
  - ".github/FUNDING.yml"
38
38
  - ".github/PULL_REQUEST_TEMPLATE.md"
39
39
  - ".github/workflows/ci.yml"
40
+ - ".github/workflows/codeql-analysis.yml"
40
41
  - ".gitignore"
41
42
  - CHANGELOG.md
42
43
  - CODE_OF_CONDUCT.md
@@ -72,8 +73,13 @@ files:
72
73
  - lib/generators/boring/ci/travisci/install/install_generator.rb
73
74
  - lib/generators/boring/ci/travisci/install/templates/.travis.yml.tt
74
75
  - lib/generators/boring/devise/install/install_generator.rb
76
+ - lib/generators/boring/factory_bot/install/install_generator.rb
77
+ - lib/generators/boring/factory_bot/install/templates/users.rb
78
+ - lib/generators/boring/faker/install/install_generator.rb
75
79
  - lib/generators/boring/favicon/build/build_generator.rb
76
80
  - lib/generators/boring/favicon/build/templates/favicon.html.erb.tt
81
+ - lib/generators/boring/flipper/install/install_generator.rb
82
+ - lib/generators/boring/flipper/install/templates/initializer.rb.tt
77
83
  - lib/generators/boring/font_awesome/ruby_gem/install/install_generator.rb
78
84
  - lib/generators/boring/font_awesome/yarn/install/install_generator.rb
79
85
  - lib/generators/boring/font_awesome/yarn/install/templates/application.scss
@@ -95,6 +101,9 @@ files:
95
101
  - lib/generators/boring/oauth/twitter/install/install_generator.rb
96
102
  - lib/generators/boring/oauth/twitter/install/templates/README
97
103
  - lib/generators/boring/oauth/twitter/install/templates/omniauth_callbacks_controller.rb
104
+ - lib/generators/boring/overcommit/base_generator.rb
105
+ - lib/generators/boring/overcommit/pre_commit/rubocop/install/install_generator.rb
106
+ - lib/generators/boring/paper_trail/install/install_generator.rb
98
107
  - lib/generators/boring/payments/stripe/install/install_generator.rb
99
108
  - lib/generators/boring/payments/stripe/install/templates/README
100
109
  - lib/generators/boring/payments/stripe/install/templates/controllers/stripe/checkouts_controller.rb
@@ -104,9 +113,12 @@ files:
104
113
  - lib/generators/boring/pry/install/install_generator.rb
105
114
  - lib/generators/boring/pry/install/templates/pryrc
106
115
  - lib/generators/boring/pundit/install/install_generator.rb
116
+ - lib/generators/boring/rails_admin/install/install_generator.rb
117
+ - lib/generators/boring/rspec/install/install_generator.rb
107
118
  - lib/generators/boring/rubocop/install/install_generator.rb
108
119
  - lib/generators/boring/rubocop/install/templates/.rubocop.yml.tt
109
120
  - lib/generators/boring/simple_form/install/install_generator.rb
121
+ - lib/generators/boring/stimulus/install/install_generator.rb
110
122
  - lib/generators/boring/tailwind/install/install_generator.rb
111
123
  - lib/generators/boring/tailwind/install/templates/README
112
124
  - lib/generators/boring/tailwind/install/templates/application.scss
@@ -179,7 +191,6 @@ files:
179
191
  - tmp/templates/app_template/lib/assets/.keep
180
192
  - tmp/templates/app_template/lib/tasks/.keep
181
193
  - tmp/templates/app_template/log/.keep
182
- - tmp/templates/app_template/log/development.log
183
194
  - tmp/templates/app_template/node_modules/.bin/acorn
184
195
  - tmp/templates/app_template/node_modules/.bin/autoprefixer
185
196
  - tmp/templates/app_template/node_modules/.bin/browserslist
@@ -2600,7 +2611,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2600
2611
  - !ruby/object:Gem::Version
2601
2612
  version: '0'
2602
2613
  requirements: []
2603
- rubygems_version: 3.1.2
2614
+ rubygems_version: 3.2.33
2604
2615
  signing_key:
2605
2616
  specification_version: 4
2606
2617
  summary: Boring generators aims to make your development faster by delegating boring
@@ -1,72 +0,0 @@
1
-  (1.6ms) SELECT sqlite_version(*)
2
- ↳ test/generators/devise_install_generator_test.rb:3:in `require'
3
-  (0.1ms) begin transaction
4
- -------------------------------------------------------------------
5
- DeviseInstallGeneratorTest: test_should_install_devise_successfully
6
- -------------------------------------------------------------------
7
-  (0.1ms) rollback transaction
8
-  (2.0ms) SELECT sqlite_version(*)
9
- ↳ test/generators/devise_install_generator_test.rb:3:in `require'
10
-  (0.1ms) begin transaction
11
- -------------------------------------------------------------------
12
- DeviseInstallGeneratorTest: test_should_install_devise_successfully
13
- -------------------------------------------------------------------
14
-  (0.1ms) rollback transaction
15
-  (1.5ms) SELECT sqlite_version(*)
16
- ↳ test/generators/devise_install_generator_test.rb:3:in `require'
17
-  (0.1ms) begin transaction
18
- -------------------------------------------------------------------
19
- DeviseInstallGeneratorTest: test_should_install_devise_successfully
20
- -------------------------------------------------------------------
21
-  (0.1ms) rollback transaction
22
-  (0.9ms) SELECT sqlite_version(*)
23
- ↳ test/generators/devise_install_generator_test.rb:3:in `require'
24
-  (0.0ms) begin transaction
25
- ---------------------------------------------------------
26
- DeviseInstallGeneratorTest: test_should_skip_devise_model
27
- ---------------------------------------------------------
28
-  (0.1ms) rollback transaction
29
-  (0.0ms) begin transaction
30
- -------------------------------------------------------------------
31
- DeviseInstallGeneratorTest: test_should_install_devise_successfully
32
- -------------------------------------------------------------------
33
-  (0.1ms) rollback transaction
34
-  (0.0ms) begin transaction
35
- ---------------------------------------------------------
36
- DeviseInstallGeneratorTest: test_should_skip_devise_views
37
- ---------------------------------------------------------
38
-  (0.1ms) rollback transaction
39
-  (1.3ms) SELECT sqlite_version(*)
40
- ↳ test/generators/devise_install_generator_test.rb:3:in `require'
41
-  (0.0ms) begin transaction
42
- ---------------------------------------------------------
43
- DeviseInstallGeneratorTest: test_should_skip_devise_model
44
- ---------------------------------------------------------
45
-  (0.1ms) rollback transaction
46
-  (0.0ms) begin transaction
47
- -------------------------------------------------------------------
48
- DeviseInstallGeneratorTest: test_should_install_devise_successfully
49
- -------------------------------------------------------------------
50
-  (0.1ms) rollback transaction
51
-  (0.0ms) begin transaction
52
- ---------------------------------------------------------
53
- DeviseInstallGeneratorTest: test_should_skip_devise_views
54
- ---------------------------------------------------------
55
-  (0.1ms) rollback transaction
56
-  (0.9ms) SELECT sqlite_version(*)
57
- ↳ test/generators/devise_install_generator_test.rb:3:in `require'
58
-  (0.1ms) begin transaction
59
- -------------------------------------------------------------------
60
- DeviseInstallGeneratorTest: test_should_install_devise_successfully
61
- -------------------------------------------------------------------
62
-  (0.1ms) rollback transaction
63
-  (0.0ms) begin transaction
64
- ---------------------------------------------------------
65
- DeviseInstallGeneratorTest: test_should_skip_devise_views
66
- ---------------------------------------------------------
67
-  (0.1ms) rollback transaction
68
-  (0.1ms) begin transaction
69
- ---------------------------------------------------------
70
- DeviseInstallGeneratorTest: test_should_skip_devise_model
71
- ---------------------------------------------------------
72
-  (0.1ms) rollback transaction