on_the_map 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0aa784c0b321681ed623c6392c258c6966a878cd
4
- data.tar.gz: f9ee0fada5a89c6066200083a4a36697bd64a34b
3
+ metadata.gz: 914a50c4213246b7ccd438bb7b42fce3aa973a33
4
+ data.tar.gz: a133f2e998b628a9c218dcafed4a955ab51dd9a3
5
5
  SHA512:
6
- metadata.gz: 4ed5a00200e1d13004391d50580a64401854e57621d949ccfa331c7ce01d59cac0977bbfe3244242d08d7e41397bdd4c3fd90e23ac7703f4006c52a936b730c4
7
- data.tar.gz: efcd4f7eb27a5f11770efead87f3c40118a441293205a72153a2e197f06a8988cf44b30beb99ae4a91c07f7f074a41a32868fe8d899c8f9309ff89b82298686f
6
+ metadata.gz: 0a27ffe8f53ec8b1527fb7597e61e2aa892fdf242e4bcd7430a3f4766a262cbdeb38e98795f20e9ec8b252936bcdf8aa540689f5c1882e5d5d60157689edbac8
7
+ data.tar.gz: 75823ab95659bdc6db3f5ff3a5d712ea054767c26dc432128fad789044d58ed6d35170db6654a7f50fd3dbf5a86c8d6d184bea3a859a77f918ce0569241ee972
data/.gitignore CHANGED
@@ -1,49 +1,11 @@
1
- # rcov generated
2
- coverage
3
- coverage.data
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ spec/dummy/logs
5
+ spec/dummy/public
6
+ spec/dummy/temp
4
7
 
5
- # rdoc generated
6
- rdoc
8
+ *.gem
7
9
 
8
- # yard generated
9
- doc
10
- .yardoc
11
-
12
- # bundler
13
- .bundle
14
-
15
- # jeweler generated
16
- pkg
17
-
18
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
19
- #
20
- # * Create a file at ~/.gitignore
21
- # * Include files you want ignored
22
- # * Run: git config --global core.excludesfile ~/.gitignore
23
- #
24
- # After doing this, these files will be ignored in all your git projects,
25
- # saving you from having to 'pollute' every project you touch with them
26
- #
27
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
28
- #
29
- # For MacOS:
30
- #
10
+ Gemfile.lock
31
11
  .DS_Store
32
-
33
- # For TextMate
34
- #*.tmproj
35
- #tmtags
36
-
37
- # For emacs:
38
- #*~
39
- #\#*
40
- #.\#*
41
-
42
- # For vim:
43
- #*.swp
44
-
45
- # For redcar:
46
- #.redcar
47
-
48
- # For rubinius:
49
- #*.rbc
data/.rspec CHANGED
@@ -1 +1 @@
1
- --color
1
+ --color --format nested
data/Gemfile CHANGED
@@ -21,4 +21,8 @@ group :test do
21
21
 
22
22
  gem 'shoulda'
23
23
  gem 'shoulda-matchers'
24
+
25
+ gem 'geocoder'
26
+ gem 'mongoid_geospatial'
27
+ gem 'gmaps4rails'
24
28
  end
data/README.md CHANGED
@@ -16,7 +16,7 @@ You can use a simple `include OnTheMap::XXXX` in its place or some other concern
16
16
 
17
17
  ### Adressable
18
18
 
19
- * embeds an `address` on the model
19
+ * embeds an `address` on the model using `adressable` polymorphic relationship
20
20
  * adds delegate methods to all embedded address fields (setters/getters)
21
21
  * adds `full_address` method that returns full adress from concatenation of all fields
22
22
 
@@ -28,6 +28,11 @@ class MyModel
28
28
 
29
29
  include_concern :addressable, from: :on_the_map
30
30
  end
31
+
32
+
33
+ model = MyModel.new
34
+ model.addressable = Address.new street: 'madison avenue 1'
35
+ model.addressable.city == 'New York'
31
36
  ```
32
37
 
33
38
  ### GeoLocatable
@@ -36,6 +41,20 @@ end
36
41
  * performs geocoding to calculate new position after an address is created or updated
37
42
  * adds `latitude` and `longitude` to model
38
43
 
44
+ *Usage*
45
+
46
+ Gemfile
47
+
48
+ ```ruby
49
+ gem 'geocoder'
50
+ ```
51
+
52
+ Depending on usage scenario, you might have to explicitly require *geocoder* also.
53
+
54
+ `require 'geocoder'`
55
+
56
+ Include the concern:
57
+
39
58
  ```ruby
40
59
  class MyModel
41
60
  include Mongoid::Document
@@ -46,11 +65,25 @@ end
46
65
 
47
66
  ### Mappable
