mongoid-geospatial 5.0.0 → 7.0.0

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.
Files changed (39) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +8 -0
  3. data/.travis.yml +26 -20
  4. data/CHANGELOG.md +23 -0
  5. data/CONTRIBUTING.md +118 -0
  6. data/Gemfile +8 -16
  7. data/Guardfile +2 -2
  8. data/MIT-LICENSE +2 -2
  9. data/README.md +202 -212
  10. data/RELEASING.md +62 -0
  11. data/Rakefile +4 -1
  12. data/lib/mongoid/geospatial/config/point.rb +19 -0
  13. data/lib/mongoid/geospatial/config.rb +29 -0
  14. data/lib/mongoid/geospatial/fields/circle.rb +3 -3
  15. data/lib/mongoid/geospatial/fields/point.rb +29 -10
  16. data/lib/mongoid/geospatial/geometry_field.rb +6 -4
  17. data/lib/mongoid/geospatial/helpers/sphere.rb +1 -1
  18. data/lib/mongoid/geospatial/version.rb +1 -1
  19. data/lib/mongoid/geospatial/wrappers/georuby.rb +1 -0
  20. data/lib/mongoid/geospatial.rb +107 -30
  21. data/mongoid-geospatial.gemspec +3 -4
  22. data/{bench → spec}/bench +1 -1
  23. data/spec/models/bar.rb +1 -0
  24. data/spec/models/event.rb +1 -1
  25. data/spec/models/farm.rb +1 -1
  26. data/spec/models/person.rb +2 -9
  27. data/spec/models/river.rb +7 -7
  28. data/spec/mongoid/geospatial/config_spec.rb +22 -0
  29. data/spec/mongoid/geospatial/fields/line_string_spec.rb +3 -4
  30. data/spec/mongoid/geospatial/fields/point_spec.rb +50 -4
  31. data/spec/mongoid/geospatial/fields/polygon_spec.rb +3 -3
  32. data/spec/mongoid/geospatial/geospatial_spec.rb +80 -8
  33. data/spec/mongoid/geospatial/helpers/core_spec.rb +6 -3
  34. data/spec/mongoid/geospatial/helpers/spatial_spec.rb +3 -3
  35. data/spec/mongoid/geospatial/helpers/sphere_spec.rb +6 -6
  36. data/spec/mongoid.yml +298 -0
  37. data/spec/spec_helper.rb +9 -19
  38. data/spec/support/authentication.rb +0 -1
  39. metadata +18 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e35bbf5de066ee3347846c61de3a32f8f034705b
4
- data.tar.gz: ff4828b80b77ef40b8f3e3a91c3831dcab387e03
2
+ SHA256:
3
+ metadata.gz: c175628dbf99da911bb81c3c25b2665b3547506f910366a53d43eaabea99e410
4
+ data.tar.gz: 8e38f228cc16e9a17cbe44dd2be01bd06e989d5e91d968a9b50a1885cc12eb8e
5
5
  SHA512:
6
- metadata.gz: e5c121ff1e4869322186eebc97362209e08b704957cbd96d2b52d3588005e6f560bced4a287e2251a6e9e16f04d02765f4140222c65b042ac39d7ec20506c987
7
- data.tar.gz: 7576483685a5c3969413e7584ebb82676261ad8b4ffe9758226ce2df17485e16f3e901c6488c35275ab8f92c50f75c4b915d37d4b4878040350e1799646b32cf
6
+ metadata.gz: a09b65028e7d0b27a88383dac691372e6b456ad0d72b3ef0159e8e9e33d7f6da78cb250038c6d592bbb667d9a6f6f864ac1ae8278eaed41b69277d0290a47399
7
+ data.tar.gz: 843567a6bbe62c5551cd962c70a927e2dd8e19968c741ea014e384cf942b99aa75fa382969fe139cc07c835249fb7d864421713cb5e324e0495615fc14b7d30e
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ # Omakase Ruby styling for Rails
2
+ inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3
+
4
+ # Overwrite or add rules to create your own house style
5
+ #
6
+ # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7
+ # Layout/SpaceInsideArrayLiteralBrackets:
8
+ # Enabled: false
data/.travis.yml CHANGED
@@ -1,27 +1,33 @@
1
+ sudo: false
2
+
1
3
  language: ruby
2
- bundler_args: --without development
4
+
5
+ cache: bundler
6
+
7
+ services: mongodb
8
+
3
9
  rvm:
4
- - 1.9.3
5
- - 2.0.0
6
- - 2.1.0
7
- - 2.2.0
8
- - ruby-head
9
- - jruby
10
- - jruby-head
11
- - rbx-2
10
+ - 2.5.3
12
11
 
13
- jdk:
14
- - oraclejdk7
15
- - openjdk7
12
+ before_install:
13
+ - gem update bundler
16
14
 
17
- env: CI="travis" JRUBY_OPTS="--server -Xcompile.invokedynamic=false -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify -J-Xms512m -J-Xmx1024m"
15
+ before_script:
16
+ - bundle exec danger
18
17
 
19
- matrix:
20
- allow_failures:
21
- - rvm: ruby-head
22
- - rvm: jruby-head
18
+ addons:
19
+ apt:
20
+ sources:
21
+ - mongodb-3.2-precise
22
+ packages:
23
+ - mongodb-org-server
23
24
 
24
- services:
25
- - mongodb
25
+ env:
26
+ - MONGOID_VERSION=5
27
+ - MONGOID_VERSION=6
28
+ - MONGOID_VERSION=7
29
+ - MONGOID_VERSION=HEAD
26
30
 
