Class: Hoboken::AddOns::TwitterBootstrap
- Inherits:
-
Group
- Object
- Thor::Group
- Group
- Hoboken::AddOns::TwitterBootstrap
show all
- Defined in:
- lib/hoboken/add_ons/twbs.rb
Overview
Twitter Bootstrap support.
Instance Method Summary
collapse
Methods inherited from Group
#classic?, #modular?, #rspec?, #rubocop?, #sequel?, source_root
#gem, #indent
Instance Method Details
#add_gem ⇒ Object
8
9
10
|
# File 'lib/hoboken/add_ons/twbs.rb', line 8
def add_gem
gem 'bootstrap', version: '5.0.0.beta3', group: :assets
end
|
#reminders ⇒ Object
45
46
47
|
# File 'lib/hoboken/add_ons/twbs.rb', line 45
def reminders
say "\nGemfile updated... don't forget to 'bundle install'"
end
|
#remove_normalize_css ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'lib/hoboken/add_ons/twbs.rb', line 36
def remove_normalize_css
gsub_file(
'views/layout.erb',
'<link rel="stylesheet" type="text/css" ' \
'href="//cdnjs.cloudflare.com/ajax/libs/normalize/2.1.3/normalize.min.css">',
''
)
end
|
#update_app ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/hoboken/add_ons/twbs.rb', line 12
def update_app
indentation = classic? ? 2 : 6
location = /configure do\n/
insert_into_file('config/environment.rb', after: location) do
indent("require 'bootstrap'\n", indentation)
end
end
|
#update_asset_files ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/hoboken/add_ons/twbs.rb', line 20
def update_asset_files
prepend_file('assets/stylesheets/styles.scss') do
<<~CODE
@import "bootstrap";
CODE
end
prepend_file('assets/javascripts/app.js') do
<<~CODE
//= require popper
//= require bootstrap-sprockets
CODE
end
end
|