bankai 0.4.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abd95d356e3fed8567f7f1278c5979d98bc653be99535bd44d79d7da2290de73
4
- data.tar.gz: fe2f340a3cc31a4181ab359ad5cd1d4941b58240564319cf7a2cd899793cd496
3
+ metadata.gz: d98599354503901a56b51a8c54539df4b6796a3a6d5c90076c6fab21ad1081a4
4
+ data.tar.gz: eaa2045c558c0a4d5eb2906b76581c0ff4cd1349e37865f094bc7ac642c52a95
5
5
  SHA512:
6
- metadata.gz: cf53b2d211cfb085056a55e27240c0afe7777a2df949543f46c5637e1e3ee9277018eafb430e88cbe80a0cddcec9f55f94059efa956ca0b623e6ad0d719167b1
7
- data.tar.gz: e51c62d8e84c94e3cc252b5fe68922c5e550a2c9208bebf773b28231eff51f5922ae612215524a9b9649eb3feae2cc5789efa732354f58759680f8652808e239
6
+ metadata.gz: 0cf3a771c075b784e512c985422bbbc91aa3d02c2b0e7de555358e9569a80b91948b5a31604eefc22efca9d179ce4f443cf76cd2831ff05278b265bb136a03e0
7
+ data.tar.gz: 3979379abd45c68d43c13cd98b99215271566b735b4984964800c72ed2bd1c90eebe567c533b05d43384d8207b13ec603afe85930482927ba5c8a50ecb72b2d1
@@ -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: registry.5xruby.tw/docker/sonar-scanner:4.0.0
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
- -D"sonar.projectKey=5xruby-bankai"
50
- -D"sonar.projectBaseDir=${CI_PROJECT_DIR}"
51
- -D"sonar.host.url=https://sonar.5xruby.tw"
52
- -D"sonar.login=${SONARQUBE_TOKEN}"
53
- -D"sonar.projectVersion=${CI_COMMIT_SHORT_SHA}"
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
@@ -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 'rspec_junit_formatter'
35
36
  spec.add_development_dependency 'rubocop', '~> 0.81.0'
36
- spec.add_development_dependency 'simplecov'
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}"
@@ -9,6 +9,11 @@ module Bankai
9
9
  def add_oj
10
10
  gem 'oj'
