bankai 0.9.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +2 -2
- data/.ruby-version +1 -1
- data/.travis.yml +2 -2
- data/bankai.gemspec +1 -1
- data/lib/bankai/generator.rb +5 -5
- data/lib/bankai/generators/ci_generator.rb +2 -0
- data/lib/bankai/generators/deploy_generator.rb +1 -1
- data/lib/bankai/generators/json_generator.rb +1 -1
- data/lib/bankai/generators/lint_generator.rb +3 -3
- data/lib/bankai/generators/whenever_generator.rb +3 -3
- data/lib/bankai/version.rb +4 -4
- data/templates/Gemfile.erb +2 -1
- data/templates/README.md.erb +1 -1
- data/templates/gitlab-ci.yml.erb +39 -26
- data/templates/rubocop.yml.erb +6 -16
- data/templates/spec_helper.rb +4 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b6fed9ca466f370a660ab68887fd86ed521deee23993b3bf16034216bf0a963
|
4
|
+
data.tar.gz: 6a386b4f1147032589f722aa02abf440d6e8c586eef47a055172ba750fe306e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4da905cbcbc1ee8d8b88515aa02070f10b5868fade35639644110cb7d7571922ce8b3d5bf089f1d4f6fc218e0f0af3c7d307d5b284f480e4a7d90b448cd79dd
|
7
|
+
data.tar.gz: 2884f5f5b6da3057e4e28df69db47a5e346d0f2bf7b83ded9a611b4fc7a248ee1a271b8736057678eeb80c4c670edc7d5cf8f07cff430b387f5689dd3107b4b8
|
data/.gitlab-ci.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
image: ruby:2.
|
1
|
+
image: ruby:2.7.4
|
2
2
|
|
3
3
|
stages:
|
4
4
|
- lint
|
@@ -10,7 +10,7 @@ cache:
|
|
10
10
|
- vendor/ruby
|
11
11
|
|
12
12
|
.install_ruby_gems: &install_ruby_gems
|
13
|
-
- gem install bundler -v 2.
|
13
|
+
- gem install bundler -v 2.2.26
|
14
14
|
- bundle install --path vendor
|
15
15
|
|
16
16
|
before_script:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.4
|
data/.travis.yml
CHANGED
data/bankai.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.2.26'
|
31
31
|
spec.add_development_dependency 'bundler-audit'
|
32
32
|
spec.add_development_dependency 'overcommit'
|
33
33
|
spec.add_development_dependency 'rake', '~> 12.0'
|
data/lib/bankai/generator.rb
CHANGED
@@ -12,15 +12,15 @@ module Bankai
|
|
12
12
|
desc: 'Configure for selected database ' \
|
13
13
|
"(options: #{DATABASES.join('/')})"
|
14
14
|
|
15
|
+
class_option :capistrano, type: :boolean, default: false,
|
16
|
+
desc: 'Use Capistrano'
|
17
|
+
|
15
18
|
class_option :skip_test, type: :boolean, default: true,
|
16
19
|
desc: 'Skip test files'
|
17
20
|
|
18
21
|
class_option :skip_coffee, type: :boolean, default: true,
|
19
22
|
desc: "Don't use CoffeeScript"
|
20
23
|
|
21
|
-
class_option :skip_capistrano, type: :boolean, default: false,
|
22
|
-
desc: "Don't use Capistrano"
|
23
|
-
|
24
24
|
class_option :skip_rspec, type: :boolean, default: false,
|
25
25
|
desc: 'Skip rspec files'
|
26
26
|
|
@@ -68,11 +68,11 @@ module Bankai
|
|
68
68
|
def generate_default
|
69
69
|
run('spring stop')
|
70
70
|
generate('bankai:testing') unless options[:skip_rspec]
|
71
|
-
generate('bankai:ci')
|
71
|
+
generate('bankai:ci', options.api? ? '--api' : '')
|
72
72
|
generate('bankai:json')
|
73
73
|
generate('bankai:db_optimizations')
|
74
74
|
generate('bankai:mailer')
|
75
|
-
generate('bankai:deploy')
|
75
|
+
generate('bankai:deploy') if options[:capistrano]
|
76
76
|
generate('annotate:install')
|
77
77
|
generate('bankai:lint')
|
78
78
|
end
|
@@ -15,15 +15,15 @@ module Bankai
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def install_overcommit
|
18
|
-
|
18
|
+
execute_command :bundle, 'exec overcommit --install'
|
19
19
|
end
|
20
20
|
|
21
21
|
def rubocop_autocorrect
|
22
|
-
|
22
|
+
execute_command :bundle, 'exec rubocop --auto-correct-all'
|
23
23
|
end
|
24
24
|
|
25
25
|
def rubocop_todo
|
26
|
-
|
26
|
+
execute_command :bundle, 'exec rubocop --auto-gen-config'
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -8,12 +8,12 @@ module Bankai
|
|
8
8
|
class WheneverGenerator < Base
|
9
9
|
def add_whenever
|
10
10
|
gem 'whenever', require: false
|
11
|
-
|
12
|
-
|
11
|
+
execute_command :bundle, 'exec rubocop -a Gemfile'
|
12
|
+
execute_command :bundle, 'install'
|
13
13
|
end
|
14
14
|
|
15
15
|
def initialize_whenever
|
16
|
-
|
16
|
+
execute_command :bundle, "exec wheneverize #{destination_root}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def initialize_capistrano
|
data/lib/bankai/version.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Bankai
|
4
|
-
VERSION = '0.
|
5
|
-
RUBY_VERSION = '2.6.
|
4
|
+
VERSION = '0.12.0'
|
5
|
+
RUBY_VERSION = '2.6.7'
|
6
6
|
RAILS_VERSION = '5.2.0'
|
7
|
-
RUBOCOP_VERSION = '1.
|
8
|
-
CAPISTRANO_VERSION = '3.
|
7
|
+
RUBOCOP_VERSION = '1.9.1'
|
8
|
+
CAPISTRANO_VERSION = '3.16.0'
|
9
9
|
end
|
data/templates/Gemfile.erb
CHANGED
@@ -54,6 +54,7 @@ group :development, :test do
|
|
54
54
|
gem 'shoulda', require: false
|
55
55
|
gem 'shoulda-matchers', require: false
|
56
56
|
gem 'simplecov', require: false
|
57
|
+
gem 'simplecov-cobertura', require: false
|
57
58
|
<%- end -%>
|
58
59
|
|
59
60
|
gem 'bankai'
|
@@ -81,7 +82,7 @@ group :development do
|
|
81
82
|
<% end -%>
|
82
83
|
<% end -%>
|
83
84
|
|
84
|
-
<%
|
85
|
+
<% if options[:capistrano] -%>
|
85
86
|
gem 'capistrano', '<%= Bankai::CAPISTRANO_VERSION %>'
|
86
87
|
gem 'capistrano-bundler'
|
87
88
|
gem 'capistrano-rails'
|
data/templates/README.md.erb
CHANGED
data/templates/gitlab-ci.yml.erb
CHANGED
@@ -8,8 +8,10 @@ stages:
|
|
8
8
|
|
9
9
|
variables:
|
10
10
|
RAILS_ENV: test
|
11
|
+
<%- unless options.api? -%>
|
11
12
|
NODE_VERSION: 12.13.1
|
12
|
-
|
13
|
+
<%- end -%>
|
14
|
+
BUNDLER_VERSION: 2.2.26
|
13
15
|
<%- if pg? -%>
|
14
16
|
POSTGRES_DB: <%= app_name %>
|
15
17
|
POSTGRES_PASSWORD: postgres
|
@@ -26,11 +28,12 @@ variables:
|
|
26
28
|
.install_ruby_gems: &install_ruby_gems
|
27
29
|
- gem install bundler -v ${BUNDLER_VERSION}
|
28
30
|
- bundle install --path vendor
|
29
|
-
|
31
|
+
<% unless options.api? %>
|
30
32
|
.install_nodejs: &install_nodejs
|
31
33
|
- curl -SLO https://nodejs.org/dist/v$NODE_VERSION/node-v${NODE_VERSION}-linux-x64.tar.xz && tar -xJf node-v${NODE_VERSION}-linux-x64.tar.xz -C /usr/local --strip-components=1;
|
32
34
|
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
33
35
|
- export PATH=$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH
|
36
|
+
<% end -%>
|
34
37
|
|
35
38
|
.common:
|
36
39
|
before_script:
|
@@ -41,26 +44,34 @@ variables:
|
|
41
44
|
key:
|
42
45
|
files:
|
43
46
|
- Gemfile.lock
|
47
|
+
<%- unless options.api? -%>
|
44
48
|
- yarn.lock
|
49
|
+
<%- end -%>
|
45
50
|
paths:
|
46
51
|
- vendor/ruby
|
52
|
+
<% unless options.api? %>
|
47
53
|
- node_modules
|
54
|
+
<% end -%>
|
48
55
|
|
49
56
|
rubocop:
|
50
57
|
extends: .common
|
51
58
|
stage: lint
|
52
59
|
script:
|
53
60
|
- bundle exec rubocop
|
54
|
-
|
55
|
-
-
|
61
|
+
rules:
|
62
|
+
- if: $CI_MERGE_REQUEST_ID
|
56
63
|
|
57
64
|
brakeman:
|
58
|
-
|
65
|
+
image: registry.gitlab.com/gitlab-org/security-products/analyzers/brakeman:2
|
59
66
|
stage: lint
|
67
|
+
allow_failure: true
|
60
68
|
script:
|
61
|
-
-
|
62
|
-
|
63
|
-
|
69
|
+
- /analyzer run
|
70
|
+
artifacts:
|
71
|
+
reports:
|
72
|
+
sast: gl-sast-report.json
|
73
|
+
rules:
|
74
|
+
- if: $CI_MERGE_REQUEST_ID
|
64
75
|
|
65
76
|
bundler-audit:
|
66
77
|
extends: .common
|
@@ -69,10 +80,9 @@ bundler-audit:
|
|
69
80
|
- gem install bundler-audit
|
70
81
|
- bundle audit --update
|
71
82
|
- bundle audit
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
- Gemfile.lock
|
83
|
+
rules:
|
84
|
+
- if: $CI_MERGE_REQUEST_ID
|
85
|
+
- if: $CI_PIPELINE_SOURCE == 'schedule'
|
76
86
|
allow_failure: true
|
77
87
|
|
78
88
|
bundler-leak:
|
@@ -82,12 +92,10 @@ bundler-leak:
|
|
82
92
|
- gem install bundler-leak
|
83
93
|
- bundle leak check --update
|
84
94
|
- bundle leak
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
allow_failure: true
|
90
|
-
|
95
|
+
rules:
|
96
|
+
- if: $CI_MERGE_REQUEST_ID
|
97
|
+
- if: $CI_PIPELINE_SOURCE == 'schedule'
|
98
|
+
<% unless options.api? %>
|
91
99
|
yarn-audit:
|
92
100
|
extends: .common
|
93
101
|
stage: lint
|
@@ -95,20 +103,21 @@ yarn-audit:
|
|
95
103
|
- *install_nodejs
|
96
104
|
script:
|
97
105
|
- yarn audit
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
- package-lock.json
|
102
|
-
- yarn.lock
|
106
|
+
rules:
|
107
|
+
- if: $CI_MERGE_REQUEST_ID
|
108
|
+
- if: $CI_PIPELINE_SOURCE == 'schedule'
|
103
109
|
allow_failure: true
|
110
|
+
<% end -%>
|
104
111
|
|
105
112
|
rspec:
|
106
113
|
extends: .common
|
107
114
|
stage: test
|
108
115
|
before_script:
|
109
|
-
- *install_nodejs
|
110
116
|
- *install_ruby_gems
|
117
|
+
<%- unless options.api? -%>
|
118
|
+
- *install_nodejs
|
111
119
|
- yarn install
|
120
|
+
<%- end -%>
|
112
121
|
services:
|
113
122
|
<%- if pg? -%>
|
114
123
|
- postgres:12-alpine
|
@@ -120,5 +129,9 @@ rspec:
|
|
120
129
|
script:
|
121
130
|
- bundle exec rake db:migrate
|
122
131
|
- bundle exec rspec
|
123
|
-
|
124
|
-
-
|
132
|
+
rules:
|
133
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
134
|
+
- if: $CI_MERGE_REQUEST_ID
|
135
|
+
artifacts:
|
136
|
+
reports:
|
137
|
+
cobertura: coverage/coverage.xml
|
data/templates/rubocop.yml.erb
CHANGED
@@ -3,34 +3,24 @@ require:
|
|
3
3
|
- rubocop-rails
|
4
4
|
- rubocop-rspec
|
5
5
|
|
6
|
+
inherit_mode:
|
7
|
+
merge:
|
8
|
+
- Exclude
|
9
|
+
|
6
10
|
AllCops:
|
11
|
+
NewCops: enable
|
7
12
|
TargetRubyVersion: <%= RUBY_VERSION %>
|
8
13
|
DisplayCopNames: true
|
9
14
|
SuggestExtensions: false
|
10
15
|
Exclude:
|
11
|
-
- bin/*
|
12
16
|
- vendor/ruby/**/*
|
13
17
|
- node_modules/**/*
|
14
|
-
- db/schema.rb
|
15
18
|
- .licenses/**/*
|
16
19
|
Rails:
|
17
20
|
Enabled: true
|
18
|
-
Rails/UnknownEnv:
|
19
|
-
Environments:
|
20
|
-
- production
|
21
|
-
- staging
|
22
|
-
- development
|
23
|
-
- test
|
24
|
-
Metrics:
|
25
|
-
Exclude:
|
26
|
-
- db/migrate/*
|
27
|
-
- Rakefile
|
28
|
-
- Gemfile
|
29
|
-
- config/**/*
|
30
|
-
- spec/**/*
|
31
|
-
- lib/tasks/**/*
|
32
21
|
Metrics/BlockLength:
|
33
22
|
Exclude:
|
23
|
+
- db/migrate/*
|
34
24
|
- config/environments/*
|
35
25
|
- lib/tasks/**/*
|
36
26
|
- spec/**/*
|
data/templates/spec_helper.rb
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
if ENV.fetch('COVERAGE', false) || ENV.fetch('CI', false)
|
4
4
|
require 'simplecov'
|
5
|
+
require 'simplecov-cobertura'
|
6
|
+
|
7
|
+
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter if ENV.fetch('GITLAB_CI', false)
|
8
|
+
|
5
9
|
SimpleCov.start 'rails' do
|
6
10
|
add_filter 'vendor'
|
7
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bankai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 5xRuby
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-08-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 2.
|
20
|
+
version: 2.2.26
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 2.
|
27
|
+
version: 2.2.26
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler-audit
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
201
|
requirements:
|
202
202
|
- - ">="
|
203
203
|
- !ruby/object:Gem::Version
|
204
|
-
version: 2.6.
|
204
|
+
version: 2.6.7
|
205
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
207
|
- - ">="
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
|
-
rubygems_version: 3.
|
211
|
+
rubygems_version: 3.2.26
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: The Rails template for 5xRuby
|