bootswatch_rails 3.2.0.26 → 3.2.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d86c1aeea386f4341f688b5807016c369e2fb39
4
- data.tar.gz: eac9d89513c6a5d03a29c7aead79ffd9df139cad
3
+ metadata.gz: 57f25cb2adf0e144da5b1e3b5645d6e6ea607e25
4
+ data.tar.gz: 2bdc687b10d7667e380844c2d86e27233ec5344a
5
5
  SHA512:
6
- metadata.gz: e05ac5bf017a2ec48d2865d02715a25187ffdac04f308bd2c0aafaf933b784aaf38ab03f819aa8a9c0dfcf371da773adf1e5a3d703b5904e5b3386f926658754
7
- data.tar.gz: c9838c2e0b6c179b09dadf890dadf3c029f04576f4b5b8d97c21faee71d42c3eb190b9efe83ba99b74236ef205a2d435ec7f9be8cbd6f831890026b7a8c5bf91
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.26"
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 -%>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootswatch_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0.26
4
+ version: 3.2.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volker Wiegand