11
11
  Bundler.with_clean_env { 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
@@ -21,6 +21,10 @@ module Bankai
21
21
  def rubocop_autocorrect
22
22
  Bundler.with_clean_env { run 'bundle exec rubocop --auto-correct' }
23
23
  end
24
+
25
+ def rubocop_todo
26
+ Bundler.with_clean_env { run 'bundle exec rubocop --auto-gen-config' }
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bankai
4
- VERSION = '0.4.1'
4
+ VERSION = '0.8.0'
5
5
  RUBY_VERSION = '2.6.6'
6
- RAILS_VERSION = '6.0.2'
7
- RUBOCOP_VERSION = '0.81.0'
8
- CAPISTRANO_VERSION = '3.13.0'
6
+ RAILS_VERSION = '6.0.3'
7
+ RUBOCOP_VERSION = '1.5.1'
8
+ CAPISTRANO_VERSION = '3.14.1'
9
9
  end
@@ -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', '~> 0.6.0', require: false
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'
@@ -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, '/src/app'
14
+ set :deploy_to, '/srv/app'
15
15
 
16
16
  # Default value for :format is :airbrussh.
17
17
  # set :format, :airbrussh
@@ -1,4 +1,10 @@
1
- image: ruby:<%= RUBY_VERSION %>
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,18 @@ 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
- stages:
30
- - lint
31
- - test
32
- - deploy
33
-
34
- cache:
35
- paths:
36
- - vendor/ruby
37
- - node_modules
38
-
39
- before_script:
40
- - export LANG=C.UTF-8
41
- - export LC_ALL=C.UTF-8
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
+ paths:
42
+ - vendor/ruby
43
+ - node_modules
43
44
 
44
45
  rubocop:
46
+ extends: .common
45
47
  stage: lint
46
48
  script:
47
49
  - bundle exec rubocop
@@ -49,6 +51,7 @@ rubocop:
49
51
  - schedules
50
52
 
51
53
  brakeman:
54
+ extends: .common
52
55
  stage: lint
53
56
  script:
54
57
  - bundle exec brakeman
@@ -56,15 +59,47 @@ brakeman:
56
59
  - schedules
57
60
 
58
61
  bundler-audit:
62
+ extends: .common
59
63
  stage: lint
60
- before_script:
64
+ script:
61
65
  - gem install bundler-audit
62
66
  - bundle audit --update
63
- script:
64
67
  - bundle audit
68
+ only:
69
+ changes:
70
+ - Gemfile
71
+ - Gemfile.lock
72
+ allow_failure: true
73
+
74
+ bundler-leak:
75
+ extends: .common
76
+ stage: lint
77
+ script:
78
+ - gem install bundler-leak
79
+ - bundle leak check --update
80
+ - bundle leak
81
+ only:
82
+ changes:
83
+ - Gemfile
84
+ - Gemfile.lock
85
+ allow_failure: true
86
+
87
+ yarn-audit:
88
+ extends: .common
89
+ stage: lint
90
+ before_script:
91
+ - *install_nodejs
92
+ script:
93
+ - yarn audit
94
+ only:
95
+ changes:
96
+ - package.json
97
+ - package-lock.json
98
+ - yarn.lock
65
99
  allow_failure: true
66
100
 
67
101
  rspec:
102
+ extends: .common
68
103
  stage: test
69
104
  before_script:
70
105
  - *install_nodejs
@@ -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
+ NewCops: enable
7
10
  Exclude:
8
11
  - bin/*
9
12
  - vendor/ruby/**/*
@@ -30,13 +33,9 @@ Metrics/BlockLength:
30
33
  Exclude:
31
34
  - config/environments/*
32
35
  - lib/tasks/**/*
33
- Lint/RaiseException:
34
- Enabled: true
35
- Lint/StructNewOverride:
36
- Enabled: true
37
- Layout:
38
- Exclude:
39
- - config/environments/*
36
+ - spec/**/*
37
+ Layout/LineLength:
38
+ Max: 120
40
39
  Style:
41
40
  Exclude:
42
41
  - spec/*_helper.rb
@@ -46,9 +45,3 @@ Style/BlockComments:
46
45
  - spec/**/*
47
46
  Style/Documentation:
48
47
  Enabled: false
49
- Style/HashEachMethods:
50
- Enabled: true
51
- Style/HashTransformKeys:
52
- Enabled: true
53
- Style/HashTransformValues:
54
- Enabled: true
@@ -5,7 +5,7 @@ RSpec.configure do |config|
5
5
  DatabaseRewinder.clean_all
6
6
  end
7
7
 
8
- config.after(:each) do
8
+ config.after do
9
9
  DatabaseRewinder.clean
10
10
  end
11
11
  end
@@ -17,4 +17,8 @@ RSpec.configure do |config|
17
17
  end
18
18
 
19
19
  config.shared_context_metadata_behavior = :apply_to_host_groups
20
+
21
+ config.expect_with :rspec do |c|
22
+ c.syntax = :expect
23
+ end
20
24
  end
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.1
4
+ version: 0.8.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: 2020-04-30 00:00:00.000000000 Z
12
+ date: 2020-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -81,6 +81,20 @@ 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
@@ -99,30 +113,30 @@ dependencies:
99
113
  name: simplecov
100
114
  requirement: !ruby/object:Gem::Requirement
101
115
  requirements:
102
- - - ">="
116
+ - - "~>"
103
117
  - !ruby/object:Gem::Version
104
- version: '0'
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: '0'
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: 6.0.2
132
+ version: 6.0.3
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: 6.0.2
139
+ version: 6.0.3
126
140
  description: The tool to generate Rails template for 5xRuby
127
141
  email:
128
142
  - hi@5xruby.tw
@@ -178,7 +192,7 @@ files:
178
192
  homepage: https://github.com/5xRuby/bankai
179
193
  licenses: []
180
194
  metadata: {}
181
- post_install_message:
195
+ post_install_message:
182
196
  rdoc_options: []
183
197
  require_paths:
184
198
  - lib
@@ -194,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
208
  version: '0'
195
209
  requirements: []
196
210
  rubygems_version: 3.0.3
197
- signing_key:
211
+ signing_key:
198
212
  specification_version: 4
199
213
  summary: The Rails template for 5xRuby
200
214
  test_files: []