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 CHANGED
@@ -21,3 +21,4 @@ pkg
21
21
  .yardoc
22
22
 
23
23
  ## PROJECT::SPECIFIC
24
+ Gemfile.lock
@@ -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
- if defined? ActionView
14
- ActionView::Base.send(:include, YMaps::ActionView::Helpers)
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? Mime
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 = %w(GeoObject GeoObjectCollection style ymaps AnyMetaData).map(&:to_sym)
30
- GML_TAG_NAMES = %w(boundedBy description Envelope exterior featureMember
31
- featureMembers interior LineString LinearRing lowerCorner
32
- metaDataProperty name Point Polygon pos posList upperCorner).map(&:to_sym)
33
- REPR_TAG_NAMES = %w(balloonContentStyle fill fillColor hintContentStyle iconContentStyle
34
- lineStyle href iconStyle mapType offset outline parentStyle polygonStyle
35
- Representation shadow size strokeColor strokeWidth Style Template
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
- GeoObject do
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
@@ -0,0 +1,8 @@
1
+ require 'ymaps'
2
+ require 'rails/railtie'
3
+
4
+ class YMaps::Railtie < Rails::Railtie
5
+ config.to_prepare do
6
+ YMaps.setup!
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module YMaps
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ require 'bundler/setup'
2
2
  require 'test/unit'
3
3
  require 'shoulda'
4
4
 
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: false
5
- segments:
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-05-09 00:00:00 +06:00
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.3.7
100
+ rubygems_version: 1.8.10
118
101
  signing_key:
119
102
  specification_version: 3
120
103
  summary: Helpers for using YMaps