bankai 0.3.1 → 0.4.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: 2921c916a852ee9c6003f7d38879e8319ce1a6e931fc1b024dcea1dc8d524292
4
- data.tar.gz: 43770cae83f6bc2ac2a9b1e46d75f4484f155d3a3d72c5dcf5ba927cd77b3593
3
+ metadata.gz: bd1b206e5efc0376acd011667d50e997ccd8ed81d18673056f95007166b198ea
4
+ data.tar.gz: c04e04dfca974e26fd015494e238910d93a03cabbd974db01479fd6c58d63b47
5
5
  SHA512:
6
- metadata.gz: eec44c1174a94a5c0d8c340239deb91720430711cdd5209742817d73631a31eaf41faf05d8faba6ff547eba82bf19b42f1778d78a2bf5da091436b69dc7b3659
7
- data.tar.gz: 46ed335a7fdc20574ac4701fa6fd400cb5cabee308989881deef1d7c505434b3508105aacd088a4aa1c80c52c1772c88cbc2b73b3c050dc3e63a49385adaeb8d
6
+ metadata.gz: d7bd93f6e4816f93fb97b3be8890b8bd9a514ba1a447d25dcf1343d9401b6a546cc41469ce3c5eeebca28d0bd9ec3b002eeee9b1e12af518fe9e08d27304ac9f
7
+ data.tar.gz: 964c0e46b4333ce589b18fac16d175da7ac7720083cdcf419461d3c956d80ca4a2dc6f2c4d94aa2eb5ecd97920759dc514a3327a50a3a12b49265bcc0611c2c0
@@ -1,4 +1,4 @@
1
- image: ruby:2.6.0
1
+ image: ruby:2.6.6
2
2
 
3
3
  stages:
4
4
  - lint
@@ -9,20 +9,24 @@ cache:
9
9
  paths:
10
10
  - vendor/ruby
11
11
 
12
+ .install_ruby_gems: &install_ruby_gems
13
+ - gem install bundler -v 2.1.4
14
+ - bundle install --path vendor
15
+
16
+ before_script:
17
+ - *install_ruby_gems
18
+
12
19
  rubocop:
13
20
  stage: lint
14
- before_script:
15
- - gem install rubocop -v 0.71.0
16
21
  script:
17
- - rubocop
22
+ - bundle exec rubocop
18
23
  except:
19
24
  - schedules
20
25
 
21
26
  bundler-audit:
22
27
  stage: lint
23
28
  before_script:
24
- - gem install bundler -v 1.17.3
25
- - bundle install --path vendor
29
+ - *install_ruby_gems
26
30
  - gem install bundler-audit
27
31
  - bundle audit --update
28
32
  script:
@@ -31,9 +35,6 @@ bundler-audit:
31
35
 
32
36
  rspec:
33
37
  stage: test
34
- before_script:
35
- - gem install bundler -v 1.17.3
36
- - bundle install --path vendor
37
38
  script:
38
39
  - bundle exec rspec
39
40
  except:
@@ -42,6 +43,7 @@ rspec:
42
43
  sonarqube:
43
44
  stage: analysis
44
45
  image: registry.5xruby.tw/docker/sonar-scanner:4.0.0
46
+ before_script: []
45
47
  script:
46
48
  - sonar-scanner
47
49
  -D"sonar.projectKey=5xruby-bankai"
@@ -1 +1 @@
1
- 2.6.0
1
+ 2.6.6
@@ -3,5 +3,5 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.6.0
7
- before_install: gem install bundler -v 1.17.3
6
+ - 2.6.6
7
+ before_install: gem install bundler -v 2.1.4
@@ -27,12 +27,12 @@ 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', '~> 1.17.3'
30
+ spec.add_development_dependency 'bundler', '~> 2.1.4'
31
31
  spec.add_development_dependency 'bundler-audit'
32
32
  spec.add_development_dependency 'overcommit'
33
- spec.add_development_dependency 'rake', '~> 10.0'
33
+ spec.add_development_dependency 'rake', '~> 12.0'
34
34
  spec.add_development_dependency 'rspec', '~> 3.0'
35
- spec.add_development_dependency 'rubocop', '~> 0.71.0'
35
+ spec.add_development_dependency 'rubocop', '~> 0.81.0'
36
36
  spec.add_development_dependency 'simplecov'
37
37
 
38
38
  # TODO: Allow specify rails version
