Skip to content

Commit 10bf738

Browse files
committed
build using rails_apps_composer 3.1.25
1 parent 6068738 commit 10bf738

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

composer.rb

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ def which(cmd)
466466
prefs[:email] = 'sendgrid'
467467
prefs[:form_builder] = false
468468
prefs[:frontend] = 'bootstrap3'
469+
prefs[:jquery] = 'gem'
469470
prefs[:layouts] = 'none'
470471
prefs[:pages] = 'none'
471472
prefs[:github] = false
@@ -486,7 +487,6 @@ def which(cmd)
486487
add_gem 'high_voltage'
487488
add_gem 'gibbon'
488489
add_gem 'minitest-spec-rails', :group => :test
489-
add_gem 'minitest-rails-capybara', :group => :test
490490
gsub_file 'Gemfile', /gem 'sqlite3'\n/, ''
491491
add_gem 'sqlite3', :group => :development
492492

@@ -1234,6 +1234,19 @@ def which(cmd)
12341234
["Simple CSS", "simple"]] unless prefs.has_key? :frontend
12351235
end
12361236

1237+
## jQuery
1238+
if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1
1239+
if prefs[:frontend] == 'none'
1240+
prefs[:jquery] = multiple_choice "Add jQuery?", [["No", "none"],
1241+
["Add jquery-rails gem", "gem"],
1242+
["Add using yarn", "yarn"]] unless prefs.has_key? :jquery
1243+
else
1244+
prefs[:jquery] = multiple_choice "How to install jQuery?",
1245+
[["Add jquery-rails gem", "gem"],
1246+
["Add using yarn", "yarn"]] unless prefs.has_key? :jquery
1247+
end
1248+
end
1249+
12371250
## Email
12381251
if recipes.include? 'email'
12391252
unless prefs.has_key? :email
@@ -1655,6 +1668,14 @@ def which(cmd)
16551668
add_gem 'foundation-rails', '~> 5.5'
16561669
end
16571670

1671+
## jQuery
1672+
case prefs[:jquery]
1673+
when 'gem'
1674+
add_gem 'jquery-rails'
1675+
when 'yarn'
1676+
run 'bundle exec yarn add jquery'
1677+
end
1678+
16581679
## Pages
16591680
case prefs[:pages]
16601681
when 'about'
@@ -2098,6 +2119,12 @@ def set_default_role
20982119
generate 'layout:install foundation4 -f'
20992120
when 'foundation5'
21002121
generate 'layout:install foundation5 -f'
2122+
else
2123+
case prefs[:jquery]
2124+
when 'gem', 'yarn'
2125+
say_wizard "modifying application.js for jQuery"
2126+
insert_into_file('app/assets/javascripts/application.js', "//= require jquery\n", :before => /^ *\/\/= require rails-ujs/, :force => false)
2127+
end
21012128
end
21022129

21032130
### GIT ###

0 commit comments

Comments
 (0)