bankai 0.5.1 → 0.9.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 +28 -8
- data/.rubocop.yml +2 -0
- data/bankai.gemspec +3 -2
- data/exe/bankai +1 -1
- data/lib/bankai/builder.rb +1 -1
- data/lib/bankai/generators/base.rb +5 -1
- data/lib/bankai/generators/deploy_generator.rb +1 -1
- data/lib/bankai/generators/json_generator.rb +6 -1
- data/lib/bankai/generators/lint_generator.rb +3 -3
- data/lib/bankai/generators/sitemap_generator.rb +4 -4
- data/lib/bankai/generators/whenever_generator.rb +3 -3
- data/lib/bankai/helper.rb +1 -1
- data/lib/bankai/version.rb +4 -4
- data/templates/Gemfile.erb +2 -1
- data/templates/deploy.rb.erb +1 -1
- data/templates/gitlab-ci.yml.erb +56 -17
- data/templates/rubocop.yml.erb +3 -22
- data/templates/spec/database_rewinder.rb +1 -1
- data/templates/spec_helper.rb +4 -0
- metadata +28 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aad487d097c2958de9a83c226cff767df8d91c4219bcc64df3dd7a772444296f
|
4
|
+
data.tar.gz: b007e0bb678daa8c633dd79abd8ab0c2bc3dee19639673a5db821019b90fdfd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1a9582f2380c707733507c66b67a55d01f1d99b77c30bb6f18ae300a58e1564e4ec3bba0875f1f3cb3886dd9d337805584a460169834bb4870079e8a6435460
|
7
|
+
data.tar.gz: aa645568f5d0993d4f67060147b15965e39d510a4f21a5e002e61abb068608d8d0db22a64ec75e14dd22d46efc0275a988c962eca152ae19d81bccb6e9e07b9c
|
data/.gitlab-ci.yml
CHANGED
@@ -19,7 +19,10 @@ before_script:
|
|
19
19
|
rubocop:
|
20
20
|
stage: lint
|
21
21
|
script:
|
22
|
-
- bundle exec rubocop
|
22
|
+
- bundle exec rubocop --format progress --format json --out rubocop.json
|
23
|
+
artifacts:
|
24
|
+
paths:
|
25
|
+
- rubocop.json
|
23
26
|
except:
|
24
27
|
- schedules
|
25
28
|
|
@@ -36,18 +39,35 @@ bundler-audit:
|
|
36
39
|
rspec:
|
37
40
|
stage: test
|
38
41
|
script:
|
39
|
-
- bundle exec rspec
|
42
|
+
- bundle exec rspec --format progress --format RspecJunitFormatter --out rspec.xml
|
43
|
+
artifacts:
|
44
|
+
paths:
|
45
|
+
- rspec.xml
|
46
|
+
- coverage
|
47
|
+
reports:
|
48
|
+
junit: rspec.xml
|
40
49
|
except:
|
41
50
|
- schedules
|
42
51
|
|
43
52
|
sonarqube:
|
44
53
|
stage: analysis
|
45
|
-
image:
|
54
|
+
image:
|
55
|
+
name: sonarsource/sonar-scanner-cli
|
56
|
+
entrypoint: [""]
|
57
|
+
variables:
|
58
|
+
GIT_DEPTH: 0
|
46
59
|
before_script: []
|
47
60
|
script:
|
48
61
|
- sonar-scanner
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
62
|
+
-Dsonar.projectKey=Bankai
|
63
|
+
-Dsonar.sourceEncoding=UTF-8
|
64
|
+
-Dsonar.qualitygate.wait=true
|
65
|
+
-Dsonar.ruby.rubocop.reportPaths=rubocop.json
|
66
|
+
-Dsonar.ruby.coverage.reportPaths=coverage/.resultset.json
|
67
|
+
-Dsonar.exclusions=vendor/ruby/**/*
|
68
|
+
-Dsonar.coverage.exclusions=spec/**/*
|
69
|
+
-Dsonar.projectVersion=$CI_COMMIT_SHORT_SHA
|
70
|
+
-Dsonar.sources=.
|
71
|
+
allow_failure: true
|
72
|
+
only:
|
73
|
+
- master
|
data/.rubocop.yml
ADDED
data/bankai.gemspec
CHANGED
@@ -32,8 +32,9 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency 'overcommit'
|
33
33
|
spec.add_development_dependency 'rake', '~> 12.0'
|
34
34
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
|
-
spec.add_development_dependency '
|
36
|
-
spec.add_development_dependency '
|
35
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 1.8.1'
|
37
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
37
38
|
|
38
39
|
# TODO: Allow specify rails version
|
39
40
|
spec.add_dependency 'rails', ">= #{Bankai::RAILS_VERSION}"
|
data/exe/bankai
CHANGED
data/lib/bankai/builder.rb
CHANGED
@@ -15,7 +15,11 @@ module Bankai
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def app_name
|
18
|
-
Rails
|
18
|
+
if Rails::VERSION::MAJOR >= 6
|
19
|
+
Rails.app_class.module_parent_name.demodulize.underscore.dasherize
|
20
|
+
else
|
21
|
+
Rails.app_class.parent_name.demodulize.underscore.dasherize
|
22
|
+
end
|
19
23
|
end
|
20
24
|
end
|
21
25
|
end
|
@@ -8,7 +8,12 @@ module Bankai
|
|
8
8
|
class JsonGenerator < Base
|
9
9
|
def add_oj
|
10
10
|
gem 'oj'
|
11
|
-
|
11
|
+
in_root { run 'bundle install' }
|
12
|
+
|
13
|
+
initializer 'oj.rb' do
|
14
|
+
"# frozen_string_literal: true\n\n" \
|
15
|
+
'Oj.optimize_rails'
|
16
|
+
end
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
@@ -15,15 +15,15 @@ module Bankai
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def install_overcommit
|
18
|
-
|
18
|
+
in_root { run 'bundle exec overcommit --install' }
|
19
19
|
end
|
20
20
|
|
21
21
|
def rubocop_autocorrect
|
22
|
-
|
22
|
+
in_root { run 'bundle exec rubocop --auto-correct-all' }
|
23
23
|
end
|
24
24
|
|
25
25
|
def rubocop_todo
|
26
|
-
|
26
|
+
in_root { run 'bundle exec rubocop --auto-gen-config' }
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -17,18 +17,18 @@ module Bankai
|
|
17
17
|
class SitemapGenerator < Base
|
18
18
|
def add_sitemap_generator
|
19
19
|
gem 'sitemap_generator'
|
20
|
-
|
20
|
+
in_root { run 'bundle install' }
|
21
21
|
end
|
22
22
|
|
23
23
|
def init_sitemap
|
24
|
-
|
24
|
+
in_root { run 'bundle exec rake sitemap:install' }
|
25
25
|
end
|
26
26
|
|
27
27
|
def generate_sitmap_config
|
28
28
|
gsub_file 'config/sitemap.rb',
|
29
|
-
%r{"http
|
29
|
+
%r{"http://www.example.com"},
|
30
30
|
HOST_TEMPLATE
|
31
|
-
|
31
|
+
in_root do
|
32
32
|
run 'bundle exec rubocop -a config/sitemap.rb'
|
33
33
|
end
|
34
34
|
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
|
+
in_root { run 'rubocop -a Gemfile' }
|
12
|
+
in_root { run 'bundle install' }
|
13
13
|
end
|
14
14
|
|
15
15
|
def initialize_whenever
|
16
|
-
|
16
|
+
in_root { run "wheneverize #{destination_root}" }
|
17
17
|
end
|
18
18
|
|
19
19
|
def initialize_capistrano
|
data/lib/bankai/helper.rb
CHANGED
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.
|
4
|
+
VERSION = '0.9.0'
|
5
5
|
RUBY_VERSION = '2.6.6'
|
6
|
-
RAILS_VERSION = '
|
7
|
-
RUBOCOP_VERSION = '
|
8
|
-
CAPISTRANO_VERSION = '3.
|
6
|
+
RAILS_VERSION = '5.2.0'
|
7
|
+
RUBOCOP_VERSION = '1.8.1'
|
8
|
+
CAPISTRANO_VERSION = '3.14.1'
|
9
9
|
end
|
data/templates/Gemfile.erb
CHANGED
@@ -39,10 +39,11 @@ group :development, :test do
|
|
39
39
|
gem 'byebug', platforms: %i[mri mingw x64_mingw]
|
40
40
|
|
41
41
|
gem 'brakeman', require: false
|
42
|
-
gem 'bundler-audit',
|
42
|
+
gem 'bundler-audit', require: false
|
43
43
|
gem 'rubocop', '~> <%= Bankai::RUBOCOP_VERSION %>', require: false
|
44
44
|
gem 'rubocop-performance', require: false
|
45
45
|
gem 'rubocop-rails', require: false
|
46
|
+
gem 'rubocop-rspec', require: false
|
46
47
|
|
47
48
|
<%- unless options[:skip_rspec] -%>
|
48
49
|
gem 'database_rewinder'
|
data/templates/deploy.rb.erb
CHANGED
@@ -11,7 +11,7 @@ set :repo_url, '<%= repo_url || 'git@example.com:me/my_repo.git' %>'
|
|
11
11
|
ask :branch, :master
|
12
12
|
|
13
13
|
# Default deploy_to directory is /var/www/my_app_name
|
14
|
-
set :deploy_to, '/
|
14
|
+
set :deploy_to, '/srv/app'
|
15
15
|
|
16
16
|
# Default value for :format is :airbrussh.
|
17
17
|
# set :format, :airbrussh
|
data/templates/gitlab-ci.yml.erb
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
|
1
|
+
default:
|
2
|
+
image: ruby:<%= RUBY_VERSION %>
|
3
|
+
|
4
|
+
stages:
|
5
|
+
- lint
|
6
|
+
- test
|
7
|
+
- deploy
|
2
8
|
|
3
9
|
variables:
|
4
10
|
RAILS_ENV: test
|
@@ -26,22 +32,22 @@ variables:
|
|
26
32
|
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
27
33
|
- export PATH=$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH
|
28
34
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
cache:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
- *install_ruby_gems
|
35
|
+
.common:
|
36
|
+
before_script:
|
37
|
+
- export LANG=C.UTF-8
|
38
|
+
- export LC_ALL=C.UTF-8
|
39
|
+
- *install_ruby_gems
|
40
|
+
cache:
|
41
|
+
key:
|
42
|
+
files:
|
43
|
+
- Gemfile.lock
|
44
|
+
- yarn.lock
|
45
|
+
paths:
|
46
|
+
- vendor/ruby
|
47
|
+
- node_modules
|
43
48
|
|
44
49
|
rubocop:
|
50
|
+
extends: .common
|
45
51
|
stage: lint
|
46
52
|
script:
|
47
53
|
- bundle exec rubocop
|
@@ -49,6 +55,7 @@ rubocop:
|
|
49
55
|
- schedules
|
50
56
|
|
51
57
|
brakeman:
|
58
|
+
extends: .common
|
52
59
|
stage: lint
|
53
60
|
script:
|
54
61
|
- bundle exec brakeman
|
@@ -56,15 +63,47 @@ brakeman:
|
|
56
63
|
- schedules
|
57
64
|
|
58
65
|
bundler-audit:
|
66
|
+
extends: .common
|
59
67
|
stage: lint
|
60
|
-
|
68
|
+
script:
|
61
69
|
- gem install bundler-audit
|
62
70
|
- bundle audit --update
|
63
|
-
script:
|
64
71
|
- bundle audit
|
72
|
+
only:
|
73
|
+
changes:
|
74
|
+
- Gemfile
|
75
|
+
- Gemfile.lock
|
76
|
+
allow_failure: true
|
77
|
+
|
78
|
+
bundler-leak:
|
79
|
+
extends: .common
|
80
|
+
stage: lint
|
81
|
+
script:
|
82
|
+
- gem install bundler-leak
|
83
|
+
- bundle leak check --update
|
84
|
+
- bundle leak
|
85
|
+
only:
|
86
|
+
changes:
|
87
|
+
- Gemfile
|
88
|
+
- Gemfile.lock
|
89
|
+
allow_failure: true
|
90
|
+
|
91
|
+
yarn-audit:
|
92
|
+
extends: .common
|
93
|
+
stage: lint
|
94
|
+
before_script:
|
95
|
+
- *install_nodejs
|
96
|
+
script:
|
97
|
+
- yarn audit
|
98
|
+
only:
|
99
|
+
changes:
|
100
|
+
- package.json
|
101
|
+
- package-lock.json
|
102
|
+
- yarn.lock
|
65
103
|
allow_failure: true
|
66
104
|
|
67
105
|
rspec:
|
106
|
+
extends: .common
|
68
107
|
stage: test
|
69
108
|
before_script:
|
70
109
|
- *install_nodejs
|
data/templates/rubocop.yml.erb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-performance
|
3
3
|
- rubocop-rails
|
4
|
+
- rubocop-rspec
|
5
|
+
|
4
6
|
AllCops:
|
5
7
|
TargetRubyVersion: <%= RUBY_VERSION %>
|
6
8
|
DisplayCopNames: true
|
9
|
+
SuggestExtensions: false
|
7
10
|
Exclude:
|
8
11
|
- bin/*
|
9
12
|
- vendor/ruby/**/*
|
@@ -31,27 +34,5 @@ Metrics/BlockLength:
|
|
31
34
|
- config/environments/*
|
32
35
|
- lib/tasks/**/*
|
33
36
|
- spec/**/*
|
34
|
-
Lint/RaiseException:
|
35
|
-
Enabled: true
|
36
|
-
Lint/StructNewOverride:
|
37
|
-
Enabled: true
|
38
|
-
Layout:
|
39
|
-
Exclude:
|
40
|
-
- config/environments/*
|
41
|
-
Layout/LineLength:
|
42
|
-
Max: 120
|
43
|
-
Style:
|
44
|
-
Exclude:
|
45
|
-
- spec/*_helper.rb
|
46
|
-
Style/BlockComments:
|
47
|
-
Exclude:
|
48
|
-
- config/**/*
|
49
|
-
- spec/**/*
|
50
37
|
Style/Documentation:
|
51
38
|
Enabled: false
|
52
|
-
Style/HashEachMethods:
|
53
|
-
Enabled: true
|
54
|
-
Style/HashTransformKeys:
|
55
|
-
Enabled: true
|
56
|
-
Style/HashTransformValues:
|
57
|
-
Enabled: true
|
data/templates/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bankai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 5xRuby
|
8
8
|
- 蒼時弦也
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -81,48 +81,62 @@ dependencies:
|
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '3.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec_junit_formatter
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: rubocop
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
87
101
|
requirements:
|
88
102
|
- - "~>"
|
89
103
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
104
|
+
version: 1.8.1
|
91
105
|
type: :development
|
92
106
|
prerelease: false
|
93
107
|
version_requirements: !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
109
|
- - "~>"
|
96
110
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
111
|
+
version: 1.8.1
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: simplecov
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
101
115
|
requirements:
|
102
|
-
- - "
|
116
|
+
- - "~>"
|
103
117
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
118
|
+
version: 0.17.1
|
105
119
|
type: :development
|
106
120
|
prerelease: false
|
107
121
|
version_requirements: !ruby/object:Gem::Requirement
|
108
122
|
requirements:
|
109
|
-
- - "
|
123
|
+
- - "~>"
|
110
124
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
125
|
+
version: 0.17.1
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: rails
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
130
|
- - ">="
|
117
131
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
132
|
+
version: 5.2.0
|
119
133
|
type: :runtime
|
120
134
|
prerelease: false
|
121
135
|
version_requirements: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
137
|
- - ">="
|
124
138
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
139
|
+
version: 5.2.0
|
126
140
|
description: The tool to generate Rails template for 5xRuby
|
127
141
|
email:
|
128
142
|
- hi@5xruby.tw
|
@@ -136,6 +150,7 @@ files:
|
|
136
150
|
- ".gitlab-ci.yml"
|
137
151
|
- ".overcommit.yml"
|
138
152
|
- ".rspec"
|
153
|
+
- ".rubocop.yml"
|
139
154
|
- ".ruby-version"
|
140
155
|
- ".travis.yml"
|
141
156
|
- CODE_OF_CONDUCT.md
|
@@ -178,7 +193,7 @@ files:
|
|
178
193
|
homepage: https://github.com/5xRuby/bankai
|
179
194
|
licenses: []
|
180
195
|
metadata: {}
|
181
|
-
post_install_message:
|
196
|
+
post_install_message:
|
182
197
|
rdoc_options: []
|
183
198
|
require_paths:
|
184
199
|
- lib
|
@@ -194,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
209
|
version: '0'
|
195
210
|
requirements: []
|
196
211
|
rubygems_version: 3.0.3
|
197
|
-
signing_key:
|
212
|
+
signing_key:
|
198
213
|
specification_version: 4
|
199
214
|
summary: The Rails template for 5xRuby
|
200
215
|
test_files: []
|