27
- sudo: false
31
+ matrix:
32
+ allow_failures:
33
+ - env: MONGOID_VERSION=HEAD
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ ## 5.1.1 (Next)
2
+
3
+ * Your contribution here.
4
+
5
+ ## 5.1.0 (2018/11/09)
6
+
7
+ * [#61](https://github.com/mongoid/mongoid-geospatial/pull/64): Add global configuration for switching between LngLat and LatLng - [@dblock](https://github.com/dblock).
8
+ * [#59](https://github.com/mongoid/mongoid-geospatial/pull/59), [#65](https://github.com/mongoid/mongoid-geospatial/pull/65): Test against Mongoid 5, 6 and 7 - [@dblock](https://github.com/dblock).
9
+ * [#52](https://github.com/mongoid/mongoid-geospatial/pull/52), [#70](https://github.com/mongoid/mongoid-geospatial/pull/70): Added Danger and Rubocop, PR and code linters - [@dblock](https://github.com/dblock).
10
+
11
+ ## 5.0.0 (2015/07/23)
12
+
13
+ * Mongoid 5 support - [@nofxx](https://github.com/nofxx).
14
+
15
+ ## 4.0.1 (2015/03/04)
16
+
17
+ ## 4.0.0 (2015/01/11)
18
+
19
+ * Mongoid 4 support - [@nofxx](https://github.com/nofxx).
20
+
21
+ ## 3.9.0 (2014/12/22)
22
+
23
+ * Initial public release - [@nofxx](https://github.com/nofxx).
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,118 @@
1
+ Contributing to Mongoid::Geospatial
2
+ ===================================
3
+
4
+ Mongoid::Geospatial is work of [many of contributors](https://github.com/mongoid/mongoid-geospatial/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/mongoid/mongoid-geospatial/pulls), [propose features, ask questions and discuss issues](https://github.com/mongoid/mongoid-geospatial/issues).
5
+
6
+ #### Fork the Project
7
+
8
+ Fork the [project on Github](https://github.com/mongoid/mongoid-geospatial) and check out your copy.
9
+
10
+ ```
11
+ git clone https://github.com/contributor/mongoid-geospatial.git
12
+ cd mongoid-geospatial
13
+ git remote add upstream https://github.com/mongoid/mongoid-geospatial.git
14
+ ```
15
+
16
+ #### Create a Topic Branch
17
+
18
+ Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
19
+
20
+ ```
21
+ git checkout master
22
+ git pull upstream master
23
+ git checkout -b my-feature-branch
24
+ ```
25
+
26
+ #### Bundle Install and Test
27
+
28
+ Ensure that you can build the project and run tests.
29
+
30
+ ```
31
+ bundle install
32
+ bundle exec rake
33
+ ```
34
+
35
+ #### Write Tests
36
+
37
+ Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [spec/mongoid-geospatial](spec/mongoid-geospatial).
38
+
39
+ We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
40
+
41
+ #### Write Code
42
+
43
+ Implement your feature or bug fix.
44
+
45
+ Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop` and fix any style issues highlighted.
46
+
47
+ Make sure that `bundle exec rake` completes without errors.
48
+
49
+ #### Write Documentation
50
+
51
+ Document any external behavior in the [README](README.md).
52
+
53
+ #### Update Changelog
54
+
55
+ Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*. Make it look like every other line, including your name and link to your Github account.
56
+
57
+ #### Commit Changes
58
+
59
+ Make sure git knows your name and email address:
60
+
61
+ ```
62
+ git config --global user.name "Your Name"
63
+ git config --global user.email "contributor@example.com"
64
+ ```
65
+
66
+ Writing good commit logs is important. A commit log should describe what changed and why.
67
+
68
+ ```
69
+ git add ...
70
+ git commit
71
+ ```
72
+
73
+ #### Push
74
+
75
+ ```
76
+ git push origin my-feature-branch
77
+ ```
78
+
79
+ #### Make a Pull Request
80
+
81
+ Go to https://github.com/contributor/mongoid-geospatial and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
82
+
83
+ #### Rebase
84
+
85
+ If you've been working on a change for a while, rebase with upstream/master.
86
+
87
+ ```
88
+ git fetch upstream
89
+ git rebase upstream/master
90
+ git push origin my-feature-branch -f
91
+ ```
92
+
93
+ #### Update CHANGELOG Again
94
+
95
+ Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
96
+
97
+ ```
98
+ * [#123](https://github.com/mongoid/mongoid-geospatial/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
99
+ ```
100
+
101
+ Amend your previous commit and force push the changes.
102
+
103
+ ```
104
+ git commit --amend
105
+ git push origin my-feature-branch -f
106
+ ```
107
+
108
+ #### Check on Your Pull Request
109
+
110
+ Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
111
+
112
+ #### Be Patient
113
+
114
+ It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
115
+
116
+ #### Thank You
117
+
118
+ Please do know that we really appreciate and value your time and work. We love you, really.
data/Gemfile CHANGED
@@ -1,25 +1,17 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
- gemspec # Specify gem's dependencies in mongoid_geospatial.gemspec
3
+ gem 'mongoid'
4
4
 
5
- gem 'rake'
5
+ gemspec
6
6
 
7
- group :test do
8
- gem 'pry'
9
- gem 'yard'
10
- gem 'nokogiri'
11
-
12
- gem 'dbf'
13
- gem 'rgeo'
14
- gem 'georuby'
15
-
16
- gem 'rspec'
17
-
18
- gem 'rubocop'
7
+ group :development, :test do
19
8
  gem 'fuubar'
9
+ gem 'rake'
20
10
  gem 'guard'
21
- gem 'guard-rubocop'
22
11
  gem 'guard-rspec'
12
+ gem 'rubocop'
13
+ end
23
14
 
15
+ group :test do
24
16
  gem 'coveralls', require: false if ENV['CI']
25
17
  end
data/Guardfile CHANGED
@@ -11,6 +11,6 @@ end
11
11
 
12
12
  guard :rspec, cmd: 'bundle exec rspec', notification: true do
13
13
  watch(/^spec\/.+_spec\.rb$/)
14
- watch(/^lib\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
15
- watch('spec/spec_helper.rb') { 'spec' }
14
+ watch(/^lib\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
15
+ watch('spec/spec_helper.rb') { 'spec' }
16
16
  end
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2015 Mongoid Geospatial Authors
1
+ Copyright (c) 2009-2017 Mongoid Geospatial Authors
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.