travlrmap 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cbd4ee983108002c9123f4ee18b7feaf41211776
4
+ data.tar.gz: aa0ba4789329d23111ef3163018d426453d55c88
5
+ SHA512:
6
+ metadata.gz: 64791fc2b52ca5227b611336052a8960af8c63330b313df74db25f6da0f3bc1c161f53cdd99f448a90e5c50ed632a4cd764fe42631d54b3ae9e6995fe3be3689
7
+ data.tar.gz: 7017617b29ba8d095357ebda10b16b7210f1685ce2de1759b372e1250084d6fa8095409003aa9d61d677b44edf3fdffb9f5a52e598cb609730f05c676fc04ab0
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'sinatra'
4
- gem 'httparty', '0.11.0'
5
- gem 'json'
6
- gem 'ruby_kml'
7
- gem 'nokogiri', '1.5.2'
3
+ gem 'sinatra', '~> 1.4'
4
+ gem 'httparty', '~> 0.13'
5
+ gem 'json', '~> 1.8'
6
+ gem 'ruby_kml', '~> 0.1'
7
+ gem 'nokogiri', '~> 1.6'
8
8
  gem 'rack', '1.5.2'
@@ -2,13 +2,14 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  builder (3.2.2)
5
- httparty (0.11.0)
6
- multi_json (~> 1.0)
5
+ httparty (0.13.3)
6
+ json (~> 1.8)
7
7
  multi_xml (>= 0.5.2)
8
- json (1.8.1)
9
- multi_json (1.10.1)
8
+ json (1.8.2)
9
+ mini_portile (0.6.2)
10
10
  multi_xml (0.5.5)
11
- nokogiri (1.5.2)
11
+ nokogiri (1.6.6.1)
12
+ mini_portile (~> 0.6.0)
12
13
  rack (1.5.2)
13
14
  rack-protection (1.5.3)
14
15
  rack
@@ -25,9 +26,9 @@ PLATFORMS
25
26
  ruby
26
27
 
27
28
  DEPENDENCIES
28
- httparty (= 0.11.0)
29
- json
30
- nokogiri (= 1.5.2)
29
+ httparty (~> 0.13)
30
+ json (~> 1.8)
31
+ nokogiri (~> 1.6)
31
32
  rack (= 1.5.2)
32
- ruby_kml
33
- sinatra
33
+ ruby_kml (~> 0.1)
34
+ sinatra (~> 1.4)
@@ -4,10 +4,14 @@ require 'yaml'
4
4
  require 'sinatra'
5
5
  require 'json'
6
6
  require "digest/md5"
7
+ require 'cgi'
7
8
 
8
9
  Bundler.require(:default)
9
10
 
10
11
  module Travlrmap
11
12
  require 'travlrmap/version'
13
+ require 'travlrmap/util'
14
+ require 'travlrmap/point'
15
+ require 'travlrmap/points'
12
16
  require 'travlrmap/sinatra_app'
13
17
  end