48
67
 
49
- * include `Gmaps4rails::ActsAsGmappable`
68
+ * includes `Gmaps4rails::ActsAsGmappable`
50
69
  * adds field `normalized_address` to store full address calculated and returned by Google Maps geo-coding
51
70
  * adds method `gmaps4rails_address` which returns adress used in gmaps geo-coding (if enabled)
52
71
  * includes `geo_locatable` and `positionable` concerns.
53
72
 
73
+ *Usage*
74
+
75
+ Gemfile
76
+
77
+ ```ruby
78
+ gem 'gmaps4rails'
79
+ ```
80
+
81
+ Depending on usage scenario, you might have to explicitly require *gmaps4rails* also.
82
+
83
+ `require 'gmaps4rails'`
84
+
85
+ Include the concern:
86
+
54
87
  ```ruby
55
88
  class MyModel
56
89
  include Mongoid::Document
@@ -66,6 +99,22 @@ end
66
99
  * adds spatial indexing for position field
67
100
  * positon field is indexed and used in geo-searches (fx find points near a point)
68
101
 
102
+ *Usage*
103
+
104
+ Gemfile
105
+
106
+ ```ruby
107
+ gem 'mongoid_geospatial'
108
+ ```
109
+
110
+ Depending on usage scenario, you might have to explicitly require *mongoid_geospatial* also.
111
+
112
+ `require 'mongoid_geospatial'`
113
+
114
+ Include the concern:
115
+
116
+
117
+
69
118
  ```ruby
70
119
  class MyModel
71
120
  include Mongoid::Document
@@ -19,7 +19,7 @@ module OnTheMap
19
19
  geocoded_by :full_address, coordinates: :position, skip_index: true do |obj,results|
20
20
  if geo = results.first
21
21
  if geo.latitude && geo.longitude
22
- obj.geocoding_started!
22
+ obj.send :geocoding_started!
23
23
 
24
24
  Address.geo_address_fields.each do |fname|
25
25
  geo_value = geo.send fname
@@ -35,7 +35,7 @@ module OnTheMap
35
35
  # obj.gmaps = true
36
36
  # end
37
37
 
38
- obj.geocoding_done!
38
+ obj.send :geocoding_done!
39
39
  end
40
40
  end
41
41
  end
@@ -1,3 +1,3 @@
1
1
  module OnTheMap
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
data/on_the_map.gemspec CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "Add map, address and geocoding functionality to your Mongoid models"
12
12
  spec.description = "Makes it easy to add functionality to models related to geocoding, addressing and placing them as pins on a map"
13
13
  spec.email = "kmandrup@gmail.com"
14
+ spec.homepage = "https://github.com/kristianmandrup/on_the_map"
14
15
  spec.license = "MIT"
15
16
 
16
17
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: on_the_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristian Mandrup
@@ -101,13 +101,11 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .document
105
104
  - .gitignore
106
105
  - .rspec
107
106
  - .rvmrc
108
107
  - Changelog.md
109
108
  - Gemfile
110
- - Gemfile.lock
111
109
  - LICENSE
112
110
  - README.md
113
111
  - Rakefile
@@ -128,7 +126,7 @@ files:
128
126
  - spec/on_the_map_spec.rb
129
127
  - spec/spec_helper.rb
130
128
  - spec/support/gmaps_lookup_stubs.rb
131
- homepage:
129
+ homepage: https://github.com/kristianmandrup/on_the_map
132
130
  licenses:
133
131
  - MIT