@@ -26,6 +26,8 @@ module Bankai
26
26
  end
27
27
 
28
28
  def configure_quiet_assets
29
+ return if options[:api]
30
+
29
31
  config = <<-RUBY
30
32
  config.assets.quiet = true
31
33
  RUBY
@@ -6,6 +6,8 @@ module Bankai
6
6
  module Generators
7
7
  # :nodoc:
8
8
  class DeployGenerator < Base
9
+ DEFAULT_REPO = 'git@example.com:me/my_repo.git'
10
+
9
11
  def install_capistrano
10
12
  Bundler.with_clean_env { run 'bundle exec cap install' }
11
13
  end
@@ -25,8 +27,10 @@ module Bankai
25
27
  protected
26
28
 
27
29
  def repo_url
30
+ return DEFAULT_REPO unless Dir.exist?('.git')
31
+
28
32
  res = `git remote get-url origin`
29
- return 'git@example.com:me/my_repo.git' if res.blank?
33
+ return DEFAULT_REPO if res.blank?
30
34
 
31
35
  res
32
36
  end
@@ -34,11 +38,11 @@ module Bankai
34
38
  private
35
39
 
36
40
  def capistrano_plugins
37
- <<-RUBY
38
- require "capistrano/bundler"
39
- require "capistrano/rails/assets"
40
- require "capistrano/rails/migrations"
41
- RUBY
41
+ plugins = []
42
+ plugins << 'require "capistrano/bundler"'
43
+ plugins << 'require "capistrano/rails/assets"' unless options[:api]
44
+ plugins << 'require "capistrano/rails/migrations"'
45
+ plugins.join("\n")
42
46
  end
43
47
  end
44
48
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bankai
4
- VERSION = '0.3.1'
5
- RUBY_VERSION = '2.6.0'
6
- RAILS_VERSION = '5.2.4'
7
- RUBOCOP_VERSION = '0.71.0'
8
- CAPISTRANO_VERSION = '3.11.0'
4
+ VERSION = '0.4.0'
5
+ RUBY_VERSION = '2.6.6'
6
+ RAILS_VERSION = '6.0.2'
7
+ RUBOCOP_VERSION = '0.81.0'
8
+ CAPISTRANO_VERSION = '3.13.0'
9
9
  end
@@ -27,8 +27,8 @@ set :deploy_to, '/src/app'
27
27
  append :linked_files, 'config/database.yml', 'config/master.key'
28
28
 
29
29
  # Default value for linked_dirs is []
30
- append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system', '.bundle',
31
- 'public/uploads', 'node_modules'
30
+ append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system',
31
+ '.bundle', 'public/uploads', 'node_modules'
32
32
 
33
33
  # Default value for default_env is {}
34
34
  set :default_env, { path: '/usr/local/ruby-<%= RUBY_VERSION %>/bin:$PATH' }
@@ -1,11 +1,8 @@
1
1
  image: ruby:<%= RUBY_VERSION %>
2
2
 
3
- include:
4
- template: Verify/Browser-Performance.gitlab-ci.yml
5
-
6
3
  variables:
7
4
  RAILS_ENV: test
8
- NODE_VERSION: 11.0.0
5
+ NODE_VERSION: 12.13.1
9
6
  <%- if pg? -%>
10
7
  POSTGRES_DB: <%= app_name %>
11
8
  DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
@@ -18,36 +15,40 @@ variables:
18
15
  DATABASE_URL: "mysql2://$MYSQL_USER:$MYSQL_PASSWORD@mysql:3306/$MYSQL_DATABASE"
19
16
  <%- end -%>
20
17
 
18
+ .install_ruby_gems: &install_ruby_gems
19
+ - bundle install --path vendor
20
+
21
+ .install_nodejs: &install_nodejs
22
+ - 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;
23
+ - curl -o- -L https://yarnpkg.com/install.sh | bash
24
+ - export PATH=$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH
25
+
21
26
  stages:
22
27
  - lint
23
28
  - test
24
29
  - deploy
25
- - measure
26
30
 
27
31
  cache:
28
32
  paths:
29
33
  - vendor/ruby
30
34
  - node_modules
31
35
 
36
+ before_script:
37
+ - export LANG=C.UTF-8
38
+ - export LC_ALL=C.UTF-8
39
+ - *install_ruby_gems
40
+
32
41
  rubocop:
33
42
  stage: lint
