boring_generators 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/lib/boring_generators/generator_helper.rb +14 -2
- data/lib/boring_generators/version.rb +1 -1
- data/lib/generators/boring/ci/gitlab_ci/install/install_generator.rb +120 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/README +10 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/capybara_helper.rb.tt +42 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/ci.yml.tt +94 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/database.yml.ci.tt +20 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/system_sample_spec.rb.tt +14 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/system_sample_test.rb.tt +13 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/unit_sample_spec.rb.tt +7 -0
- data/lib/generators/boring/ci/gitlab_ci/install/templates/unit_sample_test.rb.tt +7 -0
- data/lib/generators/boring/devise/install/install_generator.rb +35 -13
- data/lib/generators/boring/vcr/install/install_generator.rb +5 -4
- data/lib/generators/boring/vcr/install/templates/rspec/vcr.rb.tt +2 -1
- data/lib/generators/boring/webmock/install/install_generator.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a40221e1b2d89fde7e887f6f0b92f8d972548c000b363b4eab025f613844bc
|
4
|
+
data.tar.gz: c0f61c22deabdb64366d9d11b9e01f8cd6f09ca6b576f01342c0c455e70325ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65ac7ade20d72cc641bda7282f66fca33e330ff891fad2f4eaffce20914a0776e02e7afba1da2553308c54b56bd46362e1dd3c0c76ddae36c632013b72f36dc8
|
7
|
+
data.tar.gz: fc30ecc6102379477e7c05a97657318ed2e22560acf3098154a1da45d9d0ad2426677caa90a86e755b7a2080f0183be92f345aada6f89f8b39d923a61bbf4208
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -97,6 +97,7 @@ The boring generator introduces following generators:
|
|
97
97
|
- Install Rails ERD: `rails generate boring:rails_erd:install`
|
98
98
|
- Install Annotate: `rails generate boring:annotate:install`
|
99
99
|
- Install CanCanCan: `rails generate boring:cancancan:install`
|
100
|
+
- Install Gitlab CI: `rails generate boring:ci:gitlab_ci:install`
|
100
101
|
|
101
102
|
## Screencasts
|
102
103
|
|
@@ -3,9 +3,9 @@ module BoringGenerators
|
|
3
3
|
include Rails::Generators::Actions
|
4
4
|
|
5
5
|
def app_ruby_version
|
6
|
-
with_ruby_string =
|
6
|
+
with_ruby_string = File.read("Gemfile")[/^ruby\s+["']?([\d.]+)["']?/] || File.read(".ruby-version").strip
|
7
7
|
|
8
|
-
# only keep 3.3.0
|
8
|
+
# only keep 3.3.0 from ruby-3.3.0
|
9
9
|
with_ruby_string.gsub(/[^\d\.]/, "").squish
|
10
10
|
end
|
11
11
|
|
@@ -30,5 +30,17 @@ module BoringGenerators
|
|
30
30
|
|
31
31
|
bundle_install
|
32
32
|
end
|
33
|
+
|
34
|
+
def inject_into_file_if_new(*args)
|
35
|
+
file_name, content_to_add, = args
|
36
|
+
|
37
|
+
file_content = File.read(file_name)
|
38
|
+
|
39
|
+
content_exists = file_content.include?(content_to_add)
|
40
|
+
|
41
|
+
return if content_exists
|
42
|
+
|
43
|
+
inject_into_file *args
|
44
|
+
end
|
33
45
|
end
|
34
46
|
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "boring_generators/generator_helper"
|
4
|
+
|
5
|
+
module Boring
|
6
|
+
module Ci
|
7
|
+
module GitlabCi
|
8
|
+
class InstallGenerator < Rails::Generators::Base
|
9
|
+
desc "Adds Gitlab CI to the application"
|
10
|
+
source_root File.expand_path("templates", __dir__)
|
11
|
+
|
12
|
+
class_option :ruby_version,
|
13
|
+
aliases: "-rv",
|
14
|
+
type: :string,
|
15
|
+
desc:
|
16
|
+
"Ruby version used by your app. Defaults to .ruby_version or the version specified in your Gemfile."
|
17
|
+
class_option :app_test_framework,
|
18
|
+
aliases: "-tf",
|
19
|
+
type: :string,
|
20
|
+
enum: %w[minitest rspec],
|
21
|
+
default: "minitest",
|
22
|
+
desc:
|
23
|
+
"Tell us the test framework you use for the application. Defaults to Minitest."
|
24
|
+
class_option :environment_variable_manager,
|
25
|
+
aliases: "-evm",
|
26
|
+
type: :string,
|
27
|
+
enum: %w[rails_credentials dotenv figjam],
|
28
|
+
default: "rails_credentials",
|
29
|
+
desc:
|
30
|
+
"Tell us the environment variable manager you use. Defaults to Rails Credentials"
|
31
|
+
class_option :database,
|
32
|
+
aliases: "-d",
|
33
|
+
type: :string,
|
34
|
+
enum: %w[sqlite3 postgresql mysql],
|
35
|
+
default: "sqlite3",
|
36
|
+
desc: "Tell us the database you use in your app"
|
37
|
+
class_option :skip_sample_tests,
|
38
|
+
aliases: "-stt",
|
39
|
+
type: :boolean,
|
40
|
+
default: false,
|
41
|
+
desc:
|
42
|
+
"Skip sample tests. Useful when you are configuring Gitlab CI for existing Rails app"
|
43
|
+
|
44
|
+
include BoringGenerators::GeneratorHelper
|
45
|
+
|
46
|
+
def add_gitlab_ci_configurations
|
47
|
+
@ruby_version = options[:ruby_version] || app_ruby_version
|
48
|
+
@app_test_framework = options[:app_test_framework]
|
49
|
+
@environment_variable_manager = options[:environment_variable_manager]
|
50
|
+
@database = options[:database]
|
51
|
+
|
52
|
+
template("ci.yml", ".gitlab-ci.yml")
|
53
|
+
template("database.yml.ci", "config/database.yml.ci")
|
54
|
+
end
|
55
|
+
|
56
|
+
def add_gems_for_system_test
|
57
|
+
check_and_install_gem "capybara", group: :test
|
58
|
+
check_and_install_gem "selenium-webdriver", group: :test
|
59
|
+
end
|
60
|
+
|
61
|
+
def add_capybara_configurations
|
62
|
+
if options[:app_test_framework] == "minitest"
|
63
|
+
template("capybara_helper.rb", "test/helpers/capybara.rb")
|
64
|
+
|
65
|
+
inject_into_file_if_new "test/application_system_test_case.rb",
|
66
|
+
"require \"helpers/capybara\"\n",
|
67
|
+
before: "class ApplicationSystemTestCase"
|
68
|
+
gsub_file "test/application_system_test_case.rb",
|
69
|
+
/driven_by :selenium, using: :(?:chrome|headless_chrome).*\n/,
|
70
|
+
"driven_by :selenium_chrome_custom"
|
71
|
+
|
72
|
+
capybara_setup = <<-RUBY
|
73
|
+
\n
|
74
|
+
def setup
|
75
|
+
Capybara.server_host = "0.0.0.0" # bind to all interfaces
|
76
|
+
Capybara.server_port = 3000
|
77
|
+
|
78
|
+
if ENV["SELENIUM_REMOTE_URL"].present?
|
79
|
+
ip = Socket.ip_address_list.detect(&:ipv4_private?).ip_address
|
80
|
+
Capybara.app_host = "http://\#{ip}:\#{Capybara.server_port}"
|
81
|
+
end
|
82
|
+
|
83
|
+
super
|
84
|
+
end
|
85
|
+
RUBY
|
86
|
+
|
87
|
+
inject_into_file_if_new "test/application_system_test_case.rb",
|
88
|
+
optimize_indentation(
|
89
|
+
capybara_setup,
|
90
|
+
amount = 2
|
91
|
+
),
|
92
|
+
after: "driven_by :selenium_chrome_custom"
|
93
|
+
else
|
94
|
+
template("capybara_helper.rb", "spec/support/capybara.rb")
|
95
|
+
|
96
|
+
inject_into_file_if_new "spec/rails_helper.rb",
|
97
|
+
"require_relative \"./support/capybara\"\n\n",
|
98
|
+
before: "RSpec.configure do |config|"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def add_sample_tests
|
103
|
+
return if options[:skip_sample_tests]
|
104
|
+
|
105
|
+
if options[:app_test_framework] == "minitest"
|
106
|
+
template("unit_sample_test.rb", "test/models/sample_test.rb")
|
107
|
+
template("system_sample_test.rb", "test/system/sample_test.rb")
|
108
|
+
else
|
109
|
+
template("unit_sample_spec.rb", "spec/models/sample_spec.rb")
|
110
|
+
template("system_sample_spec.rb", "spec/system/sample_spec.rb")
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def show_readme
|
115
|
+
readme "README"
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
===============================================================================
|
3
|
+
|
4
|
+
You need to update your project's Gitlab CI variable configurations for the Gitlab CI to work correctly. Please take care of the following:
|
5
|
+
|
6
|
+
- Add your Gitlab personal access token under the variable `PRONTO_ACCESS_TOKEN`
|
7
|
+
- Copy your application's environment variables under `env` variable in CI/CD
|
8
|
+
- Add your Master Key required for decoding secret values under the variable `MASTER_KEY`
|
9
|
+
|
10
|
+
===============================================================================
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "selenium-webdriver"
|
2
|
+
|
3
|
+
Capybara.register_driver :selenium_chrome_custom do |app|
|
4
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
5
|
+
|
6
|
+
options.add_argument("--headless=new") unless ENV["SELENIUM_HEADFUL"]
|
7
|
+
|
8
|
+
options.add_argument("--window-size=1400,1400")
|
9
|
+
options.add_argument("--no-sandbox")
|
10
|
+
options.add_argument("--disable-dev-shm-usage")
|
11
|
+
|
12
|
+
remote_url = ENV.fetch("SELENIUM_REMOTE_URL", nil)
|
13
|
+
|
14
|
+
if remote_url
|
15
|
+
Capybara::Selenium::Driver.new(
|
16
|
+
app,
|
17
|
+
browser: :remote,
|
18
|
+
url: remote_url,
|
19
|
+
options:
|
20
|
+
)
|
21
|
+
else
|
22
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options:)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
<%- if @app_test_framework == "rspec" -%>
|
27
|
+
RSpec.configure do |config|
|
28
|
+
config.before(:each, type: :system, js: true) do
|
29
|
+
# Make the test app listen to outside requests, required for the remote Selenium instance
|
30
|
+
Capybara.server_host = "0.0.0.0"
|
31
|
+
Capybara.server_port = 3000
|
32
|
+
|
33
|
+
if ENV.fetch("SELENIUM_REMOTE_URL", nil)
|
34
|
+
# Use the application container's IP instead of localhost so Capybara knows where to direct Selenium
|
35
|
+
ip = Socket.ip_address_list.detect(&:ipv4_private?).ip_address
|
36
|
+
Capybara.app_host = "http://#{ip}:#{Capybara.server_port}"
|
37
|
+
end
|
38
|
+
|
39
|
+
driven_by :selenium_chrome_custom
|
40
|
+
end
|
41
|
+
end
|
42
|
+
<%- end -%>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
image: ruby:<%= @ruby_version %>
|
2
|
+
|
3
|
+
variables:
|
4
|
+
MASTER_KEY: $MASTER_KEY
|
5
|
+
|
6
|
+
cache:
|
7
|
+
paths:
|
8
|
+
- vendor/
|
9
|
+
<%- if File.exist?("package.json") -%>
|
10
|
+
- node_modules/
|
11
|
+
- yarn.lock
|
12
|
+
<%- end -%>
|
13
|
+
|
14
|
+
stages:
|
15
|
+
- test
|
16
|
+
|
17
|
+
.base_db:
|
18
|
+
<%- if @database == "postgresql" -%>
|
19
|
+
services:
|
20
|
+
- postgres:latest
|
21
|
+
<%- elsif @database == "mysql" -%>
|
22
|
+
services:
|
23
|
+
- mysql:latest
|
24
|
+
<%- end -%>
|
25
|
+
variables:
|
26
|
+
RAILS_ENV: test
|
27
|
+
<%- if @database == "postgresql" -%>
|
28
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
29
|
+
<%- end -%>
|
30
|
+
<%- if @database == "mysql" -%>
|
31
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: true
|
32
|
+
<%- end -%>
|
33
|
+
before_script:
|
34
|
+
- gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" --no-document
|
35
|
+
- bundle config set --local path 'vendor'
|
36
|
+
<%- if File.exist?("package.json") -%>
|
37
|
+
- apt-get update -qq && apt-get install -y -qq nodejs
|
38
|
+
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
39
|
+
- export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
40
|
+
- yarn install --pure-lockfile
|
41
|
+
<%- end -%>
|
42
|
+
<%- if @database == "sqlite3" -%>
|
43
|
+
- apt-get update && apt-get install --no-install-recommends -y sqlite3
|
44
|
+
<%- end -%>
|
45
|
+
- apt-get update && apt-get install --no-install-recommends -y cmake
|
46
|
+
- bundle install --jobs $(nproc)
|
47
|
+
- cp config/database.yml.ci config/database.yml
|
48
|
+
<%- if @environment_variable_manager == "dotenv" -%>
|
49
|
+
- cat $env > .env
|
50
|
+
<%- elsif @environment_variable_manager == "figjam" -%>
|
51
|
+
- cat $env > config/application.yml
|
52
|
+
<%- end -%>
|
53
|
+
- bundle exec rails db:test:prepare
|
54
|
+
|
55
|
+
unit_and_integration_tests:
|
56
|
+
extends: .base_db
|
57
|
+
stage: test
|
58
|
+
only:
|
59
|
+
- merge_requests
|
60
|
+
script:
|
61
|
+
<%- if @app_test_framework == "rspec" -%>
|
62
|
+
- bundle exec rspec --exclude-pattern "spec/system/**/*.rb"
|
63
|
+
<%- else -%>
|
64
|
+
- bundle exec rails test
|
65
|
+
<%- end -%>
|
66
|
+
|
67
|
+
system_tests:
|
68
|
+
extends: .base_db
|
69
|
+
stage: test
|
70
|
+
services:
|
71
|
+
- name: selenium/standalone-chrome:latest
|
72
|
+
alias: selenium
|
73
|
+
<%- if @database == "postgresql" -%>
|
74
|
+
- postgres:latest
|
75
|
+
<%- elsif @database == "mysql" -%>
|
76
|
+
- mysql:latest
|
77
|
+
<%- end -%>
|
78
|
+
variables:
|
79
|
+
RAILS_ENV: test
|
80
|
+
SELENIUM_REMOTE_URL: http://selenium:4444/wd/hub
|
81
|
+
only:
|
82
|
+
- merge_requests
|
83
|
+
script:
|
84
|
+
<%- if @app_test_framework == "rspec" -%>
|
85
|
+
- bundle exec rspec spec/system
|
86
|
+
<%- else -%>
|
87
|
+
- bundle exec rails test:system
|
88
|
+
<%- end -%>
|
89
|
+
artifacts:
|
90
|
+
when: on_failure
|
91
|
+
paths:
|
92
|
+
- log/test.log
|
93
|
+
- tmp/screenshots/
|
94
|
+
expire_in: 1 week
|
@@ -0,0 +1,20 @@
|
|
1
|
+
test:
|
2
|
+
<%- if @database == "postgresql" -%>
|
3
|
+
adapter: postgresql
|
4
|
+
encoding: unicode
|
5
|
+
host: postgres
|
6
|
+
username: postgres
|
7
|
+
<%- elsif @database == "mysql" -%>
|
8
|
+
adapter: mysql2
|
9
|
+
encoding: utf8mb4
|
10
|
+
host: mysql
|
11
|
+
username: root
|
12
|
+
socket: /tmp/mysql.sock
|
13
|
+
<%- else -%>
|
14
|
+
adapter: sqlite3
|
15
|
+
database: db/test.sqlite3
|
16
|
+
<%- end -%>
|
17
|
+
<%- unless @database == "sqlite3" -%>
|
18
|
+
database: ci_db
|
19
|
+
<%- end -%>
|
20
|
+
pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
|
3
|
+
RSpec.describe "Sample System Test", type: :system, js: true do
|
4
|
+
it "checks if the system test is configured correctly" do
|
5
|
+
visit rails_health_check_path
|
6
|
+
|
7
|
+
# expect page body to have green background
|
8
|
+
expect(
|
9
|
+
page.evaluate_script(
|
10
|
+
"window.getComputedStyle(document.body).backgroundColor"
|
11
|
+
)
|
12
|
+
).to eq("rgb(0, 128, 0)")
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "application_system_test_case"
|
2
|
+
|
3
|
+
class SampleTest < ApplicationSystemTestCase
|
4
|
+
test "checks if the system test is configured correctly" do
|
5
|
+
visit rails_health_check_path
|
6
|
+
|
7
|
+
# assert page body has green background
|
8
|
+
assert_equal "rgb(0, 128, 0)",
|
9
|
+
page.evaluate_script(
|
10
|
+
"window.getComputedStyle(document.body).backgroundColor"
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
@@ -7,21 +7,28 @@ module Boring
|
|
7
7
|
|
8
8
|
DEFAULT_DEVISE_MODEL_NAME = "User"
|
9
9
|
|
10
|
-
class_option :model_name,
|
11
|
-
|
12
|
-
|
10
|
+
class_option :model_name,
|
11
|
+
type: :string,
|
12
|
+
aliases: "-m",
|
13
|
+
desc:
|
14
|
+
"Tell us the user model name which will be used for authentication. Defaults to #{DEFAULT_DEVISE_MODEL_NAME}"
|
15
|
+
class_option :skip_devise_view,
|
16
|
+
type: :boolean,
|
17
|
+
aliases: "-sv",
|
13
18
|
desc: "Skip generating devise views"
|
14
|
-
class_option :skip_devise_model,
|
19
|
+
class_option :skip_devise_model,
|
20
|
+
type: :boolean,
|
21
|
+
aliases: "-sm",
|
15
22
|
desc: "Skip generating devise model"
|
16
|
-
class_option :run_db_migrate,
|
23
|
+
class_option :run_db_migrate,
|
24
|
+
type: :boolean,
|
25
|
+
aliases: "-rdm",
|
17
26
|
desc: "Run migrations after generating user table",
|
18
27
|
default: false
|
19
28
|
|
20
29
|
def add_devise_gem
|
21
30
|
say "Adding devise gem", :green
|
22
|
-
Bundler.with_unbundled_env
|
23
|
-
run "bundle add devise"
|
24
|
-
end
|
31
|
+
Bundler.with_unbundled_env { run "bundle add devise" }
|
25
32
|
end
|
26
33
|
|
27
34
|
def generating_devise_defaults
|
@@ -33,10 +40,12 @@ module Boring
|
|
33
40
|
|
34
41
|
def add_devise_action_mailer_development_config
|
35
42
|
say "Adding devise Action Mailer development configuration", :green
|
36
|
-
insert_into_file "config/environments/development.rb",
|
43
|
+
insert_into_file "config/environments/development.rb",
|
44
|
+
<<~RUBY,
|
37
45
|
\n
|
38
46
|
\tconfig.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
|
39
47
|
RUBY
|
48
|
+
after: /Rails.application.configure do/
|
40
49
|
end
|
41
50
|
|
42
51
|
def add_devise_user_model
|
@@ -48,13 +57,28 @@ module Boring
|
|
48
57
|
Bundler.with_unbundled_env do
|
49
58
|
run "DISABLE_SPRING=1 bundle exec rails generate devise #{model_name}"
|
50
59
|
end
|
60
|
+
|
61
|
+
# make the email unique
|
62
|
+
if File.exist?("test/fixtures/users.yml")
|
63
|
+
email_content = <<~FIXTURE
|
64
|
+
one:
|
65
|
+
email: example-$LABEL@email.com
|
66
|
+
FIXTURE
|
67
|
+
|
68
|
+
gsub_file "test/fixtures/users.yml",
|
69
|
+
/one: {}/,
|
70
|
+
optimize_indentation(email_content, 0)
|
71
|
+
end
|
51
72
|
end
|
52
73
|
|
53
74
|
def add_devise_authentication_filter_to_application_controller
|
54
|
-
insert_into_file "app/controllers/application_controller.rb",
|
75
|
+
insert_into_file "app/controllers/application_controller.rb",
|
76
|
+
<<~RUBY,
|
55
77
|
\n
|
56
78
|
\tbefore_action :authenticate_user!
|
57
79
|
RUBY
|
80
|
+
after:
|
81
|
+
/class ApplicationController < ActionController::Base/
|
58
82
|
end
|
59
83
|
|
60
84
|
def add_devise_views
|
@@ -71,9 +95,7 @@ module Boring
|
|
71
95
|
def run_db_migrate
|
72
96
|
return unless options[:run_db_migrate]
|
73
97
|
|
74
|
-
Bundler.with_unbundled_env
|
75
|
-
rails_command "db:migrate"
|
76
|
-
end
|
98
|
+
Bundler.with_unbundled_env { rails_command "db:migrate" }
|
77
99
|
end
|
78
100
|
end
|
79
101
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "boring_generators/generator_helper"
|
4
4
|
|
5
5
|
module Boring
|
6
6
|
module Vcr
|
7
7
|
class InstallGenerator < Rails::Generators::Base
|
8
8
|
include BoringGenerators::GeneratorHelper
|
9
|
-
|
9
|
+
|
10
10
|
desc "Adds VCR to the application"
|
11
11
|
source_root File.expand_path("templates", __dir__)
|
12
12
|
|
@@ -46,7 +46,7 @@ module Boring
|
|
46
46
|
|
47
47
|
def add_vcr_gem
|
48
48
|
say "Adding VCR gems to Gemfile", :green
|
49
|
-
|
49
|
+
|
50
50
|
check_and_install_gem "vcr", group: :test
|
51
51
|
end
|
52
52
|
|
@@ -83,9 +83,10 @@ module Boring
|
|
83
83
|
require "vcr"
|
84
84
|
|
85
85
|
VCR.configure do |c|
|
86
|
-
c.cassette_library_dir = "test/
|
86
|
+
c.cassette_library_dir = "test/vcr_cassettes"
|
87
87
|
c.hook_into #{format_stubbing_libraries}
|
88
88
|
c.ignore_localhost = true
|
89
|
+
c.allow_http_connections_when_no_cassette = true
|
89
90
|
end
|
90
91
|
RUBY
|
91
92
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
require "vcr"
|
2
2
|
|
3
3
|
VCR.configure do |c|
|
4
|
-
c.cassette_library_dir = "spec/
|
4
|
+
c.cassette_library_dir = "spec/vcr_cassettes"
|
5
5
|
c.hook_into <%= @stubbing_libraries %>
|
6
6
|
c.configure_rspec_metadata!
|
7
7
|
c.ignore_localhost = true
|
8
|
+
c.allow_http_connections_when_no_cassette = true
|
8
9
|
end
|
@@ -11,7 +11,7 @@ module Boring
|
|
11
11
|
|
12
12
|
SUPPORTED_TEST_FRAMEWORKS = %w[rspec minitest]
|
13
13
|
|
14
|
-
# can't use "test_framework" option which would be a good naming for this because it's being used by Rails::Generator::Base.
|
14
|
+
# can't use "test_framework" option which would be a good naming for this because it's being used by Rails::Generator::Base. Rails will override this value if we use test_framework so prefixing with "app_" here
|
15
15
|
class_option :app_test_framework,
|
16
16
|
type: :string,
|
17
17
|
desc: "Tell us the framework you use for writing tests in your application. Supported options are #{SUPPORTED_TEST_FRAMEWORKS}",
|
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.
|
4
|
+
version: 0.15.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: 2024-
|
11
|
+
date: 2024-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -74,6 +74,15 @@ files:
|
|
74
74
|
- lib/generators/boring/ci/circleci/install/templates/database.yml.ci.tt
|
75
75
|
- lib/generators/boring/ci/github_action/install/install_generator.rb
|
76
76
|
- lib/generators/boring/ci/github_action/install/templates/ci.yml.tt
|
77
|
+
- lib/generators/boring/ci/gitlab_ci/install/install_generator.rb
|
78
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/README
|
79
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/capybara_helper.rb.tt
|
80
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/ci.yml.tt
|
81
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/database.yml.ci.tt
|
82
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/system_sample_spec.rb.tt
|
83
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/system_sample_test.rb.tt
|
84
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/unit_sample_spec.rb.tt
|
85
|
+
- lib/generators/boring/ci/gitlab_ci/install/templates/unit_sample_test.rb.tt
|
77
86
|
- lib/generators/boring/ci/travisci/install/install_generator.rb
|
78
87
|
- lib/generators/boring/ci/travisci/install/templates/.travis.yml.tt
|
79
88
|
- lib/generators/boring/devise/doorkeeper/install/install_generator.rb
|