@@ -0,0 +1,120 @@
1
+ module Travlrmap
2
+ class Point
3
+ def initialize(from, types, type=:json)
4
+ @point = {}
5
+ @types = types
6
+
7
+ if from.is_a?(Hash)
8
+ from_hash(from)
9
+ elsif from.is_a?(String)
10
+ if type == :json
11
+ from_json(from)
12
+ else
13
+ from_yaml(from)
14
+ end
15
+ end
16
+ end
17
+
18
+ def preview
19
+ {"yaml" => YAML.dump([self.to_hash]).lines.to_a[1..-1].join,
20
+ "html" => self.to_html}
21
+ end
22
+
23
+ def type
24
+ @types[ self[:type] ]
25
+ end
26
+
27
+ def h(string)
28
+ Rack::Utils.escape_html(string)
29
+ end
30
+
31
+ def [](key)
32
+ @point.fetch(key, nil)
33
+ end
34
+
35
+ def []=(key, val)
36
+ @point[key] = val
37
+ end
38
+
39
+ def fetch(key, default)
40
+ @point.fetch(key, default)
41
+ end
42
+
43
+ def to_html(title=true)
44
+ ERB.new(point_html_template, nil, "<>").result(binding)
45
+ end
46
+
47
+ def to_json
48
+ @point.to_json
49
+ end
50
+
51
+ def to_hash
52
+ @point.clone
53
+ end
54
+
55
+ def to_placemark
56
+ KML::Placemark.new(
57
+ :name => self[:title],
58
+ :description => to_html(false),
59
+ :geometry => KML::Point.new(:coordinates => {:lat => self[:lat], :lng => self[:lon]}),
60
+ :style_url => "#%s" % Util.kml_style_url(self[:type], :type)
61
+ )
62
+ end
63
+
64
+ private
65
+ def from_json(from)
66
+ p = JSON.parse(from)
67
+ data = {}
68
+
69
+ p.each_pair{|k, v| data[k.intern] = v}
70
+
71
+ from_hash(data)
72
+ end
73
+
74
+ def from_yaml(from)
75
+ from_hash(YAML.load(from))
76
+ end
77
+
78
+ def from_hash(data)
79
+ [:title, :comment, :country, :date, :href, :linktext, :linkimg, :lon, :lat, :type].each do |i|
80
+ if data[i].is_a?(String)
81
+ @point[i] = data[i] unless data[i].empty?
82
+ else
83
+ @point[i] = data[i]
84
+ end
85
+ end
86
+
87
+ @point[:type] = data[:type].intern unless data[:type].is_a?(Symbol)
88
+ end
89
+
90
+ def point_html_template
91
+ <<-EOS
92
+ <p>
93
+ <% if title %><font size="+2"><%= @point[:title] %></font><% end %>
94
+ <hr>
95
+ <% if @point[:comment] %>
96
+ <%= h @point[:comment] %><br /><br />
97
+ <% end %>
98
+ <% if @point[:href] %>
99
+ <a href='<%= @point[:href] %>' target='_blank'>
100
+ <% end %>
101
+ <% if @point[:linkimg] || @point[:linktext] %>
102
+ <% if @point[:linkimg] %>
103
+ <img src='<%= @point[:linkimg] %>'><br />
104
+ <% end %>
105
+ <% if @point[:linktext] %>
106
+ <%= h @point[:linktext] %>
107
+ <% end %>
108
+ <% elsif @point[:href] %>
109
+ <%= Util.domain_from_url(@point[:href]) %>
110
+ <% end %>
111
+ <% if @point[:href] %>
112
+ </a>
113
+ <% end %>
114
+ </p>
115
+ <p>
116
+ <font size"-2"><%= h @types[ @point[:type] ][:description] %><% if @point[:date] %> on <%= h @point[:date] %><% end %></font>
117
+ EOS
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,164 @@
1
+ module Travlrmap
2
+ class Points
3
+ def initialize(types, sets, map)
4
+ @types = types
5
+ @sets = sets
6
+ @map = map
7
+
8
+ reset
9
+ end
10
+
11
+ def has_title?(title)
12
+ !!find_title(title)
13
+ end
14
+
15
+ def find_title(title)
16
+ @points.find_index do |point|
17
+ point[:title] == title
18
+ end
19
+ end
20
+
21
+ def replace!(title, point)
22
+ raise("Can only store instances of Point") unless point.is_a?(Point)
23
+
24
+ if idx = find_title(title)
25
+ @points[idx] = point
26
+ else
27
+ raise("No point with title %s to replace" % title)
28
+ end
29
+ end
30
+
31
+ def save_to_file(file)
32
+ File.open(file, "w") do |f|
33
+ f.puts YAML.dump(:points => @points.map{|p| p.to_hash})
34
+ end
35
+ end
36
+
37
+ def <<(point)
38
+ raise("Can only store instances of Point") unless point.is_a?(Point)
39
+
40
+ @points << point
41
+ end
42
+
43
+ def reset
44
+ @points = []
45
+ end
46
+
47
+ def by_country
48
+ @points.sort_by do |point|
49
+ point[:country]
50
+ end
51
+ end
52
+
53
+ def map
54
+ by_country.map do |point|
55
+ yield(point)
56
+ end
57
+ end
58
+
59
+ def each
60
+ by_country.each do |point|
61
+ yield(point)
62
+ end
63
+ end
64
+
65
+ def countries
66
+ @points.map do |point|
67
+ point[:country]
68
+ end.compact.sort.uniq
69
+ end
70
+
71
+ def size
72
+ @points.size
73
+ end
74
+ alias :count :size
75
+
76
+
77
+ def to_kml
78
+ require 'ruby_kml'
79
+
80
+ kml = KMLFile.new
81
+ document = KML::Document.new(:name => "Travlrmap Data")
82
+ folder = KML::Folder.new(:name => "Countries")
83
+ folders = {}
84
+
85
+ @types.each do |k, t|
86
+ document.styles << KML::Style.new(
87
+ :id => Util.kml_style_url(k, :type),
88
+ :icon_style => KML::IconStyle.new(:icon => KML::Icon.new(:href => t[:icon]))
89
+ )
90
+ end
91
+
92
+ self.each do |point|
93
+ unless folders[point[:country]]
94
+ folder.features << folders[point[:country]] = KML::Folder.new(:name => point[:country])
95
+ end
96
+
97
+ f = folders[point[:country]]
98
+
99
+ f.features << point.to_placemark
100
+ end
101
+
102
+ document.features << folder
103
+ kml.objects << document
104
+
105
+ kml.render
106
+ end
107
+
108
+ def to_json
109
+ @points.map do |point|
110
+ temp = point.to_hash
111
+ temp[:popup_html] = point.to_html
112
+ temp[:icon] = point.type[:icon]
113
+ temp
114
+ end.to_json
115
+ end
116
+
117
+ def load_points_from_file(file)
118
+ points_from_data(load_file(file))
119
+ end
120
+
121
+ def load_points(set=nil)
122
+ reset
123
+
124
+ files_for_set(set).each do |file|
125
+ if file.is_a?(Symbol)
126
+ self.load_points(file)
127
+ else
128
+ file = point_file(file)
129
+
130
+ if File.directory?(file)
131
+ load_directory(file)
132
+ else
133
+ load_points_from_file(file)
134
+ end
135
+ end
136
+ end
137
+ end
138
+
139
+ def files_for_set(set)
140
+ return Array(@sets[set][:data]) if set
141
+ return Array(@map[:data])
142
+ end
143
+
144
+ def point_file(file)
145
+ File.join(File.join(APPROOT, "config", file))
146
+ end
147
+
148
+ def points_from_data(data)
149
+ data[:points].each do |point|
150
+ @points << Point.new(point, @types)
151
+ end
152
+ end
153
+
154
+ def load_directory(directory)
155
+ Dir.entries(directory).grep(/\.yaml$/).each do |points|
156
+ points_from_data(load_file(File.join(directory, points)))
157
+ end
158
+ end
159
+
160
+ def load_file(file)
161
+ YAML.load_file(file)
162
+ end
163
+ end
164
+ end
@@ -13,6 +13,9 @@ module Travlrmap
13
13
 
14
14
  @map[:map_types] = ["hybrid", "roadmap", "satellite", "terrain", "osm"] unless @map[:map_types]
15
15
  @map[:default_map_type] = "roadmap" unless @map[:default_map_type]
16
+ @map[:theme] = "css" unless @map[:theme]
17
+
18
+ raise "Unknown theme %s" % @map[:theme] unless valid_themes.include?(@map[:theme])
16
19
 
17
20
  super()
18
21
  end
@@ -21,16 +24,17 @@ module Travlrmap
21
24
  set :views, File.join(File.expand_path(File.dirname(__FILE__)), "../..", "views")
22
25
  set :public_folder, File.join(File.expand_path(File.dirname(__FILE__)), "../..", "public")
23
26
 
27
+ def valid_themes
28
+ ["cerulean", "cosmo", "cyborg", "darkly", "flatly", "journal",
29
+ "lumen", "paper", "readable", "sandstone", "simplex", "slate",
30
+ "spacelab", "superhero", "united", "yeti", "css"]
31
+ end
32
+
24
33
  helpers do
25
34
  include Rack::Utils
26
35
 
27
36
  alias_method :h, :escape_html
28
37
 
29
- def domain_from_url(url)
30
- host = URI.parse(url).host.downcase
31
- host.start_with?('www.') ? host[4..-1] : host
32
- end
33
-
34
38
  def protected!
35
39
  return if authorized?
36
40
  headers['WWW-Authenticate'] = 'Basic realm="Restricted Area"'
@@ -61,37 +65,9 @@ module Travlrmap
61
65
  end
62
66
  end
63
67
 
64
- def kml_style_url(type)
65
- "travlrmap-%s-style" % type
66
- end
67
-
68
68
  def load_map(set=nil)
69
- @points = []
70
-
71
- if set
72
- files = Array(@config[:sets][set][:data])
73
- else
74
- files = Array(@config[:map][:data])
75
- end
76
-
77
- files.each do |map|
78
- if map.is_a?(Symbol)
79
- @points.concat(load_map(map))
80
- else
81
- point_file = File.join(File.join(APPROOT, "config", map))
82
-
83
- if File.directory?(point_file)
84
- Dir.entries(point_file).grep(/\.yaml$/).each do |points|
85
- file = File.join(point_file, points)
86
- data = YAML.load_file(file)
87
- @points.concat(data[:points])
88
- end
89
- else
90
- data = YAML.load_file(point_file)
91
- @points.concat(data[:points])
92
- end
93
- end
94
- end
69
+ @points = Points.new(@types, @sets, @map)
70
+ @points.load_points(set)
95
71
  end
96
72
 
97
73
  def set_map_vars(view, set=nil)
@@ -105,68 +81,6 @@ module Travlrmap
105
81
  @active_set = set
106
82
  end
107
83
 
108
- def to_json
109
- @points.sort_by{|p| p[:country]}.map do |point|
110
- point[:popup_html] = erb(:"_point_comment", :layout => false, :locals => {:point => point})
111
- point[:icon] = @types[ point[:type] ][:icon]
112
- point
113
- end.to_json
114
- end
115
-
116
- def to_kml
117
- require 'ruby_kml'
118
-
119
- kml = KMLFile.new
120
- document = KML::Document.new(:name => "Travlrmap Data")
121
- folder = KML::Folder.new(:name => "Countries")
122
- folders = {}
123
-
124
- @types.each do |k, t|
125
- document.styles << KML::Style.new(
126
- :id => kml_style_url(k),
127
- :icon_style => KML::IconStyle.new(:icon => KML::Icon.new(:href => t[:icon]))
128
- )
129
- end
130
-
131
- @points.sort_by{|p| p[:country]}.each do |point|
132
- unless folders[point[:country]]
133
- folder.features << folders[point[:country]] = KML::Folder.new(:name => point[:country])
134
- end
135
-
136
- f = folders[point[:country]]
137
-
138
- f.features << KML::Placemark.new(
139
- :name => point[:title],
140
- :description => erb(:"_point_comment", :layout => false, :locals => {:point => point}),
141
- :geometry => KML::Point.new(:coordinates => {:lat => point[:lat], :lng => point[:lon]}),
142
- :style_url => "#%s" % kml_style_url(point[:type])
143
- )
144
- end
145
-
146
- document.features << folder
147
- kml.objects << document
148
-
149
- kml.render
150
- end
151
-
152
- def point_from_json(json)
153
- data = JSON.parse(json)
154
-
155
- point = {}
156
-
157
- ["title", "comment", "country", "date", "href", "linktext", "linkimg", "lon", "lat"].each do |i|
158
- if data[i].is_a?(String)
159
- point[i.intern] = data[i] unless data[i].empty?
160
- else
161
- point[i.intern] = data[i]
162
- end
163
- end
164
-
165
- point[:type] = data["type"].intern
166
-
167
- point
168
- end
169
-
170
84
  get '/view/:view/?:set?' do
171
85
  params[:view] ? view = params[:view].intern : view = :default
172
86
  params[:set] ? set = params[:set].intern : set = nil
@@ -208,7 +122,7 @@ module Travlrmap
208
122
 
209
123
  content_type :"application/vnd.google-earth.kml+xml"
210
124
  load_map(set)
211
- to_kml
125
+ @points.to_kml
212
126
  end
213
127
 
214
128
  get '/points/json/?:set?' do
@@ -216,47 +130,42 @@ module Travlrmap
216
130
 
217
131
  content_type :"application/json"
218
132
  load_map(set)
219
- to_json
133
+ @points.to_json
220
134
  end
221
135
 
222
136
  post '/points/save' do
223
137
  content_type :"application/json"
224
138
 
225
- if !@map[:authenticate]
226
- halt(403, "Can only save data if authentication is enabled")
227
- end
228
-
229
139
  protected!
230
140
 
231
- halt(403, "No :save_to location configured") unless @map[:save_to]
141
+ begin
142
+ raise("Can only save data if authentication is enabled") unless @map[:authenticate]
232
143
 
233
- save_file = File.join(APPROOT, "config", "%s.yaml" % @map[:save_to])
144
+ raise("No :save_to location configured") unless @map[:save_to]
234
145
 
235
- halt(403, ":save_to location is not writable") unless File.writable?(save_file)
146
+ save_file = File.join(APPROOT, "config", "%s.yaml" % @map[:save_to])
236
147
 
237
- points = YAML.load(File.read(save_file))
148
+ raise(":save_to location is not writable") unless File.writable?(save_file)
238
149
 
239
- halt(403, "Failed to load :save_to location as valid YAML") unless points
240
- halt(403, "Failed to load :save_to location as valid points file") unless points[:points]
150
+ points = Points.new(@types, @sets, @map)
151
+ points.load_points_from_file(save_file)
241
152
 
242
- begin
243
- new_point = point_from_json(request.body.read)
153
+ raise("Failed to load :save_to location as valid YAML") unless points
244
154
 
245
- index = points[:points].find_index{|p| p[:title] == new_point[:title]}
155
+ new_point = Util.point_from_json(request.body.read, @types)
156
+ title = new_point[:title]
246
157
 
247
- if index
248
- points[:points][index] = new_point
249
- result = '{"status":"success","message":"%s has been updated"}' % h(new_point[:title])
158
+ if points.has_title?(title)
159
+ points.replace!(title, new_point)
160
+ result = '{"status":"success","message":"%s has been updated"}' % h(title)
250
161
  else
251
- points[:points] << new_point
252
- result = '{"status":"success","message":"%s has been saved"}' % h(new_point[:title])
162
+ points << new_point
163
+ result = '{"status":"success","message":"%s has been saved"}' % h(title)
253
164
  end
254
165
 
255
- File.open(save_file, "w") do |f|
256
- f.puts YAML.dump(points)
257
- end
166
+ points.save_to_file(save_file)
258
167
  rescue Exception
259
- result = '{"status":"message": "Failed to save point: %s"}' % h($!.to_s)
168
+ result = '{"status":"message","message":"Failed to save point: %s"}' % h($!.to_s)
260
169
  end
261
170
 
262
171
  result
@@ -267,12 +176,8 @@ module Travlrmap
267
176
 
268
177
  content_type :"application/json"
269
178
 
270
- point = point_from_json(request.body.read)
271
-
272
- result = {"yaml" => YAML.dump([point]).lines.to_a[1..-1].join,
273
- "html" => erb(:"_point_comment", :layout => false, :locals => {:point => point})}
274
-
275
- result.to_json
179
+ point = Util.point_from_json(request.body.read, @types)
180
+ point.preview.to_json
276
181
  end
277
182
 
278
183
  get '/images/*' do
@@ -0,0 +1,16 @@
1
+ module Travlrmap
2
+ module Util
3
+ def self.kml_style_url(key, type)
4
+ "travlrmap-%s-%s" % [key, type]
5
+ end
6
+
7
+ def self.domain_from_url(url)
8
+ host = URI.parse(url).host.downcase
9
+ host.match(/^(en|www)\./) ? host.split(".")[1..-1].join(".") : host
10
+ end
11
+
12
+ def self.point_from_json(json, types)
13
+ Point.new(json, types, :json)
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Travlrmap
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -13,6 +13,7 @@
13
13
 
14
14
  <ul>
15
15
  <li><a href="http://getbootstrap.com/">Bootstrap</a></li>
16
+ <li><a href="http://www.bootstrapcdn.com/">Bootstrap CDN</a></li>
16
17
  <li><a href="https://hpneo.github.io/gmaps/">GMaps.js</a></li>
17
18
  <li><a href="https://developers.google.com/maps/">Google Maps</a></li>
18
19
  <li><a href="https://github.com/mahnunchik/markerclustererplus">Marker Clusterer Plus</a></li>
@@ -6,5 +6,5 @@
6
6
  <img src="<%= settings[:icon] %>">&nbsp;<%= settings[:description] %>
7
7
  <% end %>
8
8
  <br />
9
- <%= @points.size %> locations in <%= @points.map{|p| p[:country]}.uniq.size %> countries
9
+ <%= @points.size %> locations in <%= @points.countries.size %> countries
10
10
  </div>
@@ -13,7 +13,11 @@
13
13
  <script src="///ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
14
14
  <script src="///maps.google.com/maps/api/js?sensor=true"></script>
15
15
  <script src="///maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
16
+ <% if @map[:theme] == "css" %>
16
17
  <link rel="stylesheet" href="///maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
18
+ <% else %>
19
+ <link rel="stylesheet" href="///maxcdn.bootstrapcdn.com/bootswatch/3.3.1/<%= @map[:theme] %>/bootstrap.min.css">
20
+ <% end %>
17
21
  <link rel="stylesheet" href="/travlrmap.css">
18
22
  <link rel="stylesheet" href="/datepicker/datepicker3.css">
19
23
  <script src="/gmaps.js"></script>
@@ -28,8 +32,11 @@
28
32
  </head>
29
33
 
30
34
  <body>
31
-
35
+ <% if @map[:theme] == "css" %>
32
36
  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
37
+ <% else %>
38
+ <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
39
+ <% end %>
33
40
  <div class="container">
34
41
  <div class="navbar-header">
35
42
  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
