Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced ActsAsMappable#in_bounds to allow the query to include thing… #139

Merged

Conversation

denisahearn
Copy link
Contributor

…s that are located on the rectangular bounds, via an "inclusive" option (defaults to false).

…s that are located on the rectangular bounds, via an "inclusive" option (defaults to false).
bounds = [sw,ne]
locations = Location.in_bounds(bounds, :inclusive => false)
assert_equal 0, locations.count
locations = Location.in_bounds(bounds, :inclusive => true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I would, but I followed the style in the existing code.

sw = Geokit::LatLng.new(@loc_a.lat,@loc_a.lng)
ne = sw
bounds = [sw,ne]
locations = Location.in_bounds(bounds, :inclusive => false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I would, but I followed the style in the existing code.

def test_find_within_bounds_with_inclusive
sw = Geokit::LatLng.new(@loc_a.lat,@loc_a.lng)
ne = sw
bounds = [sw,ne]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceAfterComma: Space missing after comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I would, but I followed the style in the existing code.

@@ -389,6 +389,16 @@ def test_find_within_bounds
assert_equal 2, locations.count
end

def test_find_within_bounds_with_inclusive
sw = Geokit::LatLng.new(@loc_a.lat,@loc_a.lng)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceAfterComma: Space missing after comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I would, but I followed the style in the existing code.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.2%) to 85.614% when pulling dc52dc3 on SenteraLLC:dpa-in-bounds-inclusive-option into 93b7153 on geokit:master.

@denisahearn
Copy link
Contributor Author

Just checking to see if this PR can get merged into this project? Thanks.

@mnoack
Copy link
Member

mnoack commented Jan 30, 2019

@denisahearn - Sorry I haven't responded timely. I think I'll need to find help amongst people contributing to review PRs going forward and I no longer use geokit so it's best to be done by those using geokit.

So if you were available to occasionally review geokit PRs (given they'll affect you, generally positively as the tests are fairly comprehensive) then please accept the invite to become a committer and feel free to merge this PR.

@denisahearn
Copy link
Contributor Author

denisahearn commented Jan 30, 2019

@mnoack Thanks for responding, I've accepted your invitation. Yes, I would be willing to help review PRs for geokit-rails. I will merge my PR. Do you plan to still be the person to release new versions of the gem? It looks like there are a few commits to master since version 2.3.1 was released last May, and I'm curious to know when a new version with my commit will be released to rubygems.org.

@denisahearn denisahearn merged commit cc5fd43 into geokit:master Jan 30, 2019
@denisahearn denisahearn deleted the dpa-in-bounds-inclusive-option branch January 30, 2019 19:54
@mnoack
Copy link
Member

mnoack commented Jan 31, 2019

You're welcome to release gems, I think the process was a standard process like updating the version.rb file and then "bundle exec rake release" or something, feel free to "rake -T" and look for the obvious one.

My general approach was not to release after every PR, but generally as people requested it, as after-all people can point their gemfiles to the github master, this way I felt it got a bit of "testing" that way before publishing, but it really is your call now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants