google_static_maps_helper 1.3.5 → 1.3.6

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fb2cf5a46fb0389cb15f50c123b5f25912042acc696d2a77b3533e40521ad748
4
+ data.tar.gz: '086ab64337f17341e7d39db40f288aa923639b33e1d8be52bc55c5c375f45dd2'
5
+ SHA512:
6
+ metadata.gz: '09f089517c0a8799e6311bcc9379b7d26cb5f9663826b7f13cea55a0a133471ca1a4b5bd1acebaf84747d2578e06aab7e4f391c446eb664046db6fb18e70960a'
7
+ data.tar.gz: 1a51250b94dfda754f344e50b224c14ae608221a3d74b43d497492cb5dfa3c097601a3fffaf634afce5028388d3f5c81824999bb4efba0f1bae3121d9a154cba
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,35 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ google_static_maps_helper (1.3.6)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.3)
10
+ rake (13.0.1)
11
+ rspec (3.9.0)
12
+ rspec-core (~> 3.9.0)
13
+ rspec-expectations (~> 3.9.0)
14
+ rspec-mocks (~> 3.9.0)
15
+ rspec-core (3.9.2)
16
+ rspec-support (~> 3.9.3)
17
+ rspec-expectations (3.9.2)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.9.0)
20
+ rspec-mocks (3.9.1)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.9.0)
23
+ rspec-support (3.9.3)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ bundler (>= 1.6)
30
+ google_static_maps_helper!
31
+ rake (>= 10.0)
32
+ rspec
33
+
34
+ BUNDLED WITH
35
+ 2.1.4
data/Rakefile CHANGED
@@ -1,49 +1 @@
1
- # -*- encoding: utf-8 -*-
2
- require 'rubygems'
3
- require 'rake'
4
-
5
- begin
6
- require 'jeweler'
7
- Jeweler::Tasks.new do |gem|
8
- gem.name = "google_static_maps_helper"
9
- gem.summary = %Q{This gem provides a simple interface to the Google Static Maps V2 API}
10
- gem.description = %Q{This gem provides a simple interface to the Google Static Maps V2 API.}
11
- gem.email = "thhermansen@gmail.com"
12
- gem.homepage = "http://github.com/thhermansen/google_static_maps_helper"
13
- gem.authors = ["Thorbjørn Hermansen"]
14
- gem.add_development_dependency "rspec"
15
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
- end
17
- rescue LoadError
18
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
19
- end
20
-
21
- require 'spec/rake/spectask'
22
- Spec::Rake::SpecTask.new(:spec) do |spec|
23
- spec.libs << 'lib' << 'spec'
24
- spec.spec_files = FileList['spec/**/*_spec.rb']
25
- end
26
-
27
- Spec::Rake::SpecTask.new(:rcov) do |spec|
28
- spec.libs << 'lib' << 'spec'
29
- spec.pattern = 'spec/**/*_spec.rb'
30
- spec.rcov = true
31
- end
32
-
33
- task :spec => :check_dependencies
34
-
35
- task :default => :spec
36
-
37
- require 'rake/rdoctask'
38
- Rake::RDocTask.new do |rdoc|
39
- if File.exist?('VERSION')
40
- version = File.read('VERSION')
41
- else
42
- version = ""
43
- end
44
-
45
- rdoc.rdoc_dir = 'rdoc'
46
- rdoc.title = "google_static_maps_helper #{version}"
47
- rdoc.rdoc_files.include('README*')
48
- rdoc.rdoc_files.include('lib/**/*.rb')
49
- end
1
+ require "bundler/gem_tasks"
data/changelog.txt CHANGED
@@ -1,3 +1,6 @@
1
+ = v.1.3.6
2
+ * Removed deprecation warnings `URI.escape is obsolete` in Ruby 2.7 (by morgoth)
3
+
1
4
  = v.1.3.5
2
5
  * Added support for icon on markers.
3
6
  * DEPRECATED Google API key as its no longer required when requesting a static map (will be removed from this gem in upcoming versions).
@@ -1,68 +1,31 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ require_relative "lib/google_static_maps_helper/version"
5
3
 