metadata CHANGED
@@ -1,346 +1,292 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: travlrmap
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 3
9
- - 0
10
- version: 1.3.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - R.I.Pienaar
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2015-01-16 00:00:00 +00:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2015-01-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: sinatra
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
33
20
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: bundler
37
21
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
47
- type: :runtime
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
50
28
  name: httparty
51
- prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.13'
61
34
  type: :runtime
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: ruby_kml
65
35
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.13'
41
+ - !ruby/object:Gem::Dependency
42
+ name: json
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.8'
75
48
  type: :runtime
76
- version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: gli
79
49
  prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ruby_kml
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
89
62
  type: :runtime
90
- version_requirements: *id005
91
- - !ruby/object:Gem::Dependency
92
- name: httparty
93
63
  prerelease: false
94
- requirement: &id006 !ruby/object:Gem::Requirement
95
- none: false
96
- requirements:
97
- - - "="
98
- - !ruby/object:Gem::Version
99
- hash: 51
100
- segments:
101
- - 0
102
- - 11
103
- - 0
104
- version: 0.11.0
105
- type: :runtime
106
- version_requirements: *id006
107
- - !ruby/object:Gem::Dependency
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.1'
69
+ - !ruby/object:Gem::Dependency
108
70
  name: nokogiri
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.6'
76
+ type: :runtime
109
77
  prerelease: false
110
- requirement: &id007 !ruby/object:Gem::Requirement
111
- none: false
112
- requirements:
113
- - - "="
114
- - !ruby/object:Gem::Version
115
- hash: 7
116
- segments:
117
- - 1
118
- - 5
119
- - 2
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rack
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
120
89
  version: 1.5.2
121
90
  type: :runtime
122
- version_requirements: *id007
123
- - !ruby/object:Gem::Dependency
124
- name: rack
125
91
  prerelease: false
126
- requirement: &id008 !ruby/object:Gem::Requirement
127
- none: false
128
- requirements:
129
- - - "="
130
- - !ruby/object:Gem::Version
131
- hash: 7
132
- segments:
133
- - 1
134
- - 5
135
- - 2
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
136
96
  version: 1.5.2
137
- type: :runtime
138
- version_requirements: *id008
139
- description: "description: Sinatra based map builder"
97
+ description: 'description: Sinatra based map builder'
140
98
  email: rip@devco.net
141
99
  executables: []
142
-
143
100
  extensions: []
144
-
145
101
  extra_rdoc_files: []
146
-
147
- files:
102
+ files:
103
+ - Gemfile
104
+ - Gemfile.lock
105
+ - config.ru
106
+ - config/travlrmap.yaml.dist
148
107
  - lib/travlrmap.rb
149
- - lib/travlrmap/version.rb
108
+ - lib/travlrmap/point.rb
109
+ - lib/travlrmap/points.rb
150
110
  - lib/travlrmap/sinatra_app.rb
151
- - views/layout.erb
152
- - views/index.erb
153
- - views/_point_comment.erb
154
- - views/_google_analytics.erb
155
- - views/_map_types.erb
156
- - views/about.erb
157
- - views/_map_js.erb
158
- - views/geolocate.erb
159
- - public/travlrmap.css
160
- - public/favicon.ico
161
- - public/markerclusterer_compiled.js
162
- - public/gmaps.js
163
- - public/markers/marker-NAVY-MINI.png
164
- - public/markers/marker-NAVY-REGULAR.png
165
- - public/markers/marker-SILVER-MINI.png
166
- - public/markers/marker-PURPLE-LARGE.png
167
- - public/markers/marker-BLUE-MINI.png
168
- - public/markers/marker-ORANGE-LARGE.png
169
- - public/markers/marker-BLUE-LARGE.png
170
- - public/markers/marker-BLACK-MINI.png
171
- - public/markers/marker-FUCHSIA-MINI.png
172
- - public/markers/marker-ORANGE-REGULAR.png
173
- - public/markers/marker-BLACK-REGULAR.png
174
- - public/markers/marker-BLACK-LARGE.png
175
- - public/markers/marker-GREEN-MINI.png
176
- - public/markers/marker-OLIVE-LARGE.png
177
- - public/markers/marker-SILVER-LARGE.png
178
- - public/markers/marker-RED-REGULAR.png
179
- - public/markers/marker-TEAL-LARGE.png
180
- - public/markers/marker-GRAY-MINI.png
181
- - public/markers/marker-SILVER-REGULAR.png
182
- - public/markers/marker-MAROON-MINI.png
183
- - public/markers/marker-OLIVE-REGULAR.png
184
- - public/markers/marker-PURPLE-REGULAR.png
185
- - public/markers/marker-WHITE-MINI.png
186
- - public/markers/marker-OLIVE-MINI.png
187
- - public/markers/marker-WHITE-LARGE.png
188
- - public/markers/marker-YELLOW-LARGE.png
189
- - public/markers/marker-AQUA-REGULAR.png
190
- - public/markers/marker-FUCHSIA-REGULAR.png
191
- - public/markers/marker-ORANGE-MINI.png
192
- - public/markers/marker-TEAL-REGULAR.png
193
- - public/markers/marker-LIME-MINI.png
194
- - public/markers/marker-AQUA-LARGE.png
195
- - public/markers/marker-MAROON-REGULAR.png
196
- - public/markers/marker-FUCHSIA-LARGE.png
197
- - public/markers/marker-BLUE-REGULAR.png
198
- - public/markers/marker-LIME-REGULAR.png
199
- - public/markers/marker-WHITE-REGULAR.png
200
- - public/markers/marker-YELLOW-REGULAR.png
201
- - public/markers/marker-YELLOW-MINI.png
202
- - public/markers/marker-AQUA-MINI.png
203
- - public/markers/marker-GREEN-LARGE.png
204
- - public/markers/marker-LIME-LARGE.png
205
- - public/markers/marker-NAVY-LARGE.png
206
- - public/markers/marker-GRAY-LARGE.png
207
- - public/markers/marker-TEAL-MINI.png
208
- - public/markers/marker-GREEN-REGULAR.png
209
- - public/markers/marker-RED-LARGE.png
210
- - public/markers/marker-MAROON-LARGE.png
211
- - public/markers/marker-RED-MINI.png
212
- - public/markers/marker-PURPLE-MINI.png
213
- - public/markers/marker-GRAY-REGULAR.png
214
- - public/datepicker/datepicker3.css
215
- - public/datepicker/bootstrap-datepicker.js
216
- - public/cluster/cluster-ORANGE-2.png
217
- - public/cluster/cluster-YELLOW-1.png
218
- - public/cluster/cluster-TEAL-5.png
219
- - public/cluster/cluster-BLUE-2.png
220
- - public/cluster/cluster-YELLOW-4.png
221
- - public/cluster/cluster-BLACK-1.png
222
- - public/cluster/cluster-MAROON-1.png
111
+ - lib/travlrmap/util.rb
112
+ - lib/travlrmap/version.rb
113
+ - public/cluster/cluster-AQUA-1.png
114
+ - public/cluster/cluster-AQUA-2.png
115
+ - public/cluster/cluster-AQUA-3.png
223
116
  - public/cluster/cluster-AQUA-4.png
224
- - public/cluster/cluster-TEAL-1.png
117
+ - public/cluster/cluster-AQUA-5.png
118
+ - public/cluster/cluster-BLACK-1.png
225
119
  - public/cluster/cluster-BLACK-2.png
226
- - public/cluster/cluster-MAROON-3.png
227
- - public/cluster/cluster-SILVER-1.png
228
- - public/cluster/cluster-MAROON-2.png
229
- - public/cluster/cluster-GRAY-5.png
230
- - public/cluster/cluster-YELLOW-2.png
231
- - public/cluster/cluster-WHITE-5.png
232
- - public/cluster/cluster-OLIVE-4.png
233
- - public/cluster/cluster-RED-4.png
234
- - public/cluster/cluster-PURPLE-3.png
235
- - public/cluster/cluster-ORANGE-4.png
236
- - public/cluster/m1.png
237
120
  - public/cluster/cluster-BLACK-3.png
238
- - public/cluster/cluster-LIME-1.png
239
- - public/cluster/cluster-YELLOW-5.png
240
- - public/cluster/cluster-AQUA-5.png
241
121
  - public/cluster/cluster-BLACK-4.png
122
+ - public/cluster/cluster-BLACK-5.png
123
+ - public/cluster/cluster-BLUE-1.png
124
+ - public/cluster/cluster-BLUE-2.png
125
+ - public/cluster/cluster-BLUE-3.png
126
+ - public/cluster/cluster-BLUE-4.png
127
+ - public/cluster/cluster-BLUE-5.png
128
+ - public/cluster/cluster-FUCHSIA-1.png
129
+ - public/cluster/cluster-FUCHSIA-2.png
130
+ - public/cluster/cluster-FUCHSIA-3.png
131
+ - public/cluster/cluster-FUCHSIA-4.png
132
+ - public/cluster/cluster-FUCHSIA-5.png
242
133
  - public/cluster/cluster-GRAY-1.png
243
- - public/cluster/cluster-WHITE-2.png
244
- - public/cluster/cluster-WHITE-4.png
245
- - public/cluster/cluster-RED-1.png
246
- - public/cluster/cluster-OLIVE-5.png
247
- - public/cluster/cluster-MAROON-5.png
248
- - public/cluster/cluster-NAVY-3.png
249
- - public/cluster/cluster-TEAL-4.png
250
- - public/cluster/cluster-PURPLE-2.png
134
+ - public/cluster/cluster-GRAY-2.png
135
+ - public/cluster/cluster-GRAY-3.png
136
+ - public/cluster/cluster-GRAY-4.png
137
+ - public/cluster/cluster-GRAY-5.png
251
138
  - public/cluster/cluster-GREEN-1.png
252
- - public/cluster/cluster-YELLOW-3.png
253
- - public/cluster/cluster-AQUA-2.png
254
- - public/cluster/cluster-FUCHSIA-5.png
255
- - public/cluster/cluster-BLUE-5.png
256
- - public/cluster/cluster-LIME-2.png
257
- - public/cluster/cluster-BLUE-4.png
258
- - public/cluster/cluster-BLUE-1.png
259
- - public/cluster/cluster-SILVER-3.png
260
139
  - public/cluster/cluster-GREEN-2.png
261
- - public/cluster/cluster-RED-2.png
262
- - public/cluster/cluster-GRAY-4.png
263
- - public/cluster/cluster-RED-3.png
264
- - public/cluster/cluster-PURPLE-4.png
140
+ - public/cluster/cluster-GREEN-3.png
265
141
  - public/cluster/cluster-GREEN-4.png
266
- - public/cluster/cluster-NAVY-5.png
267
- - public/cluster/cluster-TEAL-3.png
268
- - public/cluster/cluster-GRAY-3.png
269
- - public/cluster/cluster-BLUE-3.png
270
- - public/cluster/cluster-SILVER-5.png
271
- - public/cluster/cluster-ORANGE-5.png
272
- - public/cluster/cluster-FUCHSIA-4.png
142
+ - public/cluster/cluster-GREEN-5.png
143
+ - public/cluster/cluster-LIME-1.png
144
+ - public/cluster/cluster-LIME-2.png
273
145
  - public/cluster/cluster-LIME-3.png
274
- - public/cluster/cluster-WHITE-1.png
275
- - public/cluster/cluster-NAVY-2.png
276
- - public/cluster/m4.png
277
146
  - public/cluster/cluster-LIME-4.png
278
- - public/cluster/cluster-SILVER-2.png
279
- - public/cluster/cluster-SILVER-4.png
280
- - public/cluster/cluster-WHITE-3.png
281
- - public/cluster/cluster-TEAL-2.png
282
- - public/cluster/cluster-RED-5.png
283
- - public/cluster/cluster-BLACK-5.png
284
- - public/cluster/m5.png
285
- - public/cluster/cluster-OLIVE-3.png
286
- - public/cluster/cluster-GRAY-2.png
147
+ - public/cluster/cluster-LIME-5.png
148
+ - public/cluster/cluster-MAROON-1.png
149
+ - public/cluster/cluster-MAROON-2.png
150
+ - public/cluster/cluster-MAROON-3.png
151
+ - public/cluster/cluster-MAROON-4.png
152
+ - public/cluster/cluster-MAROON-5.png
153
+ - public/cluster/cluster-NAVY-1.png
154
+ - public/cluster/cluster-NAVY-2.png
155
+ - public/cluster/cluster-NAVY-3.png
287
156
  - public/cluster/cluster-NAVY-4.png
157
+ - public/cluster/cluster-NAVY-5.png
288
158
  - public/cluster/cluster-OLIVE-1.png
289
159
  - public/cluster/cluster-OLIVE-2.png
160
+ - public/cluster/cluster-OLIVE-3.png
161
+ - public/cluster/cluster-OLIVE-4.png
162
+ - public/cluster/cluster-OLIVE-5.png
290
163
  - public/cluster/cluster-ORANGE-1.png
291
- - public/cluster/cluster-AQUA-3.png
292
- - public/cluster/cluster-NAVY-1.png
293
- - public/cluster/cluster-FUCHSIA-2.png
294
- - public/cluster/cluster-FUCHSIA-3.png
295
- - public/cluster/cluster-AQUA-1.png
296
- - public/cluster/cluster-GREEN-5.png
297
- - public/cluster/m3.png
164
+ - public/cluster/cluster-ORANGE-2.png
298
165
  - public/cluster/cluster-ORANGE-3.png
299
- - public/cluster/cluster-FUCHSIA-1.png
300
- - public/cluster/cluster-LIME-5.png
166
+ - public/cluster/cluster-ORANGE-4.png
167
+ - public/cluster/cluster-ORANGE-5.png
301
168
  - public/cluster/cluster-PURPLE-1.png
302
- - public/cluster/cluster-GREEN-3.png
303
- - public/cluster/m2.png
169
+ - public/cluster/cluster-PURPLE-2.png
170
+ - public/cluster/cluster-PURPLE-3.png
171
+ - public/cluster/cluster-PURPLE-4.png
304
172
  - public/cluster/cluster-PURPLE-5.png
