bankai 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # config valid for current version and patch releases of Capistrano
4
+ lock '~> <%= Bankai::CAPISTRANO_VERSION %>'
5
+
6
+ set :application, '<%= app_name %>'
7
+ set :repo_url, '<%= repo_url || 'git@example.com:me/my_repo.git' %>'
8
+
9
+ # Default branch is :master
10
+ # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
11
+ ask :branch, :master
12
+
13
+ # Default deploy_to directory is /var/www/my_app_name
14
+ set :deploy_to, '/src/app'
15
+
16
+ # Default value for :format is :airbrussh.
17
+ # set :format, :airbrussh
18
+
19
+ # You can configure the Airbrussh format using :format_options.
20
+ # These are the defaults.
21
+ # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
22
+
23
+ # Default value for :pty is false
24
+ # set :pty, true
25
+
26
+ # Default value for :linked_files is []
27
+ append :linked_files, 'config/database.yml', 'config/master.key'
28
+
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'
32
+
33
+ # Default value for default_env is {}
34
+ set :default_env, { path: '/usr/local/ruby-<%= RUBY_VERSION %>/bin:$PATH' }
35
+
36
+ # Default value for local_user is ENV['USER']
37
+ # set :local_user, -> { `git config user.name`.chomp }
38
+
39
+ # Default value for keep_releases is 5
40
+ # set :keep_releases, 5
41
+
42
+ # Uncomment the following to require manually verifying the host key before first deploy.
43
+ # set :ssh_options, verify_host_key: :secure
@@ -0,0 +1,2 @@
1
+ --recurse=yes
2
+ --exclude=vendor
@@ -0,0 +1,4 @@
1
+ ASSET_HOST=localhost:3000
2
+ APPLICATION_HOST=localhost:3000
3
+ PORT=3000
4
+ RACK_MINI_PROFILER=0
@@ -0,0 +1,61 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ <% if sqlite3? -%>
11
+ # Ignore the default SQLite database.
12
+ /db/*.sqlite3
13
+ /db/*.sqlite3-journal
14
+
15
+ <% end -%>
16
+ # Ignore all logfiles and tempfiles.
17
+ /log/*
18
+ /tmp/*
19
+ <% if keeps? -%>
20
+ !/log/.keep
21
+ !/tmp/.keep
22
+ <% end -%>
23
+ *.orig
24
+ .DS_Store
25
+
26
+ <% unless skip_active_storage? -%>
27
+ # Ignore uploaded files in development
28
+ /storage/*
29
+ <% if keeps? -%>
30
+ !/storage/.keep
31
+ <% end -%>
32
+ <% end -%>
33
+
34
+ <% unless options.skip_yarn? -%>
35
+ /node_modules
36
+ yarn-debug.log*
37
+ yarn-error.log*
38
+ .yarn-integrity
39
+
40
+ <% end -%>
41
+ <% unless options.api? -%>
42
+ /public/assets
43
+ <% end -%>
44
+ .byebug_history
45
+
46
+ <% unless options[:skip_rspec] -%>
47
+ /coverage/
48
+ /spec/tmp
49
+ <% end -%>
50
+
51
+ # Dotenv
52
+ .env
53
+ .env*
54
+ !.env.example
55
+
56
+ # CarrierWave
57
+ /public/uploads
58
+
59
+ # Environment
60
+ /.bundle
61
+ /vendor/bundle
@@ -0,0 +1,74 @@
1
+ image: ruby:<%= RUBY_VERSION %>
2
+
3
+ variables:
4
+ RAILS_ENV: test
5
+ NODE_VERSION: 8.0.0
6
+ <%- if pg? -%>
7
+ POSTGRES_DB: <%= app_name %>
8
+ DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
9
+ <%- end -%>
10
+ <%- if mysql? -%>
11
+ MYSQL_DATABASE: <%= app_name %>
12
+ MYSQL_USER: <%= app_name %>
13
+ MYSQL_PASSWORD: <%= app_name %>
14
+ MYSQL_RANDOM_ROOT_PASSWORD: "true"
15
+ DATABASE_URL: "mysql2://$MYSQL_USER:$MYSQL_PASSWORD@mysql:3306/$MYSQL_DATABASE"
16
+ <%- end -%>
17
+
18
+ stages:
19
+ - lint
20
+ - test
21
+ - deploy
22
+
23
+ cache:
24
+ paths:
25
+ - vendor/ruby
26
+
27
+ rubocop:
28
+ stage: lint
29
+ before_script:
30
+ - gem install rubocop -v <%= Bankai::RUBOCOP_VERSION %>
31
+ script:
32
+ - rubocop
33
+
34
+ brakeman:
35
+ stage: lint
36
+ before_script:
37
+ - export LANG=C.UTF-8
38
+ - export LC_ALL=C.UTF-8
39
+ - gem install brakeman
40
+ script:
41
+ - brakeman
42
+
43
+ rspec:
44
+ stage: test
45
+ before_script:
46
+ - 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;
47
+ - curl -o- -L https://yarnpkg.com/install.sh | bash
48
+ - export PATH=$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH
49
+ - bundle install --without development --path vendor
50
+ - yarn install
51
+ - bin/webpack
52
+ services:
53
+ <%- if pg? -%>
54
+ - postgres:9.6
55
+ <%- end -%>
56
+ <%- if mysql? -%>
57
+ - name: mysql:5.7
58
+ command: ['mysqld', '--character-set-server=utf8', '--collation-server=utf8_unicode_ci']
59
+ <%- end -%>
60
+ script:
61
+ - bundle exec rake db:migrate
62
+ - bundle exec rspec
63
+
64
+ # staging:deploy:
65
+ # stage: deploy
66
+ # before_script:
67
+ # - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
68
+ # - eval $(ssh-agent -s)
69
+ # - ssh-add <(echo -e "$SSH_PRIVATE_KEY")
70
+ # - bundle install --path vendor
71
+ # script:
72
+ # - bundle exec cap staging deploy
73
+ # only:
74
+ # - master
@@ -0,0 +1,23 @@
1
+ PreCommit:
2
+ AuthorName:
3
+ enabled: false
4
+ RuboCop:
5
+ enabled: true
6
+ on_warn: fail # Treat all warnings as failures
7
+ TrailingWhitespace:
8
+ enabled: true
9
+ exclude:
10
+ - '**/db/structure.sql' # Ignore trailing whitespace in generated files
11
+ BundleAudit:
12
+ enabled: true
13
+
14
+ PrePush:
15
+ Brakeman:
16
+ enabled: true
17
+
18
+ PostCheckout:
19
+ ALL: # Special hook name that customizes all hooks of this type
20
+ quiet: true # Change all post-checkout hooks to only display output on failure
21
+
22
+ IndexTags:
23
+ enabled: true # Generate a tags file with `ctags` each time HEAD changes
@@ -0,0 +1,5 @@
1
+ if ENV['RACK_MINI_PROFILER'].to_i.positive?
2
+ require 'rack-mini-profiler'
3
+
4
+ Rack::MiniProfilerRails.initialize!(Rails.application)
5
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ ENV['RAILS_ENV'] ||= 'test'
5
+ require File.expand_path('..', '..', 'config', 'environment', __FILE__)
6
+
7
+ abort('The Rails is running in production mode!') if Rails.env.production?
8
+ require 'rspec/rails'
9
+
10
+ require 'shoulda'
11
+ require 'shoulda/matchers'
12
+ require 'faker'
13
+ require 'factory_bot'
14
+
15
+ Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
16
+
17
+ begin
18
+ ActiveRecord::Migration.maintain_test_schema!
19
+ rescue ActiveRecord::PendingMigrationError => e
20
+ puts e.to_s.strip
21
+ exit 1
22
+ end
23
+ RSpec.configure do |config|
24
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
25
+
26
+ config.use_transactional_fixtures = false
27
+ config.infer_spec_type_from_file_location!
28
+ config.filter_rails_from_backtrace!
29
+
30
+ config.include FactoryBot::Syntax::Methods
31
+ # config.include Devise::Test::IntegrationHelpers, type: :request
32
+ end
@@ -0,0 +1,37 @@
1
+ AllCops:
2
+ TargetRubyVersion: <%= RUBY_VERSION %>
3
+ DisplayCopNames: true
4
+ Exclude:
5
+ - bin/*
6
+ - vendor/ruby/**/*
7
+ - node_modules/**/*
8
+ - db/schema.rb
9
+ - .licenses/**/*
10
+ Rails:
11
+ Enabled: true
12
+ Rails/UnknownEnv:
13
+ Environments:
14
+ - production
15
+ - staging
16
+ - development
17
+ - test
18
+ Metrics:
19
+ Exclude:
20
+ - db/migrate/*
21
+ - Rakefile
22
+ - Gemfile
23
+ - config/**/*
24
+ - spec/**/*
25
+ - lib/tasks/**/*
26
+ Layout:
27
+ Exclude:
28
+ - config/environments/*
29
+ Style:
30
+ Exclude:
31
+ - spec/*_helper.rb
32
+ Style/BlockComments:
33
+ Exclude:
34
+ - config/**/*
35
+ - spec/**/*
36
+ Style/Documentation:
37
+ Enabled: false
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.before(:suite) do
5
+ DatabaseRewinder.clean_all
6
+ end
7
+
8
+ config.after(:each) do
9
+ DatabaseRewinder.clean
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ Shoulda::Matchers.configure do |config|
4
+ config.integrate do |with|
5
+ with.test_framework :rspec
6
+ with.library :rails
7
+ end
8
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ if ENV.fetch('COVERAGE', false)
4
+ require 'simplecov'
5
+ SimpleCov.start 'rails' do
6
+ add_filter 'vendor'
7
+ end
8
+ end
9
+
10
+ RSpec.configure do |config|
11
+ config.expect_with :rspec do |expectations|
12
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
13
+ end
14
+
15
+ config.mock_with :rspec do |mocks|
16
+ mocks.verify_partial_doubles = true
17
+ end
18
+
19
+ config.shared_context_metadata_behavior = :apply_to_host_groups
20
+ end
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bankai
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - 5xRuby
8
+ - 蒼時弦也
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2019-02-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.16'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.16'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler-audit
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: overcommit
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '10.0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '10.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '3.0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '3.0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: rubocop
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 0.60.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.60.0
98
+ - !ruby/object:Gem::Dependency
99
+ name: simplecov
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: rails
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - '='
117
+ - !ruby/object:Gem::Version
118
+ version: 5.2.2
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '='
124
+ - !ruby/object:Gem::Version
125
+ version: 5.2.2
126
+ description: The tool to generate Rails template for 5xRuby
127
+ email:
128
+ - hi@5xruby.tw
129
+ - contact0@frost.tw
130
+ executables:
131
+ - bankai
132
+ extensions: []
133
+ extra_rdoc_files: []
134
+ files:
135
+ - ".gitignore"
136
+ - ".overcommit.yml"
137
+ - ".rspec"
138
+ - ".travis.yml"
139
+ - CODE_OF_CONDUCT.md
140
+ - Gemfile
141
+ - README.md
142
+ - Rakefile
143
+ - bankai.gemspec
144
+ - bin/console
145
+ - bin/setup
146
+ - exe/bankai
147
+ - lib/bankai.rb
148
+ - lib/bankai/builder.rb
149
+ - lib/bankai/generator.rb
150
+ - lib/bankai/generators/base.rb
151
+ - lib/bankai/generators/ci_generator.rb
152
+ - lib/bankai/generators/db_optimizations_generator.rb
153
+ - lib/bankai/generators/deploy_generator.rb
154
+ - lib/bankai/generators/json_generator.rb
155
+ - lib/bankai/generators/lint_generator.rb
156
+ - lib/bankai/generators/mailer_generator.rb
157
+ - lib/bankai/generators/testing_generator.rb
158
+ - lib/bankai/version.rb
159
+ - templates/Gemfile.erb
160
+ - templates/README.md.erb
161
+ - templates/deploy.rb.erb
162
+ - templates/dotfiles/.ctags
163
+ - templates/dotfiles/.env.example
164
+ - templates/gitignore.erb
165
+ - templates/gitlab-ci.yml.erb
166
+ - templates/overcommit.yml.erb
167
+ - templates/rack_mini_profiler.rb
168
+ - templates/rails_helper.rb
169
+ - templates/rubocop.yml.erb
170
+ - templates/spec/database_rewinder.rb
171
+ - templates/spec/shoulda_matchers.rb
172
+ - templates/spec_helper.rb
173
+ homepage: https://github.com/5xRuby/bankai
174
+ licenses: []
175
+ metadata: {}
176
+ post_install_message:
177
+ rdoc_options: []
178
+ require_paths:
179
+ - lib
180
+ required_ruby_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: 2.5.0
185
+ required_rubygems_version: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ requirements: []
191
+ rubyforge_project:
192
+ rubygems_version: 2.7.6
193
+ signing_key:
194
+ specification_version: 4
195
+ summary: The Rails template for 5xRuby
196
+ test_files: []