bankai 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/bankai.gemspec +2 -2
- data/bin/console +1 -0
- data/exe/bankai +2 -0
- data/lib/bankai.rb +5 -0
- data/lib/bankai/generators/base.rb +2 -0
- data/lib/bankai/generators/ci_generator.rb +0 -16
- data/lib/bankai/generators/sitemap_generator.rb +37 -0
- data/lib/bankai/generators/whenever_generator.rb +30 -0
- data/lib/bankai/helper.rb +24 -0
- data/lib/bankai/version.rb +7 -5
- data/templates/Gemfile.erb +2 -0
- data/templates/README.md.erb +0 -2
- data/templates/rack_mini_profiler.rb +2 -0
- data/templates/rubocop.yml.erb +7 -0
- data/templates/spec_helper.rb +1 -1
- metadata +14 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63cf396320da25bc3c0e14294788f925eed947751e979426e06fd2a5f96472e6
|
4
|
+
data.tar.gz: b8dacbb98533fec16d577310e73a1bde3a257647c5da86a0123387e6fbff1f17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a79317200b09c89a09e314de917f46bdfe4ef4ee27ebed9195928877fdd18d8a27a53d46763bfaac5e9443826fbbcdcfb016c4ff4113d2ac13b3093c628fb57
|
7
|
+
data.tar.gz: b209b588b1b9585f3720a6a16fefbe3159de51e86f062f6022cea1539d24709b33e769e37fb34247d97858bcb8c4a7e210cc577d4bdd783285159e029dae3e69
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
data/bankai.gemspec
CHANGED
@@ -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.
|
30
|
+
spec.add_development_dependency 'bundler', '~> 1.17.3'
|
31
31
|
spec.add_development_dependency 'bundler-audit'
|
32
32
|
spec.add_development_dependency 'overcommit'
|
33
33
|
spec.add_development_dependency 'rake', '~> 10.0'
|
34
34
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
35
|
+
spec.add_development_dependency 'rubocop', '~> 0.71.0'
|
36
36
|
spec.add_development_dependency 'simplecov'
|
37
37
|
spec.add_dependency 'rails', Bankai::RAILS_VERSION
|
38
38
|
end
|
data/bin/console
CHANGED
data/exe/bankai
CHANGED
data/lib/bankai.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bankai/version'
|
2
4
|
require 'bankai/generator'
|
5
|
+
require 'bankai/helper'
|
3
6
|
require 'bankai/generators/testing_generator'
|
4
7
|
require 'bankai/generators/ci_generator'
|
5
8
|
require 'bankai/generators/json_generator'
|
@@ -7,4 +10,6 @@ require 'bankai/generators/db_optimizations_generator'
|
|
7
10
|
require 'bankai/generators/mailer_generator'
|
8
11
|
require 'bankai/generators/deploy_generator'
|
9
12
|
require 'bankai/generators/lint_generator'
|
13
|
+
require 'bankai/generators/sitemap_generator'
|
14
|
+
require 'bankai/generators/whenever_generator'
|
10
15
|
require 'bankai/builder'
|
@@ -9,22 +9,6 @@ module Bankai
|
|
9
9
|
def configure_ci
|
10
10
|
template 'gitlab-ci.yml.erb', '.gitlab-ci.yml'
|
11
11
|
end
|
12
|
-
|
13
|
-
protected
|
14
|
-
|
15
|
-
def pg?
|
16
|
-
gemfile.match?(/gem .pg./)
|
17
|
-
end
|
18
|
-
|
19
|
-
def mysql?
|
20
|
-
gemfile.match?(/gem .mysql2./)
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def gemfile
|
26
|
-
@gemfile ||= File.read(destination_root + '/Gemfile')
|
27
|
-
end
|
28
12
|
end
|
29
13
|
end
|
30
14
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
|
5
|
+
module Bankai
|
6
|
+
module Generators
|
7
|
+
HOST_TEMPLATE = <<-RUBY.freeze
|
8
|
+
|
9
|
+
if Rails.env.production?
|
10
|
+
"https://\#{ENV['APPLICATION_HOST']}"
|
11
|
+
else
|
12
|
+
"http://\#{ENV['APPLICATION_HOST']}"
|
13
|
+
end
|
14
|
+
RUBY
|
15
|
+
|
16
|
+
# :nodoc:
|
17
|
+
class SitemapGenerator < Base
|
18
|
+
def add_sitemap_generator
|
19
|
+
gem 'sitemap_generator'
|
20
|
+
Bundler.with_clean_env { run 'bundle install' }
|
21
|
+
end
|
22
|
+
|
23
|
+
def init_sitemap
|
24
|
+
Bundler.with_clean_env { run 'bundle exec rake sitemap:install' }
|
25
|
+
end
|
26
|
+
|
27
|
+
def generate_sitmap_config
|
28
|
+
gsub_file 'config/sitemap.rb',
|
29
|
+
%r{"http:\/\/www.example.com"},
|
30
|
+
HOST_TEMPLATE
|
31
|
+
Bundler.with_clean_env do
|
32
|
+
run 'bundle exec rubocop -a config/sitemap.rb'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
|
5
|
+
module Bankai
|
6
|
+
module Generators
|
7
|
+
# :nodoc:
|
8
|
+
class WheneverGenerator < Base
|
9
|
+
def add_whenever
|
10
|
+
gem 'whenever', require: false
|
11
|
+
Bundler.with_clean_env { run 'rubocop -a Gemfile' }
|
12
|
+
Bundler.with_clean_env { run 'bundle install' }
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize_whenever
|
16
|
+
Bundler.with_clean_env { run "wheneverize #{destination_root}" }
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize_capistrano
|
20
|
+
return unless capistrano?
|
21
|
+
|
22
|
+
inject_into_file(
|
23
|
+
'Capfile',
|
24
|
+
"require 'whenerver/capistrano'\n",
|
25
|
+
after: "# require \"capistrano/passenger\"\n"
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Bankai
|
2
|
+
# :nodoc:
|
3
|
+
module Helper
|
4
|
+
protected
|
5
|
+
|
6
|
+
def pg?
|
7
|
+
gemfile.match?(/gem .pg./)
|
8
|
+
end
|
9
|
+
|
10
|
+
def mysql?
|
11
|
+
gemfile.match?(/gem .mysql2./)
|
12
|
+
end
|
13
|
+
|
14
|
+
def capistrano?
|
15
|
+
gemfile.match?(/gem .capistrano./)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def gemfile
|
21
|
+
@gemfile ||= File.read(destination_root + '/Gemfile')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/bankai/version.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bankai
|
2
|
-
VERSION = '0.2.
|
3
|
-
RUBY_VERSION = '2.
|
4
|
-
RAILS_VERSION = '5.2.
|
5
|
-
RUBOCOP_VERSION = '0.
|
6
|
-
CAPISTRANO_VERSION = '3.11.0'
|
4
|
+
VERSION = '0.2.3'
|
5
|
+
RUBY_VERSION = '2.6.0'
|
6
|
+
RAILS_VERSION = '5.2.3'
|
7
|
+
RUBOCOP_VERSION = '0.71.0'
|
8
|
+
CAPISTRANO_VERSION = '3.11.0'
|
7
9
|
end
|
data/templates/Gemfile.erb
CHANGED
@@ -41,6 +41,8 @@ group :development, :test do
|
|
41
41
|
gem 'brakeman', require: false
|
42
42
|
gem 'bundler-audit', '~> 0.6.0', require: false
|
43
43
|
gem 'rubocop', '~> <%= Bankai::RUBOCOP_VERSION %>', require: false
|
44
|
+
gem 'rubocop-performance', require: false
|
45
|
+
gem 'rubocop-rails', require: false
|
44
46
|
|
45
47
|
<%- unless options[:skip_rspec] -%>
|
46
48
|
gem 'database_rewinder'
|
data/templates/README.md.erb
CHANGED
@@ -93,14 +93,12 @@ Rails 需要 JavaScript Runtime 一般會使用 Node.js。
|
|
93
93
|
brew install node
|
94
94
|
```
|
95
95
|
|
96
|
-
<%- if options[:webpack] -%>
|
97
96
|
Webpacker 使用 Yarn 管理安裝的 JavaScript 套件,我們還需要將 Yarn 安裝進來。
|
98
97
|
|
99
98
|
```bash
|
100
99
|
brew install yarn
|
101
100
|
```
|
102
101
|
|
103
|
-
<%- end -%>
|
104
102
|
### Rails
|
105
103
|
|
106
104
|
請先透過 git 將專案下載到本地端。
|
data/templates/rubocop.yml.erb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rails
|
1
4
|
AllCops:
|
2
5
|
TargetRubyVersion: <%= RUBY_VERSION %>
|
3
6
|
DisplayCopNames: true
|
@@ -23,6 +26,10 @@ Metrics:
|
|
23
26
|
- config/**/*
|
24
27
|
- spec/**/*
|
25
28
|
- lib/tasks/**/*
|
29
|
+
Metrics/BlockLength:
|
30
|
+
Exclude:
|
31
|
+
- config/environments/*
|
32
|
+
- lib/tasks/**/*
|
26
33
|
Layout:
|
27
34
|
Exclude:
|
28
35
|
- config/environments/*
|
data/templates/spec_helper.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.3
|
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
|
+
date: 2019-06-03 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:
|
20
|
+
version: 1.17.3
|
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:
|
27
|
+
version: 1.17.3
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler-audit
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
90
|
+
version: 0.71.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.
|
97
|
+
version: 0.71.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.
|
118
|
+
version: 5.2.3
|
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.
|
125
|
+
version: 5.2.3
|
126
126
|
description: The tool to generate Rails template for 5xRuby
|
127
127
|
email:
|
128
128
|
- hi@5xruby.tw
|
@@ -136,6 +136,7 @@ files:
|
|
136
136
|
- ".gitlab-ci.yml"
|
137
137
|
- ".overcommit.yml"
|
138
138
|
- ".rspec"
|
139
|
+
- ".ruby-version"
|
139
140
|
- ".travis.yml"
|
140
141
|
- CODE_OF_CONDUCT.md
|
141
142
|
- Gemfile
|
@@ -155,7 +156,10 @@ files:
|
|
155
156
|
- lib/bankai/generators/json_generator.rb
|
156
157
|
- lib/bankai/generators/lint_generator.rb
|
157
158
|
- lib/bankai/generators/mailer_generator.rb
|
159
|
+
- lib/bankai/generators/sitemap_generator.rb
|
158
160
|
- lib/bankai/generators/testing_generator.rb
|
161
|
+
- lib/bankai/generators/whenever_generator.rb
|
162
|
+
- lib/bankai/helper.rb
|
159
163
|
- lib/bankai/version.rb
|
160
164
|
- templates/Gemfile.erb
|
161
165
|
- templates/README.md.erb
|
@@ -182,15 +186,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
186
|
requirements:
|
183
187
|
- - ">="
|
184
188
|
- !ruby/object:Gem::Version
|
185
|
-
version: 2.
|
189
|
+
version: 2.6.0
|
186
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
191
|
requirements:
|
188
192
|
- - ">="
|
189
193
|
- !ruby/object:Gem::Version
|
190
194
|
version: '0'
|
191
195
|
requirements: []
|
192
|
-
|
193
|
-
rubygems_version: 2.7.6
|
196
|
+
rubygems_version: 3.0.1
|
194
197
|
signing_key:
|
195
198
|
specification_version: 4
|
196
199
|
summary: The Rails template for 5xRuby
|