6
- Gem::Specification.new do |s|
7
- s.name = %q{google_static_maps_helper}
8
- s.version = "1.3.5"
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "google_static_maps_helper"
6
+ spec.version = GoogleStaticMapsHelper::VERSION
7
+ spec.authors = ["Thorbjørn Hermansen"]
8
+ spec.email = ["thhermansen@gmail.com"]
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Thorbj\303\270rn Hermansen"]
12
- s.date = %q{2010-03-08}
13
- s.description = %q{This gem provides a simple interface to the Google Static Maps V2 API.}
14
- s.email = %q{thhermansen@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "changelog.txt",
27
- "google_static_maps_helper.gemspec",
28
- "lib/google_static_maps_helper.rb",
29
- "lib/google_static_maps_helper/gmap_polyline_encoder.rb",
30
- "lib/google_static_maps_helper/location.rb",
31
- "lib/google_static_maps_helper/map.rb",
32
- "lib/google_static_maps_helper/marker.rb",
33
- "lib/google_static_maps_helper/path.rb",
34
- "spec/google_static_maps_helper_spec.rb",
35
- "spec/location_spec.rb",
36
- "spec/map_spec.rb",
37
- "spec/marker_spec.rb",
38
- "spec/path_spec.rb",
39
- "spec/spec_helper.rb"
40
- ]
41
- s.homepage = %q{http://github.com/thhermansen/google_static_maps_helper}
42
- s.rdoc_options = ["--charset=UTF-8"]
43
- s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.3.5}
45
- s.summary = %q{This gem provides a simple interface to the Google Static Maps V2 API}
46
- s.test_files = [
47
- "spec/path_spec.rb",
48
- "spec/marker_spec.rb",
49
- "spec/map_spec.rb",
50
- "spec/location_spec.rb",
51
- "spec/google_static_maps_helper_spec.rb",
52
- "spec/spec_helper.rb"
53
- ]
10
+ spec.summary = %Q{This gem provides a simple interface to the Google Static Maps V2 API}
11
+ spec.description = %Q{This gem provides a simple interface to the Google Static Maps V2 API.}
12
+ spec.homepage = "http://github.com/thhermansen/google_static_maps_helper"
13
+ spec.license = "MIT"
54
14
 
55
- if s.respond_to? :specification_version then
56
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
- s.specification_version = 3
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = "http://github.com/thhermansen/google_static_maps_helper"
17
+ spec.metadata["changelog_uri"] = "https://github.com/thhermansen/google_static_maps_helper/blob/master/changelog.txt"
58
18
 
59
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
60
- s.add_development_dependency(%q<rspec>, [">= 0"])
61
- else
62
- s.add_dependency(%q<rspec>, [">= 0"])
63
- end
64
- else
65
- s.add_dependency(%q<rspec>, [">= 0"])
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
66
23
  end
67
- end
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
68
27
 
28
+ spec.add_development_dependency "bundler", ">= 1.6"
29
+ spec.add_development_dependency "rake", ">= 10.0"
30
+ spec.add_development_dependency "rspec"
31
+ end
@@ -7,7 +7,7 @@ module GoogleStaticMapsHelper
7
7
  #
8
8
  class Map
9
9
  include Enumerable
10
-
10
+
11
11
  MAX_WIDTH = 640
12
12
  MAX_HEIGHT = 640
13
13
 
@@ -16,7 +16,7 @@ module GoogleStaticMapsHelper
16
16
 
17
17
  REQUIRED_OPTIONS = [:size, :sensor]
18
18
  OPTIONAL_OPTIONS = [:key, :center, :zoom, :format, :maptype, :mobile, :language]
19
-
19
+
20
20
  attr_accessor *(REQUIRED_OPTIONS + OPTIONAL_OPTIONS)
21
21
  attr_accessor :width, :height
22
22
 
@@ -49,13 +49,13 @@ module GoogleStaticMapsHelper
49
49
  #
50
50
  def url
51
51
  raise BuildDataMissing, "We have to have markers, paths or center and zoom set when url is called!" unless can_build?
52
-
52
+
53
53
  out = "#{API_URL}?"
54
54
 
55
55
  params = []
56
56
  (REQUIRED_OPTIONS + OPTIONAL_OPTIONS).each do |key|
57
57
  value = send(key)
58
- params << "#{key}=#{URI.escape(value.to_s)}" unless value.nil?
58
+ params << "#{key}=#{URI::DEFAULT_PARSER.escape(value.to_s)}" unless value.nil?
59
59
  end
60
60
  out += params.join('&')
61
61
 
@@ -65,7 +65,7 @@ module GoogleStaticMapsHelper
65
65
  params << "markers=#{marker_options_as_url_params}|#{markers_locations}"
66
66
  end
67
67
  out += "&#{params.join('&')}" unless params.empty?
68
-
68
+
69
69
  params = []
70
70
  paths.each {|path| params << path.url_params}
71
71
  out += "&#{params.join('&')}" unless params.empty?
