mongoid-geospatial 7.3.1 → 7.4.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9437e8d6af695bcba5f39208f8219019da404fc51b863c4fb7940567183c5c9f
4
- data.tar.gz: 2a3ca5f675cd58c204462b7122b84341c63cee8222f3372a014d1ed3096f82f0
3
+ metadata.gz: 77732d97fcf13d8b329a0c7b77cd27b77d263ee401f31b77863719a8317bcab4
4
+ data.tar.gz: e0af820b7f2fea0d0563fcec8ea8f73f8f7bc79a0c5de04ccb75032022352f6f
5
5
  SHA512:
6
- metadata.gz: 82fe874fb74ab68457b2e9c56c202bd94ff6c71626832fa0a514d8ce7741282bff68d7c08601806c72e56bf4364d5173f3cdfdaca47b005c86f698f0601d9697
7
- data.tar.gz: fb2a788d4559688612083fddb24ef77d632d0d18b58aa5f3a6216ca58d6c6220a88180db3b009f4697fda2aa0cb95a43d3ef2d11ccc6e0d8a4f8003cc320227c
6
+ metadata.gz: b46d8145c7f86fd125c613bf86f301fe96dc10dd454cf41e09006d43f1ec2bfb1eda1832c0a16ab34a6ecbab7a88f729d3d80ed2571923936e5dd210de919c57
7
+ data.tar.gz: 8c36af289e9eeb7ab4768c9e0c00963e294a89c05a1f913005a0f665e5eb97df3144ae528c25e24c5f475fb6c24be3f199276323d5e28172e4ef5c35438ecd17
data/README.md CHANGED
@@ -3,13 +3,16 @@
3
3
  A Mongoid Extension that simplifies the use of MongoDB spatial features.
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/mongoid-geospatial.svg)](http://badge.fury.io/rb/mongoid-geospatial)
6
- [![Code Climate](https://codeclimate.com/github/mongoid/mongoid-geospatial.svg)](https://codeclimate.com/github/mongoid/mongoid-geospatial)
6
+ [![Test](https://github.com/mongoid/mongoid-geospatial/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/mongoid/mongoid-geospatial/actions/workflows/test.yml?query=branch%3Amaster)
7
7
  [![Coverage Status](https://coveralls.io/repos/github/mongoid/mongoid-geospatial/badge.svg?branch=master)](https://coveralls.io/github/mongoid/mongoid-geospatial?branch=master)
8
- [![Build Status](https://travis-ci.org/mongoid/mongoid-geospatial.svg?branch=master)](https://travis-ci.org/mongoid/mongoid-geospatial)
8
+
9
+ The Ruby 4.0 CI job measures all library files with SimpleCov and submits `coverage/.resultset.json` through the official Coveralls action using GitHub's automatic token. Other matrix jobs do not upload duplicate reports. Run `COVERAGE=true bundle install` and `COVERAGE=true bundle exec rake spec` to measure coverage locally. An accepted upstream default-branch build is required for the badge; this workflow alone does not activate the external service.
9
10
 
10
11
  ## Quick Start
11
12
 
12
- This gem focuses on (making helpers for) MongoDB's spatial features using Mongoid 5, 6 and 7.
13
+ This gem focuses on (making helpers for) MongoDB's spatial features using Mongoid.
14
+
15
+ CI tests representative compatible combinations of Ruby 3.1 through 4.0, Mongoid 7 through 9, and MongoDB Server 4.4 through 8.0, including Ruby 4.0 / Mongoid 9 / MongoDB 8.0. See [the test matrix](.github/workflows/test.yml); this is not a Cartesian product of supported versions. The existing Ruby 3.1 minimum in this branch excludes the historical Ruby 2.x / Mongoid 5–6 combinations. Set `MONGOID_VERSION` to select a Mongoid major version and `MONGODB_HOST` to override the default `localhost:27017` when running tests.
13
16
 
14
17
  ```ruby
15
18
  # Gemfile
@@ -34,6 +34,19 @@ module Mongoid
34
34
  alias to_xy mongoize
35
35
  alias to_lng_lat mongoize
36
36
 
37
+ # Two points are the same spot when they hold the same pair. Without
38
+ # this, `==` was object identity (Enumerable does not bring one), so a
39
+ # point loaded twice never equalled itself: `place.geom == city.geom`
40
+ # was false for the very same [x, y]. Only a Point equals a Point —
41
+ # `to_a` is the door to compare with an Array. z is not stored (see
42
+ # #mongoize), so it does not take part.
43
+ def ==(other)
44
+ other.is_a?(Point) && mongoize == other.mongoize
45
+ end
46
+ alias eql? ==
47
+
48
+ def hash = [Point, mongoize].hash
49
+
37
50
  def [](args)
38
51
  raise ArgumentError, "Invalid point: #{inspect}" unless (pair = mongoize)
39
52
 
@@ -87,7 +87,7 @@ module Mongoid
87
87
  #
88
88
  # @return [Object]
89
89
  def demongoize(obj)
90
- obj && new(obj)
90
+ obj && new(obj.is_a?(Hash) ? obj['coordinates'] || obj[:coordinates] : obj)
91
91
  end
92
92
  end
93
93
  end
@@ -3,6 +3,6 @@
3
3
  module Mongoid
4
4
  # Mongoid Geospatial version
5
5
  module Geospatial
6
- VERSION = '7.3.1'
6
+ VERSION = '7.4.1'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-geospatial
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.1
4
+ version: 7.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ong
8
8
  - Marcos Piccinini
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 1980-01-02 00:00:00.000000000 Z
12
+ date: 2026-10-15 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: mongoid
@@ -57,6 +58,7 @@ licenses:
57
58
  - MIT
58
59
  metadata:
59
60
  rubygems_mfa_required: 'true'
61
+ post_install_message:
60
62
  rdoc_options: []
61
63
  require_paths:
62
64
  - lib
@@ -71,7 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
73
  - !ruby/object:Gem::Version
72
74
  version: '0'
73
75
  requirements: []
74
- rubygems_version: 3.6.7
76
+ rubygems_version: 3.5.16
77
+ signing_key:
75
78
  specification_version: 4
76
79
  summary: Mongoid Extension that simplifies MongoDB Geospatial Operations.
77
80
  test_files: []