-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue4
126 lines (102 loc) · 3.46 KB
/
vue4
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
gem 'webpacker', '>= 4.x'
gem 'vueonrails', '~> 1.x'
route "mount Vueonrails::Engine, at: 'vue'"
# Use --bootstrap to add bootstrap style with jquery. Read more https://getbootstrap.com
# Read more about the full options of this application template, please go to github.com/vueonrails/vueonrails
if ARGV.include? "--bootstrap"
gem 'bootstrap', '~> 4.1.3'
gem 'jquery-rails'
end
# Use --foundation to add foundation style. Read more https://foundation.zurb.com
# Read more about the full options of this application template, please go to github.com/vueonrails/vueonrails
if ARGV.include? "--foundation"
gem 'foundation-rails'
gem 'autoprefixer-rails'
end
# Add font-awesome fonts
if ARGV.include? "--fontawesome"
gem "font-awesome-rails"
end
# Add live-reloading to refresh Rails view https://github.com/guard/guard-livereload
if ARGV.include? "--livereload"
gem_group :development do
gem 'guard'
gem 'guard-livereload', '~> 2.5', require: false
end
end
# Add whenever for automating cron jobs. Read more https://github.com/javan/whenever
if ARGV.include? "--whenever"
gem 'whenever', require: false
end
# Use --devise to add Devise. Read more https://github.com/plataformatec/devise
# Read more about the full options of this application template, please go to http://github.com/vueonrails/vueonrails
if ARGV.include? "--devise"
gem 'devise', '~> 4.4', '>= 4.4.3'
end
# Use --admin to add Administrate as your administrative manager. Read more https://github.com/thoughtbot/administrate
if ARGV.include? "--admin"
gem 'administrate'
end
# Use --sidekiq to add Sidekiq as your background processor. Read more https://github.com/mperham/sidekiq
if ARGV.include? "--sidekiq"
gem 'sidekiq'
end
run 'bundle install'
unless ARGV.include? "--no-page"
generate(:scaffold, 'page')
route "root to: 'pages#index'"
end
rails_command 'db:create'
rails_command 'db:migrate'
rails_command 'webpacker:install'
rails_command 'webpacker:install:vue'
run "yarn add @rails/webpacker@next"
# Vue on Rails setup to install Vue dependencies, Vue component generators
# Configuration and Jest dependencies. Read more http://github.com/vueonrails/vueonrails
rails_command 'vue:setup'
# Gem setup after bundle install
if ARGV.include? "--foundation"
rails_command 'generate foundation:install'
end
# Init livereload
if ARGV.include? "--livereload"
run "guard init livereload"
end
# Finish the fontawesome setup
if ARGV.include? "--fontawesome"
fontawesome = <<-eos
*= require font-awesome
eos
insert_into_file "app/assets/stylesheets/application.css",
fontawesome, before: " *= require_self"
end
# Finish the bootstrap setup
if ARGV.include? "--bootstrap"
run "mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss"
bootstrapcss = <<-eos
@import "bootstrap";
eos
insert_into_file "app/assets/stylesheets/application.scss",
bootstrapcss, after: " */\n"
bootstrap = <<-eos
//= require jquery3
//= require bootstrap-sprockets
eos
insert_into_file "app/assets/javascripts/application.js",
bootstrap, before: "//= require_tree ."
end
# Finish the administrate setup.
if ARGV.include? "--admin"
rails_command 'generate administrate:install'
end
# Finish the whenever gem setup.
if ARGV.include? "--whenever"
run "wheneverize ."
end
# Finish the devise installation.
if ARGV.include? "--devise"
rails_command "generate devise:install"
end
# Generate your first git commit message.
git add: "."
git commit: %Q{ -m 'First commit' }