@@ -93,13 +93,13 @@ module GoogleStaticMapsHelper
93
93
  end
94
94
  end
95
95
 
96
- #
96
+ #
97
97
  # Returns all the paths which this map holds
98
98
  #
99
99
  def paths
100
100
  @map_enteties.select {|e| e.is_a? Path}
101
101
  end
102
-
102
+
103
103
  #
104
104
  # Pushes either a Marker or a Path on to the map
105
105
  #
@@ -135,7 +135,7 @@ module GoogleStaticMapsHelper
135
135
  def path(*args) # :nodoc:
136
136
  self << Path.new(*args)
137
137
  end
138
-
138
+
139
139
  #
140
140
  # Sets the size of the map
141
141
  #
@@ -159,14 +159,14 @@ module GoogleStaticMapsHelper
159
159
  self.height = height if height
160
160
  end
161
161
  end
162
-
162
+
163
163
  #
164
164
  # Returns size as a string, "wxh"
165
165
  #
166
166
  def size
167
167
  [@width, @height].join('x')
168
168
  end
169
-
169
+
170
170
  #
171
171
  # Defines width and height setter methods
172
172
  #
@@ -32,7 +32,7 @@ module GoogleStaticMapsHelper
32
32
  #
33
33
  # # Sets location via object which responds to lng and lat
34
34
  # GoogleStaticMapsHelper::Marker.new(location {:label => :a})
35
- #
35
+ #
36
36
  # # ..or include the lng and lat in the option hash
37
37
  # GoogleStaticMapsHelper::Marker.new(:lng => 1, :lat => 2, :label => :a)
38
38
  #
@@ -44,7 +44,7 @@ module GoogleStaticMapsHelper
44
44
  options.each_pair { |k, v| send("#{k}=", v) }
45
45
  end
46
46
 
47
- #
47
+ #
48
48
  # Returns a string representing this marker
49
49
  # Used by the Map when building url.
50
50
  #
@@ -54,20 +54,20 @@ module GoogleStaticMapsHelper
54
54
  secondary_getter = attr
55
55
 
56
56
  value = send(primary_getter) rescue send(secondary_getter)
57
- params << "#{attr}:#{URI.escape(value.to_s)}" unless value.nil?
57
+ params << "#{attr}:#{URI::DEFAULT_PARSER.escape(value.to_s)}" unless value.nil?
58
58
  params
59
59
  end
60
60
 
61
61
  params.join('|')
62
62
  end
63
63
 
64
- #
64
+ #
65
65
  # Concatenation of lat and lng value. Used when building URLs and returns them in correct order
66
66
  #
67
67
  def location_to_url # :nodoc:
68
68
  @location.to_url
69
69
  end
70
-
70
+
71
71
  def label # :nodoc:
72
72
  @label.to_s.upcase if @label
73
73
  end
@@ -104,13 +104,13 @@ module GoogleStaticMapsHelper
104
104
  # Some attributes should be nil when a marker has icon
105
105
  [:color, :label, :size].each do |getter|
106
106
  define_method "#{getter}_to_be_used_in_param" do
107
- return nil if has_icon?
107
+ return nil if has_icon?
108
108
  send(getter)
109
109
  end
110
110
  end
111
111
 
112
112
  def shadow_to_be_used_in_param
113
- return nil unless has_icon?
113
+ return nil unless has_icon?
114
114
  shadow
115
115
  end
116
116
  end
@@ -14,7 +14,7 @@ module GoogleStaticMapsHelper
14
14
  #
15
15
  # Creates a new Path which you can push points on to to make up lines or polygons
16
16
  #
17
- # The following options are available, for more information see the
17
+ # The following options are available, for more information see the
18
18
  # Google API documentation[http://code.google.com/apis/maps/documentation/staticmaps/#Paths].
19
19
  #
20
20
  # <tt>:weight</tt>:: The weight is the thickness of the line, defaults to 5
@@ -30,7 +30,7 @@ module GoogleStaticMapsHelper
30
30
  def initialize(*args)
31
31
  @points = []
32
32
  @encode_points = true
33
-
33
+
34
34
  extract_options!(args)
35
35
  add_points(args)
36
36
  end
@@ -42,10 +42,10 @@ module GoogleStaticMapsHelper
42
42
  def url_params # :nodoc:
43
43
  raise BuildDataMissing, "Need at least 2 points to create a path!" unless can_build?
44
44
  out = 'path='
45
-
45
+
46
46
  path_params = OPTIONAL_OPTIONS.inject([]) do |path_params, attribute|
47
47
  value = send(attribute)
