google_static_maps_helper 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/google_static_maps_helper.gemspec +1 -1
- data/lib/google_static_maps_helper/map.rb +1 -1
- data/lib/google_static_maps_helper/marker.rb +1 -1
- data/spec/map_spec.rb +3 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{google_static_maps_helper}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Thorbj\303\270rn Hermansen"]
|
@@ -30,7 +30,7 @@ module GoogleStaticMapsHelper
|
|
30
30
|
params = []
|
31
31
|
(REQUIRED_OPTIONS + OPTIONAL_OPTIONS).each do |key|
|
32
32
|
value = send(key)
|
33
|
-
params << "#{key}=#{URI.escape(value.to_s)}"
|
33
|
+
params << "#{key}=#{URI.escape(value.to_s)}" unless value.nil?
|
34
34
|
end
|
35
35
|
out += params.join('&')
|
36
36
|
|
@@ -46,7 +46,7 @@ module GoogleStaticMapsHelper
|
|
46
46
|
def options_to_url_params
|
47
47
|
params = DEFAULT_OPTIONS.keys.map(&:to_s).sort.inject([]) do |params, attr|
|
48
48
|
value = send(attr)
|
49
|
-
params << "#{attr}:#{URI.escape(value)}"
|
49
|
+
params << "#{attr}:#{URI.escape(value)}" unless value.nil?
|
50
50
|
params
|
51
51
|
end
|
52
52
|
|
data/spec/map_spec.rb
CHANGED
@@ -76,7 +76,7 @@ describe GoogleStaticMapsHelper::Map do
|
|
76
76
|
before :each do
|
77
77
|
@key = 'MY_GOOGLE_KEY'
|
78
78
|
@size = '400x600'
|
79
|
-
@sensor =
|
79
|
+
@sensor = false
|
80
80
|
@map = GoogleStaticMapsHelper::Map.new(:key => @key, :size => @size, :sensor => @sensor)
|
81
81
|
|
82
82
|
@marker1 = GoogleStaticMapsHelper::Marker.new(:lng => 1, :lat => 2)
|
@@ -154,7 +154,7 @@ describe GoogleStaticMapsHelper::Map do
|
|
154
154
|
|
155
155
|
[
|
156
156
|
['key', 'MY_GOOGLE_KEY'],
|
157
|
-
['sensor', '
|
157
|
+
['sensor', 'false'],
|
158
158
|
['size', '400x600'],
|
159
159
|
['markers', 'color:green|size:mid|6,5'],
|
160
160
|
['markers', 'color:red|size:mid|2,1']
|
@@ -168,6 +168,7 @@ describe GoogleStaticMapsHelper::Map do
|
|
168
168
|
|
169
169
|
describe "with markers grouped together" do
|
170
170
|
before :each do
|
171
|
+
@map.sensor = true
|
171
172
|
@map << @marker1
|
172
173
|
@map << @marker11
|
173
174
|
@map << @marker2
|