bankai 0.4.0 → 0.7.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: bd1b206e5efc0376acd011667d50e997ccd8ed81d18673056f95007166b198ea
4
- data.tar.gz: c04e04dfca974e26fd015494e238910d93a03cabbd974db01479fd6c58d63b47
3
+ metadata.gz: a6ae152202fc1035211da5eeb7e7351799e8d56e8f136f7f09dcc1269a0e647e
4
+ data.tar.gz: 0b0d39e8b111f7e3e22a60dba1209910b33c73df22dc556d4d44aedcb58d5d6e
5
5
  SHA512:
6
- metadata.gz: d7bd93f6e4816f93fb97b3be8890b8bd9a514ba1a447d25dcf1343d9401b6a546cc41469ce3c5eeebca28d0bd9ec3b002eeee9b1e12af518fe9e08d27304ac9f
7
- data.tar.gz: 964c0e46b4333ce589b18fac16d175da7ac7720083cdcf419461d3c956d80ca4a2dc6f2c4d94aa2eb5ecd97920759dc514a3327a50a3a12b49265bcc0611c2c0
6
+ metadata.gz: dadcccf32107bc95e5c0665c5605b10ce117b587e44e8ffb2112825eff2ac4236736786b9c7db49664b8272ab4646af53c853731cea1019a4358972415b7666d
7
+ data.tar.gz: 6ac4850e192204202e363f59d43b2c3ad4c4be100ea248b6549fdeca8b2c2bae154eb3947debed74f173e768eac35aff02437fe48948d4765c4039f2bc1699b7
@@ -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}"
@@ -25,19 +25,24 @@ module Bankai
25
25
  end
26
26
  end
27
27
 
28
+ def configure_puma_dev
29
+ application(nil, env: 'development') do
30
+ "config.hosts << '.test'"
31
+ end
32
+ end
33
+
28
34
  def configure_quiet_assets
29
35
  return if options[:api]
30
36
 
31
- config = <<-RUBY
32
- config.assets.quiet = true
33
- RUBY
34
-
35
- inject_into_class 'config/application.rb', 'Application', config
37
+ application do
38
+ 'config.assets.quiet = true'
39
+ end
36
40
  end
37
41
 
38
42
  # rubocop:disable Metrics/MethodLength
39
43
  def configure_generators
40
- config = <<-RUBY
44
+ application do
45
+ <<-RUBY
41
46
  config.generators do |generate|
42
47
  generate.helper false
43
48
  generate.javascripts false
@@ -47,9 +52,8 @@ module Bankai
47
52
  generate.test_framework :rspec
48
53
  generate.view_specs false
49
54
  end
50
- RUBY
51
-
52
- inject_into_class 'config/application.rb', 'Application', config
55
+ RUBY
56
+ end
53
57
  end
54
58
 
55
59
  def setup_default_directories
@@ -49,6 +49,7 @@ module Bankai
49
49
  def setup_development_environment
50
50
  say 'Setting up the development environment'
51
51
  build :configure_quiet_assets
52
+ build :configure_puma_dev
52
53
  build :configure_generators
53
54
  build :clear_seed_file
54
55
  # TODO: Add setup script
@@ -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.0'
4
+ VERSION = '0.7.0'
5
5
  RUBY_VERSION = '2.6.6'
6
- RAILS_VERSION = '6.0.2'
6
+ RAILS_VERSION = '6.0.3'
7
7
  RUBOCOP_VERSION = '0.81.0'
8
- CAPISTRANO_VERSION = '3.13.0'
8
+ CAPISTRANO_VERSION = '3.14.0'
9
9
  end
@@ -43,6 +43,7 @@ group :development, :test do
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
@@ -3,9 +3,11 @@ image: ruby:<%= RUBY_VERSION %>
3
3
  variables:
4
4
  RAILS_ENV: test
5
5
  NODE_VERSION: 12.13.1
6
+ BUNDLER_VERSION: 2.1.4
6
7
  <%- if pg? -%>
7
8
  POSTGRES_DB: <%= app_name %>
8
- DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
9
+ POSTGRES_PASSWORD: postgres
10
+ DATABASE_URL: "postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/$POSTGRES_DB"
9
11
  <%- end -%>
10
12
  <%- if mysql? -%>
11
13
  MYSQL_DATABASE: <%= app_name %>
@@ -16,6 +18,7 @@ variables:
16
18
  <%- end -%>
17
19
 
18
20
  .install_ruby_gems: &install_ruby_gems
21
+ - gem install bundler -v ${BUNDLER_VERSION}
19
22
  - bundle install --path vendor
20
23
 
21
24
  .install_nodejs: &install_nodejs
@@ -61,6 +64,14 @@ bundler-audit:
61
64
  - bundle audit
62
65
  allow_failure: true
63
66
 
67
+ yarn-audit:
68
+ stage: lint
69
+ before_script:
70
+ - *install_nodejs
71
+ script:
72
+ - yarn audit
73
+ allow_failure: true
74
+
64
75
  rspec:
65
76
  stage: test
66
77
  before_script:
@@ -1,6 +1,7 @@
1
1
  require:
2
2
  - rubocop-performance
3
3
  - rubocop-rails
4
+ - rubocop-rspec
4
5
  AllCops:
5
6
  TargetRubyVersion: <%= RUBY_VERSION %>
6
7
  DisplayCopNames: true
@@ -30,6 +31,7 @@ Metrics/BlockLength:
30
31
  Exclude:
31
32
  - config/environments/*
32
33
  - lib/tasks/**/*
34
+ - spec/**/*
33
35
  Lint/RaiseException:
34
36
  Enabled: true
35
37
  Lint/StructNewOverride:
@@ -37,6 +39,8 @@ Lint/StructNewOverride:
37
39
  Layout:
38
40
  Exclude:
39
41
  - config/environments/*
42
+ Layout/LineLength:
43
+ Max: 120
40
44
  Style:
41
45
  Exclude:
42
46
  - spec/*_helper.rb
@@ -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.0
4
+ version: 0.7.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-17 00:00:00.000000000 Z
12
+ date: 2020-09-09 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: []