ymaps 0.0.4 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/ymaps.rb +6 -7
- data/lib/ymaps/action_view/ymapsml_helper.rb +9 -9
- data/lib/ymaps/railtie.rb +8 -0
- data/lib/ymaps/version.rb +1 -1
- data/test/helper.rb +1 -1
- metadata +5 -22
data/.gitignore
CHANGED
data/lib/ymaps.rb
CHANGED
@@ -6,14 +6,13 @@ module YMaps
|
|
6
6
|
|
7
7
|
def self.geocode(query)
|
8
8
|
require 'geokit/geocoders/yandex_geocoder'
|
9
|
-
Geokit::Geocoders::YandexGeocoder.geocode(query)
|
9
|
+
::Geokit::Geocoders::YandexGeocoder.geocode(query)
|
10
10
|
end
|
11
|
-
end
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
def self.setup!
|
13
|
+
::ActionView::Base.send(:include, YMaps::ActionView::Helpers)
|
14
|
+
::Mime::Type.register_alias 'application/xml', :ymapsml
|
15
|
+
end
|
15
16
|
end
|
16
17
|
|
17
|
-
if defined?
|
18
|
-
Mime::Type.register 'application/xml', :ymapsml
|
19
|
-
end
|
18
|
+
require 'ymaps/railtie' if defined? Rails
|
@@ -26,14 +26,13 @@ module YMaps
|
|
26
26
|
end
|
27
27
|
|
28
28
|
class Builder
|
29
|
-
YMAPS_TAG_NAMES =
|
30
|
-
GML_TAG_NAMES =
|
31
|
-
|
32
|
-
|
33
|
-
REPR_TAG_NAMES =
|
34
|
-
|
35
|
-
|
36
|
-
template text View).map(&:to_sym)
|
29
|
+
YMAPS_TAG_NAMES = [:GeoObject, :GeoObjectCollection, :style, :ymaps, :AnyMetaData]
|
30
|
+
GML_TAG_NAMES = [:boundedBy, :description, :Envelope, :exterior, :featureMember, :featureMembers,
|
31
|
+
:interior, :LineString, :LinearRing, :lowerCorner, :metaDataProperty, :name, :Point,
|
32
|
+
:Polygon, :pos, :posList, :upperCorner]
|
33
|
+
REPR_TAG_NAMES = [:balloonContentStyle, :fill, :fillColor, :hintContentStyle, :iconContentStyle, :lineStyle,
|
34
|
+
:href, :iconStyle, :mapType, :offset, :outline, :parentStyle, :polygonStyle, :Representation,
|
35
|
+
:shadow, :size, :strokeColor, :strokeWidth, :Style, :Template, :template, :text, :View]
|
37
36
|
|
38
37
|
def initialize(xml)
|
39
38
|
@xml = xml
|
@@ -79,7 +78,8 @@ module YMaps
|
|
79
78
|
end
|
80
79
|
|
81
80
|
def object(object, options = {})
|
82
|
-
|
81
|
+
gml_id = options.delete(:id) { object.id }
|
82
|
+
GeoObject('gml:id' => gml_id) do
|
83
83
|
if options.key?(:style)
|
84
84
|
@xml.style("\##{options.delete(:style)}")
|
85
85
|
end
|
data/lib/ymaps/version.rb
CHANGED
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ymaps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
version: 0.0.4
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.7
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Alexander Semyonov
|
@@ -14,8 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable:
|
13
|
+
date: 2011-09-13 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: geokit
|
@@ -25,10 +20,6 @@ dependencies:
|
|
25
20
|
requirements:
|
26
21
|
- - "="
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 1
|
30
|
-
- 5
|
31
|
-
- 0
|
32
23
|
version: 1.5.0
|
33
24
|
type: :runtime
|
34
25
|
version_requirements: *id001
|
@@ -40,8 +31,6 @@ dependencies:
|
|
40
31
|
requirements:
|
41
32
|
- - ">="
|
42
33
|
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 0
|
45
34
|
version: "0"
|
46
35
|
type: :development
|
47
36
|
version_requirements: *id002
|
@@ -53,8 +42,6 @@ dependencies:
|
|
53
42
|
requirements:
|
54
43
|
- - ">="
|
55
44
|
- !ruby/object:Gem::Version
|
56
|
-
segments:
|
57
|
-
- 0
|
58
45
|
version: "0"
|
59
46
|
type: :development
|
60
47
|
version_requirements: *id003
|
@@ -82,11 +69,11 @@ files:
|
|
82
69
|
- lib/ymaps/action_view.rb
|
83
70
|
- lib/ymaps/action_view/html_helper.rb
|
84
71
|
- lib/ymaps/action_view/ymapsml_helper.rb
|
72
|
+
- lib/ymaps/railtie.rb
|
85
73
|
- lib/ymaps/version.rb
|
86
74
|
- test/helper.rb
|
87
75
|
- test/test_ymaps.rb
|
88
76
|
- ymaps.gemspec
|
89
|
-
has_rdoc: true
|
90
77
|
homepage: http://github.com/rotuka/ymaps
|
91
78
|
licenses: []
|
92
79
|
|
@@ -100,21 +87,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
87
|
requirements:
|
101
88
|
- - ">="
|
102
89
|
- !ruby/object:Gem::Version
|
103
|
-
segments:
|
104
|
-
- 0
|
105
90
|
version: "0"
|
106
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
92
|
none: false
|
108
93
|
requirements:
|
109
94
|
- - ">="
|
110
95
|
- !ruby/object:Gem::Version
|
111
|
-
segments:
|
112
|
-
- 0
|
113
96
|
version: "0"
|
114
97
|
requirements: []
|
115
98
|
|
116
99
|
rubyforge_project: ymaps
|
117
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 1.8.10
|
118
101
|
signing_key:
|
119
102
|
specification_version: 3
|
120
103
|
summary: Helpers for using YMaps
|