gmaps4rails 1.4.7 → 1.4.8
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.
@@ -1,6 +1,6 @@
|
|
1
1
|
<% #thanks to enable_css, user can avoid this css to be loaded
|
2
2
|
if enable_css == true && options[:scripts].nil? %>
|
3
|
-
<%
|
3
|
+
<% unless gmaps4rails_pipeline_enabled? %>
|
4
4
|
<% content_for :head do %>
|
5
5
|
<%= stylesheet_link_tag 'gmaps4rails' %>
|
6
6
|
<% end %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<% end %>
|
20
20
|
<% end %>
|
21
21
|
|
22
|
-
<%
|
22
|
+
<% unless gmaps4rails_pipeline_enabled? %>
|
23
23
|
<% unless scripts.try(:to_sym) == :api %>
|
24
24
|
<%= javascript_include_tag 'gmaps4rails/gmaps4rails.base.js' %>
|
25
25
|
<% end %>
|
data/lib/gmaps4rails.rb
CHANGED
@@ -1,36 +1,34 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
module Gmaps4rails
|
2
|
+
require 'rails'
|
3
|
+
require 'gmaps4rails/base'
|
4
|
+
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
|
7
|
+
initializer "gmaps4rails view helpers" do |app|
|
8
|
+
ActionView::Base.send :include, Gmaps4railsHelper
|
9
|
+
end
|
10
|
+
|
11
|
+
initializer "add asset directories to pipeline" do |app|
|
12
|
+
if Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR >= 1
|
13
|
+
app.config.assets.paths << "#{root}/public/stylesheets"
|
14
|
+
else
|
15
|
+
app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
10
16
|
end
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
class Railtie < Rails::Railtie
|
22
|
+
|
23
|
+
initializer "include acts_as_gmappable within ORM" do
|
24
|
+
ActiveSupport.on_load(:active_record) do
|
25
|
+
ActiveRecord::Base.send(:include, Gmaps4rails::ActsAsGmappable)
|
18
26
|
end
|
19
27
|
|
20
|
-
|
21
|
-
|
22
|
-
class Railtie < Rails::Railtie
|
23
|
-
|
24
|
-
initializer "include acts_as_gmappable within ORM" do
|
25
|
-
ActiveSupport.on_load(:active_record) do
|
26
|
-
ActiveRecord::Base.send(:include, Gmaps4rails::ActsAsGmappable)
|
27
|
-
end
|
28
|
-
|
29
|
-
ActiveSupport.on_load(:mongoid) do
|
30
|
-
Mongoid::Document.send(:include, Gmaps4rails::ActsAsGmappable)
|
31
|
-
end
|
28
|
+
ActiveSupport.on_load(:mongoid) do
|
29
|
+
Mongoid::Document.send(:include, Gmaps4rails::ActsAsGmappable)
|
32
30
|
end
|
33
|
-
|
34
|
-
|
31
|
+
end
|
32
|
+
|
35
33
|
end
|
36
|
-
end
|
34
|
+
end
|
@@ -46,4 +46,8 @@ module Gmaps4railsHelper
|
|
46
46
|
def gmaps4rails_html(map_options = nil)
|
47
47
|
render "/gmaps4rails/html", :map_options => map_options
|
48
48
|
end
|
49
|
+
|
50
|
+
def gmaps4rails_pipeline_enabled?
|
51
|
+
Rails.configuration.methods.include?(:assets) && Rails.configuration.assets.enabled
|
52
|
+
end
|
49
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmaps4rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-16 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
17
|
-
requirement: &
|
17
|
+
requirement: &2157065020 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2157065020
|
26
26
|
description: ! 'Enables easy display of items (taken from a Rails 3 model) on a Google
|
27
27
|
Maps (JS API V3), OpenLayers, Mapquest and Bing. Geocoding + Directions included.
|
28
28
|
Provides much options: markers customization, infowindows, auto-adjusted zoom, polylines,
|