34
- before_script:
35
- - gem install rubocop -v <%= Bankai::RUBOCOP_VERSION %>
36
- - gem install rubocop-performance
37
- - gem install rubocop-rails
38
43
  script:
39
- - rubocop
44
+ - bundle exec rubocop
40
45
  except:
41
46
  - schedules
42
47
 
43
48
  brakeman:
44
49
  stage: lint
45
- before_script:
46
- - export LANG=C.UTF-8
47
- - export LC_ALL=C.UTF-8
48
- - gem install brakeman
49
50
  script:
50
- - brakeman
51
+ - bundle exec brakeman
51
52
  except:
52
53
  - schedules
53
54
 
@@ -63,14 +64,12 @@ bundler-audit:
63
64
  rspec:
64
65
  stage: test
65
66
  before_script:
66
- - 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;
67
- - curl -o- -L https://yarnpkg.com/install.sh | bash
68
- - export PATH=$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH
69
- - bundle install --without development --path vendor
67
+ - *install_nodejs
68
+ - *install_ruby_gems
70
69
  - yarn install
71
70
  services:
72
71
  <%- if pg? -%>
73
- - postgres:9.6
72
+ - postgres:12-alpine
74
73
  <%- end -%>
75
74
  <%- if mysql? -%>
76
75
  - name: mysql:5.7
@@ -81,25 +80,3 @@ rspec:
81
80
  - bundle exec rspec
82
81
  except:
83
82
  - schedules
84
-
85
- # staging:deploy:
86
- # stage: deploy
87
- # before_script:
88
- # - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
89
- # - eval $(ssh-agent -s)
90
- # - ssh-add <(echo -e "$SSH_PRIVATE_KEY")
91
- # - bundle install --path vendor
92
- # script:
93
- # - bundle exec cap staging deploy
94
- # only:
95
- # - master
96
- # except:
97
- # - schedules
98
-
99
- # NOTE: Ensure GitLab version > 12.0
100
- # performance:
101
- # stage: measure
102
- # variables:
103
- # URL: STAGING_SITE_URL
104
- # SITESPEED_VERSION: 10.3.2-plus1
105
- # SITESPEED_OPTIONS: '--plugins.add /lighthouse'
@@ -12,7 +12,7 @@ require 'shoulda/matchers'
12
12
  require 'faker'
13
13
  require 'factory_bot'
14
14
 
15
- Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
15
+ Dir[Rails.root.join('spec/support/**/*.rb')].sort.each { |f| require f }
16
16
 
17
17
  begin
18
18
  ActiveRecord::Migration.maintain_test_schema!
@@ -30,6 +30,10 @@ Metrics/BlockLength:
30
30
  Exclude:
31
31
  - config/environments/*
32
32
  - lib/tasks/**/*
33
+ Lint/RaiseException:
34
+ Enabled: true
35
+ Lint/StructNewOverride:
36
+ Enabled: true
33
37
  Layout:
34
38
  Exclude:
35
39
  - config/environments/*
@@ -42,3 +46,9 @@ Style/BlockComments:
42
46
  - spec/**/*
43
47
  Style/Documentation:
44
48
  Enabled: false
49
+ Style/HashEachMethods:
50
+ Enabled: true
51
+ Style/HashTransformKeys:
52
+ Enabled: true
53
+ Style/HashTransformValues:
54
+ Enabled: true
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.3.1
4
+ version: 0.4.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: 2019-12-30 00:00:00.000000000 Z
12
+ date: 2020-04-17 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: 1.17.3
20
+ version: 2.1.4
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: 1.17.3
27
+ version: 2.1.4
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler-audit
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '10.0'
62
+ version: '12.0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '10.0'
69
+ version: '12.0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.71.0
90
+ version: 0.81.0
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.71.0
97
+ version: 0.81.0
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: simplecov
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - ">="
117
117
  - !ruby/object:Gem::Version
118
- version: 5.2.4
118
+ version: 6.0.2
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
- version: 5.2.4
125
+ version: 6.0.2
126
126
  description: The tool to generate Rails template for 5xRuby
127
127
  email:
128
128
  - hi@5xruby.tw
@@ -186,14 +186,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - ">="
188
188
  - !ruby/object:Gem::Version
189
- version: 2.6.0
189
+ version: 2.6.6
190
190
  required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  requirements: []
196
- rubygems_version: 3.0.1
196
+ rubygems_version: 3.0.3
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: The Rails template for 5xRuby