134
132
  metadata: {}
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/Gemfile.lock DELETED
@@ -1,155 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- on_the_map (0.1.3)
5
- concerned (>= 0.1.5)
6
- hashie (>= 2.0)
7
- mongoid (>= 3.1)
8
- rails (>= 3.2)
9
- sugar-high (~> 0.7.3)
10
-
11
- GEM
12
- remote: http://rubygems.org/
13
- specs:
14
- actionmailer (3.2.13)
15
- actionpack (= 3.2.13)
16
- mail (~> 2.5.3)
17
- actionpack (3.2.13)
18
- activemodel (= 3.2.13)
19
- activesupport (= 3.2.13)
20
- builder (~> 3.0.0)
21
- erubis (~> 2.7.0)
22
- journey (~> 1.0.4)
23
- rack (~> 1.4.5)
24
- rack-cache (~> 1.2)
25
- rack-test (~> 0.6.1)
26
- sprockets (~> 2.2.1)
27
- activemodel (3.2.13)
28
- activesupport (= 3.2.13)
29
- builder (~> 3.0.0)
30
- activerecord (3.2.13)
31
- activemodel (= 3.2.13)
32
- activesupport (= 3.2.13)
33
- arel (~> 3.0.2)
34
- tzinfo (~> 0.3.29)
35
- activeresource (3.2.13)
36
- activemodel (= 3.2.13)
37
- activesupport (= 3.2.13)
38
- activesupport (3.2.13)
39
- i18n (= 0.6.1)
40
- multi_json (~> 1.0)
41
- arel (3.0.2)
42
- bourne (1.1.2)
43
- mocha (= 0.10.5)
44
- builder (3.0.4)
45
- chronic (0.9.1)
46
- colorize (0.5.8)
47
- concerned (0.1.6)
48
- cutter (0.8.9)
49
- colorize (>= 0.5)
50
- database_cleaner (0.9.1)
51
- delorean (1.1.1)
52
- chronic
53
- diff-lcs (1.2.1)
54
- erubis (2.7.0)
55
- factory_girl (4.2.0)
56
- activesupport (>= 3.0.0)
57
- fakeweb (1.3.0)
58
- ffaker (1.15.0)
59
- hashie (2.0.3)
60
- hike (1.2.1)
61
- i18n (0.6.1)
62
- journey (1.0.4)
63
- json (1.7.7)
64
- mail (2.5.3)
65
- i18n (>= 0.4.0)
66
- mime-types (~> 1.16)
67
- treetop (~> 1.4.8)
68
- metaclass (0.0.1)
69
- mime-types (1.22)
70
- mocha (0.10.5)
71
- metaclass (~> 0.0.1)
72
- mongoid (3.1.2)
73
- activemodel (~> 3.2)
74
- moped (~> 1.4.2)
75
- origin (~> 1.0)
76
- tzinfo (~> 0.3.22)
77
- moped (1.4.5)
78
- multi_json (1.6.1)
79
- origin (1.0.11)
80
- polyglot (0.3.3)
81
- rack (1.4.5)
82
- rack-cache (1.2)
83
- rack (>= 0.4)
84
- rack-ssl (1.3.3)
85
- rack
86
- rack-test (0.6.2)
87
- rack (>= 1.0)
88
- rails (3.2.13)
89
- actionmailer (= 3.2.13)
90
- actionpack (= 3.2.13)
91
- activerecord (= 3.2.13)
92
- activeresource (= 3.2.13)
93
- activesupport (= 3.2.13)
94
- bundler (~> 1.0)
95
- railties (= 3.2.13)
96
- railties (3.2.13)
97
- actionpack (= 3.2.13)
98
- activesupport (= 3.2.13)
99
- rack-ssl (~> 1.3.2)
100
- rake (>= 0.8.7)
101
- rdoc (~> 3.4)
102
- thor (>= 0.14.6, < 2.0)
103
- rake (10.0.4)
104
- rdoc (3.12.2)
105
- json (~> 1.4)
106
- rspec (2.13.0)
107
- rspec-core (~> 2.13.0)
108
- rspec-expectations (~> 2.13.0)
109
- rspec-mocks (~> 2.13.0)
110
- rspec-core (2.13.0)
111
- rspec-expectations (2.13.0)
112
- diff-lcs (>= 1.1.3, < 2.0)
113
- rspec-mocks (2.13.0)
114
- rspec-rails (2.13.0)
115
- actionpack (>= 3.0)
116
- activesupport (>= 3.0)
117
- railties (>= 3.0)
118
- rspec-core (~> 2.13.0)
119
- rspec-expectations (~> 2.13.0)
120
- rspec-mocks (~> 2.13.0)
121
- shoulda (3.3.2)
122
- shoulda-context (~> 1.0.1)
123
- shoulda-matchers (~> 1.4.1)
124
- shoulda-context (1.0.2)
125
- shoulda-matchers (1.4.2)
126
- activesupport (>= 3.0.0)
127
- bourne (~> 1.1.2)
128
- sprockets (2.2.2)
129
- hike (~> 1.2)
130
- multi_json (~> 1.0)
131
- rack (~> 1.0)
132
- tilt (~> 1.1, != 1.3.0)
133
- sugar-high (0.7.3)
134
- thor (0.18.1)
135
- tilt (1.3.6)
136
- treetop (1.4.12)
137
- polyglot
138
- polyglot (>= 0.3.1)
139
- tzinfo (0.3.37)
140
-
141
- PLATFORMS
142
- ruby
143
-
144
- DEPENDENCIES
145
- cutter (>= 0.8.2)
146
- database_cleaner (>= 0.8)
147
- delorean (>= 1.1.1)
148
- factory_girl
149
- fakeweb
150
- ffaker (>= 1.14)
151
- on_the_map!
152
- rspec (>= 2.12.0)
153
- rspec-rails (>= 2.12)
154
- shoulda
155
- shoulda-matchers