48
- path_params << "#{attribute}:#{URI.escape(value.to_s)}" unless value.nil?
48
+ path_params << "#{attribute}:#{URI::DEFAULT_PARSER.escape(value.to_s)}" unless value.nil?
49
49
  path_params
50
50
  end.join('|')
51
51
 
@@ -56,10 +56,10 @@ module GoogleStaticMapsHelper
56
56
  out
57
57
  end
58
58
 
59
-
59
+
60
60
  #
61
61
  # Sets the points of this Path.
62
- #
62
+ #
63
63
  # *WARNING* Using this method will clear out any points which might be set.
64
64
  #
65
65
  def points=(array)
@@ -115,8 +115,8 @@ module GoogleStaticMapsHelper
115
115
  return point if point.instance_of? Location
116
116
  Location.new(point)
117
117
  end
118
-
119
- #
118
+
119
+ #
120
120
  # Do we have enough points to build a path?
121
121
  #
122
122
  def can_build?
@@ -0,0 +1,3 @@
1
+ module GoogleStaticMapsHelper
2
+ VERSION = "1.3.6"
3
+ end
metadata CHANGED
@@ -1,43 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: google_static_maps_helper
3
- version: !ruby/object:Gem::Version
4
- version: 1.3.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.6
5
5
  platform: ruby
6
- authors:
7
- - "Thorbj\xC3\xB8rn Hermansen"
6
+ authors:
7
+ - Thorbjørn Hermansen
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
-
12
- date: 2010-03-08 00:00:00 +01:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
11
+ date: 2020-05-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
16
42
  name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
17
48
  type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
21
52
  - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
25
55
  description: This gem provides a simple interface to the Google Static Maps V2 API.
26
- email: thhermansen@gmail.com
56
+ email:
57
+ - thhermansen@gmail.com
27
58
  executables: []
28
-
29
59
  extensions: []
30
-
31
- extra_rdoc_files:
32
- - LICENSE
33
- - README.rdoc
34
- files:
35
- - .document
36
- - .gitignore
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".document"
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - Gemfile.lock
37
66
  - LICENSE
38
67
  - README.rdoc
39
68
  - Rakefile
40
- - VERSION
41
69
  - changelog.txt
42
70
  - google_static_maps_helper.gemspec
43
71
  - lib/google_static_maps_helper.rb
@@ -46,44 +74,31 @@ files:
46
74
  - lib/google_static_maps_helper/map.rb
47
75
  - lib/google_static_maps_helper/marker.rb
48
76
  - lib/google_static_maps_helper/path.rb
49
- - spec/google_static_maps_helper_spec.rb
50
- - spec/location_spec.rb
51
- - spec/map_spec.rb
52
- - spec/marker_spec.rb
53
- - spec/path_spec.rb
54
- - spec/spec_helper.rb
55
- has_rdoc: true
77
+ - lib/google_static_maps_helper/version.rb
56
78
  homepage: http://github.com/thhermansen/google_static_maps_helper
57
- licenses: []
58
-
79
+ licenses:
80
+ - MIT
81
+ metadata:
82
+ homepage_uri: http://github.com/thhermansen/google_static_maps_helper
83
+ source_code_uri: http://github.com/thhermansen/google_static_maps_helper
84
+ changelog_uri: https://github.com/thhermansen/google_static_maps_helper/blob/master/changelog.txt
59
85
  post_install_message:
60
- rdoc_options:
61
- - --charset=UTF-8
62
- require_paths:
86
+ rdoc_options: []
87
+ require_paths:
63
88
  - lib
64
- required_ruby_version: !ruby/object:Gem::Requirement
65
- requirements:
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
66
91
  - - ">="
67
- - !ruby/object:Gem::Version
68
- version: "0"
69
- version:
70
- required_rubygems_version: !ruby/object:Gem::Requirement
71
- requirements:
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
72
96
  - - ">="
73
- - !ruby/object:Gem::Version
74
- version: "0"
75
- version:
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
76
99
  requirements: []
77
-
78
- rubyforge_project:
79
- rubygems_version: 1.3.5
100
+ rubygems_version: 3.0.3
80
101
  signing_key:
81
- specification_version: 3
102
+ specification_version: 4
82
103
  summary: This gem provides a simple interface to the Google Static Maps V2 API
83
- test_files:
84
- - spec/path_spec.rb
85
- - spec/marker_spec.rb
86
- - spec/map_spec.rb
87
- - spec/location_spec.rb
88
- - spec/google_static_maps_helper_spec.rb
89
- - spec/spec_helper.rb
104
+ test_files: []