bootswatch_rails 3.2.0.2 → 3.2.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c53416b94639991b391d9fe00e53c01ca9f26c2
|
4
|
+
data.tar.gz: bf40c9f4b1783b10722d2b70ef200fed005e6d17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3c4bc7eab4531722a723651fd9f288ac5c5111a6268f05a8a77c1150b351003aba8fa552eeb43e904be0413d8204585cba103898200f8a74e4ac886ac99a1a
|
7
|
+
data.tar.gz: e1ecbaaddd55f2bfb95ffad32e1f3704e2c5bc38f676fb722edef1a5cae19ff46c9eecf4d3889c888db160a81fbc3fbef84d6c488331f3d94fc7f0328ebe2e49
|
@@ -4,12 +4,18 @@ module BootswatchRails
|
|
4
4
|
desc "Setup application to use bootswatch.com"
|
5
5
|
class_option :bootstrap, type: :boolean, default: true,
|
6
6
|
desc: 'Add bootstrap to application.js'
|
7
|
+
class_option :turbolinks, type: :boolean, default: false,
|
8
|
+
desc: 'Activate turbolinks (off by default)'
|
7
9
|
source_root File.expand_path("../templates", __FILE__)
|
8
10
|
|
9
11
|
def update_javascripts
|
10
12
|
return unless options.bootstrap?
|
11
13
|
file = "app/assets/javascripts/application.js"
|
12
14
|
inject_into_file file, "\n//= require bootstrap", after: /require jquery_ujs$/
|
15
|
+
unless options.turbolinks?
|
16
|
+
gsub_file file, /^\/\/(= require turbolinks)/, "//---\\1"
|
17
|
+
comment_lines "Gemfile", /gem 'turbolinks/
|
18
|
+
end
|
13
19
|
end
|
14
20
|
|
15
21
|
def update_application_controller
|
@@ -37,6 +43,12 @@ module BootswatchRails
|
|
37
43
|
directory "config"
|
38
44
|
directory "lib", force: true
|
39
45
|
end
|
46
|
+
|
47
|
+
def remove_turbolinks
|
48
|
+
return if options.turbolinks?
|
49
|
+
file = "app/views/layouts/_head.html.erb"
|
50
|
+
gsub_file file, /, 'data-turbolinks-track' => true/, ""
|
51
|
+
end
|
40
52
|
end
|
41
53
|
end
|
42
54
|
end
|