305
- - public/cluster/cluster-MAROON-4.png
173
+ - public/cluster/cluster-RED-1.png
174
+ - public/cluster/cluster-RED-2.png
175
+ - public/cluster/cluster-RED-3.png
176
+ - public/cluster/cluster-RED-4.png
177
+ - public/cluster/cluster-RED-5.png
178
+ - public/cluster/cluster-SILVER-1.png
179
+ - public/cluster/cluster-SILVER-2.png
180
+ - public/cluster/cluster-SILVER-3.png
181
+ - public/cluster/cluster-SILVER-4.png
182
+ - public/cluster/cluster-SILVER-5.png
183
+ - public/cluster/cluster-TEAL-1.png
184
+ - public/cluster/cluster-TEAL-2.png
185
+ - public/cluster/cluster-TEAL-3.png
186
+ - public/cluster/cluster-TEAL-4.png
187
+ - public/cluster/cluster-TEAL-5.png
188
+ - public/cluster/cluster-WHITE-1.png
189
+ - public/cluster/cluster-WHITE-2.png
190
+ - public/cluster/cluster-WHITE-3.png
191
+ - public/cluster/cluster-WHITE-4.png
192
+ - public/cluster/cluster-WHITE-5.png
193
+ - public/cluster/cluster-YELLOW-1.png
194
+ - public/cluster/cluster-YELLOW-2.png
195
+ - public/cluster/cluster-YELLOW-3.png
196
+ - public/cluster/cluster-YELLOW-4.png
197
+ - public/cluster/cluster-YELLOW-5.png
198
+ - public/cluster/m1.png
199
+ - public/cluster/m2.png
200
+ - public/cluster/m3.png
201
+ - public/cluster/m4.png
202
+ - public/cluster/m5.png
203
+ - public/datepicker/bootstrap-datepicker.js
204
+ - public/datepicker/datepicker3.css
205
+ - public/favicon.ico
206
+ - public/gmaps.js
207
+ - public/markerclusterer_compiled.js
208
+ - public/markers/marker-AQUA-LARGE.png
209
+ - public/markers/marker-AQUA-MINI.png
210
+ - public/markers/marker-AQUA-REGULAR.png
211
+ - public/markers/marker-BLACK-LARGE.png
212
+ - public/markers/marker-BLACK-MINI.png
213
+ - public/markers/marker-BLACK-REGULAR.png
214
+ - public/markers/marker-BLUE-LARGE.png
215
+ - public/markers/marker-BLUE-MINI.png
216
+ - public/markers/marker-BLUE-REGULAR.png
217
+ - public/markers/marker-FUCHSIA-LARGE.png
218
+ - public/markers/marker-FUCHSIA-MINI.png
219
+ - public/markers/marker-FUCHSIA-REGULAR.png
220
+ - public/markers/marker-GRAY-LARGE.png
221
+ - public/markers/marker-GRAY-MINI.png
222
+ - public/markers/marker-GRAY-REGULAR.png
223
+ - public/markers/marker-GREEN-LARGE.png
224
+ - public/markers/marker-GREEN-MINI.png
225
+ - public/markers/marker-GREEN-REGULAR.png
226
+ - public/markers/marker-LIME-LARGE.png
227
+ - public/markers/marker-LIME-MINI.png
228
+ - public/markers/marker-LIME-REGULAR.png
229
+ - public/markers/marker-MAROON-LARGE.png
230
+ - public/markers/marker-MAROON-MINI.png
231
+ - public/markers/marker-MAROON-REGULAR.png
232
+ - public/markers/marker-NAVY-LARGE.png
233
+ - public/markers/marker-NAVY-MINI.png
234
+ - public/markers/marker-NAVY-REGULAR.png
235
+ - public/markers/marker-OLIVE-LARGE.png
236
+ - public/markers/marker-OLIVE-MINI.png
237
+ - public/markers/marker-OLIVE-REGULAR.png
238
+ - public/markers/marker-ORANGE-LARGE.png
239
+ - public/markers/marker-ORANGE-MINI.png
240
+ - public/markers/marker-ORANGE-REGULAR.png
241
+ - public/markers/marker-PURPLE-LARGE.png
242
+ - public/markers/marker-PURPLE-MINI.png
243
+ - public/markers/marker-PURPLE-REGULAR.png
244
+ - public/markers/marker-RED-LARGE.png
245
+ - public/markers/marker-RED-MINI.png
246
+ - public/markers/marker-RED-REGULAR.png
247
+ - public/markers/marker-SILVER-LARGE.png
248
+ - public/markers/marker-SILVER-MINI.png
249
+ - public/markers/marker-SILVER-REGULAR.png
250
+ - public/markers/marker-TEAL-LARGE.png
251
+ - public/markers/marker-TEAL-MINI.png
252
+ - public/markers/marker-TEAL-REGULAR.png
253
+ - public/markers/marker-WHITE-LARGE.png
254
+ - public/markers/marker-WHITE-MINI.png
255
+ - public/markers/marker-WHITE-REGULAR.png
256
+ - public/markers/marker-YELLOW-LARGE.png
257
+ - public/markers/marker-YELLOW-MINI.png
258
+ - public/markers/marker-YELLOW-REGULAR.png
306
259
  - public/moment.js
307
- - config/travlrmap.yaml.dist
308
- - config.ru
309
- - Gemfile
310
- - Gemfile.lock
311
- has_rdoc: true
260
+ - public/travlrmap.css
261
+ - views/_google_analytics.erb
262
+ - views/_map_js.erb
263
+ - views/_map_types.erb
264
+ - views/about.erb
265
+ - views/geolocate.erb
266
+ - views/index.erb
267
+ - views/layout.erb
312
268
  homepage: http://devco.net/
313
- licenses: []
314
-
269
+ licenses:
270
+ - Apache-2
271
+ metadata: {}
315
272
  post_install_message:
316
273
  rdoc_options: []
317
-
318
- require_paths:
274
+ require_paths:
319
275
  - lib
320
- required_ruby_version: !ruby/object:Gem::Requirement
321
- none: false
322
- requirements:
276
+ required_ruby_version: !ruby/object:Gem::Requirement
277
+ requirements:
323
278
  - - ">="
324
- - !ruby/object:Gem::Version
325
- hash: 3
326
- segments:
327
- - 0
328
- version: "0"
329
- required_rubygems_version: !ruby/object:Gem::Requirement
330
- none: false
331
- requirements:
279
+ - !ruby/object:Gem::Version
280
+ version: '0'
281
+ required_rubygems_version: !ruby/object:Gem::Requirement
282
+ requirements:
332
283
  - - ">="
333
- - !ruby/object:Gem::Version
334
- hash: 3
335
- segments:
336
- - 0
337
- version: "0"
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
338
286
  requirements: []
339
-
340
287
  rubyforge_project:
341
- rubygems_version: 1.3.7
288
+ rubygems_version: 2.2.2
342
289
  signing_key:
343
- specification_version: 3
290
+ specification_version: 4
344
291
  summary: travlrmap
345
292
  test_files: []
346
-
@@ -1,26 +0,0 @@
1
- <p>
2
- <font size="+2"><%= point[:title] %></font>
3
- <hr>
4
- <% if point[:comment] %>
5
- <%= h point[:comment] %><br /><br />
6
- <% end %>
7
-
8
- <% if point[:href] %>
9
- <a href='<%= point[:href] %>' target='_blank'>
10
- <% end %>
11
- <% if point[:linkimg] || point[:linktext] %>
12
- <% if point[:linkimg] %>
13
- <img src='<%= point[:linkimg] %>'><br />
14
- <% end %>
15
- <% if point[:linktext] %>
16
- <%= h point[:linktext] %>
17
- <% end %>
18
- <% elsif point[:href] %>
19
- <%= domain_from_url(point[:href]) %>
20
- <% end %>
21
- <% if point[:href] %>
22
- </a>
23
- <% end %>
24
- </p>
25
- <p>
26
- <font weight"-2"><%= h @types[ point[:type] ][:description] %><% if point[:date] %> on <%= h point[:date] %><% end %>