This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
template.rb
78 lines (65 loc) · 2.06 KB
/
template.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
require 'fileutils'
def source_paths
[File.expand_path(File.dirname(__FILE__))]
end
p 'Overwrite files when conflictions happen'
if yes? "remove 'app/assets'?"
run 'rm -rf app/assets'
end
if yes? "remove 'test/'?"
run 'rm -rf test/'
end
if yes? 'need example page?'
copy_file 'app/views/home/index.html.erb'
copy_file 'app/controllers/home_controller.rb'
copy_file 'config/routes.rb'
copy_file 'spec/features/home_spec.rb'
end
if File.exists?(".gitignore")
append_to_file '.gitignore' do
'/public/bundles'
end
end
copy_file '.rspec'
copy_file '.stylelintrc.json'
copy_file '.babelrc.js'
copy_file '.eslintignore'
copy_file '.eslintrc.json'
copy_file '.browserslistrc'
copy_file 'jest.config.js'
copy_file 'tsconfig.json'
FileUtils.cp_r("#{File.expand_path(File.dirname(__FILE__))}/app/bundles", 'app/bundles')
copy_file 'app/helpers/webpack_bundle_helper.rb'
copy_file 'app/views/layouts/application.html.erb'
copy_file 'config/dev_server_proxy.rb'
copy_file 'config/environments/development.rb'
copy_file 'package.json'
copy_file 'spec/helpers/webpack_bundle_helper_spec.rb'
copy_file 'spec/rails_helper.rb'
copy_file 'spec/spec_helper.rb'
copy_file 'spec/supports/capybara.rb'
copy_file 'spec/supports/webpack.rb'
copy_file 'spec/javascripts/components/HelloMedbear.spec.ts'
copy_file 'spec/javascripts/components/__snapshots__/HelloMedbear.spec.ts.snap'
copy_file 'spec/javascripts/tsconfig.json'
copy_file 'webpack.common.js'
copy_file 'webpack.dev.js'
copy_file 'webpack.prod.js'
# gem install
gem_group :development do
gem 'rack-proxy'
end
gem_group :test do
gem 'capybara'
gem 'webdrivers'
gem 'rspec-rails'
gem 'factory_bot_rails'
end
run 'bundle install --path vendor/bundle --jobs=4'
run 'yarn install'
run 'yarn run dev'
p '---------------Confirm---------------'
p '1) Confirm and fix files when conflictions happen.'
p '2) Confirm unused gems due to webpack usage ex) sass-rails, uglifier, coffee-rails, thrbolinks, jquery-rails'
p '3) Confirm rspec settings and directory structure whether it keeps working.'
p '-------------------------------------'