bootswatch_rails 3.2.0.26 → 3.2.0.27
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: 57f25cb2adf0e144da5b1e3b5645d6e6ea607e25
|
4
|
+
data.tar.gz: 2bdc687b10d7667e380844c2d86e27233ec5344a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab89841df5b7abd1509fb16b228ae9a9c110c2dee5a9f770b4bbf4a3c1b7720adc2b914da0a3eba15fcf8becc4cc111126a0ec77b85f028bf93d3bfc0a763d6a
|
7
|
+
data.tar.gz: 6e6dbf8a3480afba84f39a0d9fdfd2852e94060d7dd340cd6667e958a6ade0ac1cdaf2ef7e4f0b932badab5ff66293c7617fa2dc69b2d3496a36db825e108192
|
@@ -1,6 +1,11 @@
|
|
1
1
|
module BootswatchRails
|
2
2
|
BOOTSTRAP = "3.2.0"
|
3
|
-
VERSION = "3.2.0.
|
3
|
+
VERSION = "3.2.0.27"
|
4
|
+
|
4
5
|
THEMES = [:amelia, :cerulean, :cosmo, :custom, :cyborg, :darkly, :flatly, :journal, :lumen, :paper, :readable, :sandstone, :simplex, :slate, :spacelab, :superhero, :united, :yeti]
|
5
6
|
DEFAULT = 1
|
7
|
+
|
8
|
+
GMAPS_API_STATIC = "//maps.google.com/maps/api/js?v=3.13&sensor=false&libraries=geometry"
|
9
|
+
GMAPS_API_MOBILE = "//maps.google.com/maps/api/js?v=3.13&sensor=true&libraries=geometry"
|
10
|
+
GMAPS_UTIL_MARKER = "//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js"
|
6
11
|
end
|
@@ -4,8 +4,10 @@ module BootswatchRails
|
|
4
4
|
desc "Setup application to use bootswatch.com"
|
5
5
|
class_option :turbolinks, type: :boolean, default: false,
|
6
6
|
desc: 'Activate turbolinks (off by default)'
|
7
|
+
class_option :gmaps, type: :boolean, default: false,
|
8
|
+
desc: 'Include Google Maps (requires gmaps4rails and underscore-rails)'
|
7
9
|
source_root File.expand_path("../templates", __FILE__)
|
8
|
-
|
10
|
+
|
9
11
|
def update_application_controller
|
10
12
|
file = "app/controllers/application_controller.rb"
|
11
13
|
inject_into_file file, "\n\n private", after: /protect_from_forgery.*$/
|
@@ -25,17 +27,29 @@ module BootswatchRails
|
|
25
27
|
]
|
26
28
|
inject_into_file file, lines.join("\n"), before: /^end$/
|
27
29
|
end
|
28
|
-
|
30
|
+
|
29
31
|
def copy_directories
|
30
32
|
directory "app", force: true
|
31
33
|
directory "config"
|
32
34
|
directory "lib", force: true
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup_head
|
33
38
|
template "head.html.erb", "app/views/layouts/_head.html.erb"
|
34
39
|
end
|
35
|
-
|
40
|
+
|
41
|
+
def add_gmaps
|
42
|
+
return unless options.gmaps?
|
43
|
+
file = "app/assets/javascripts/application.js"
|
44
|
+
inject_into_file file, after: /require jquery_ujs.*$/ do
|
45
|
+
"\n//= require underscore" +
|
46
|
+
"\n//= require gmaps/google"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
36
50
|
def remove_turbolinks
|
37
51
|
return if options.turbolinks?
|
38
|
-
comment_lines "Gemfile", /gem 'turbolinks/
|
52
|
+
# comment_lines "Gemfile", /gem 'turbolinks/
|
39
53
|
file = "app/assets/javascripts/application.js"
|
40
54
|
gsub_file file, /^\/\/= require turbolinks\s/, ""
|
41
55
|
file = "app/views/layouts/_head.html.erb"
|
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
<title><%%= content_for?(:title) ? yield(:title) : app_name %></title>
|
6
6
|
|
7
|
+
<%- if options.gmaps? -%>
|
8
|
+
<script src="<%= BootswatchRails::GMAPS_API_STATIC %>"></script>
|
9
|
+
<script src="<%= BootswatchRails::GMAPS_UTIL_MARKER %>"></script>
|
10
|
+
<%- end -%>
|
7
11
|
<%%- if content_for?(:head_common_pre) -%>
|
8
12
|
<%%= yield(:head_common_pre) %>
|
9
13
|
<%%- end -%>
|