From f2d8ca8619d5019bec6dcf2d33281ef7c6e9a26b Mon Sep 17 00:00:00 2001 From: Keith Doggett Date: Mon, 28 Nov 2022 10:05:02 -0500 Subject: [PATCH 1/6] Test RGeo3 Compatibility --- Gemfile | 2 ++ test/basic_test.rb | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 20c4453..3bc2247 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,5 @@ source "https://rubygems.org" gemspec gem "ffi-geos", ">= 0.0.4" + +gem "rgeo", "~> 3.0.0.pre.rc.3" diff --git a/test/basic_test.rb b/test/basic_test.rb index da78bf6..8adb2da 100644 --- a/test/basic_test.rb +++ b/test/basic_test.rb @@ -4,7 +4,8 @@ require_relative "../lib/rgeo-geojson" class BasicTest < Minitest::Test # :nodoc: def setup - @geo_factory = RGeo::Cartesian.simple_factory(srid: 4326) + ruby_wkt_opts = { convert_case: :upper } + @geo_factory = RGeo::Cartesian.simple_factory(srid: 4326, wkt_generator: ruby_wkt_opts) @geo_factory_z = RGeo::Cartesian.simple_factory(srid: 4326, has_z_coordinate: true) @geo_factory_m = RGeo::Cartesian.simple_factory(srid: 4326, has_m_coordinate: true) @geo_factory_zm = RGeo::Cartesian.simple_factory(srid: 4326, has_z_coordinate: true, has_m_coordinate: true) @@ -22,13 +23,13 @@ def test_nil def test_decode_simple_point json = %({"type":"Point","coordinates":[1,2]}) - point = RGeo::GeoJSON.decode(json) + point = RGeo::GeoJSON.decode(json, geo_factory: @geo_factory) assert_equal "POINT (1.0 2.0)", point.as_text end def test_decode_point json = '{"type":"Feature","geometry":{"type":"Point","coordinates":[2.5,4.0]},"properties":{"color":"red"}}' - feature = RGeo::GeoJSON.decode(json) + feature = RGeo::GeoJSON.decode(json, geo_factory: @geo_factory) assert_equal "red", feature["color"] assert_equal "POINT (2.5 4.0)", feature.geometry.as_text end @@ -223,10 +224,10 @@ def test_feature_collection @geo_factory.point(10, 20) ] object = @entity_factory.feature_collection([ - @entity_factory.feature(geometries[0]), - @entity_factory.feature(geometries[1]), - @entity_factory.feature(geometries[2], 8) - ]) + @entity_factory.feature(geometries[0]), + @entity_factory.feature(geometries[1]), + @entity_factory.feature(geometries[2], 8) + ]) json = { "type" => "FeatureCollection", "features" => [ From 27ef4ebf8610da7384f7cfeae37b432059289015 Mon Sep 17 00:00:00 2001 From: Keith Doggett Date: Mon, 28 Nov 2022 10:10:23 -0500 Subject: [PATCH 2/6] Add testing CI --- .github/workflows/CI.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..320cda0 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,29 @@ +name: Tests +on: [push, pull_request] + +jobs: + tests: + runs-on: ${{ matrix.os }}-latest + strategy: + matrix: + ruby: + - head + - "3.0" + - "2.7" + - "2.6" + - "jruby" + os: + - ubuntu + - macos + steps: + - name: Set Up Gems + uses: actions/checkout@v2 + - name: Install GEOS + run: sudo apt-get install libgeos-dev + - name: Set Up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Test + run: bundle exec rake From 0255102d29257ecadf47d216e4e739793f722b08 Mon Sep 17 00:00:00 2001 From: Keith Doggett Date: Mon, 28 Nov 2022 10:12:09 -0500 Subject: [PATCH 3/6] Fix geos install for different OS's --- .github/workflows/CI.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 320cda0..e5efdd1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,8 +18,14 @@ jobs: steps: - name: Set Up Gems uses: actions/checkout@v2 - - name: Install GEOS - run: sudo apt-get install libgeos-dev + - name: Install Geos (Linux) + if: matrix.os == 'ubuntu' + run: | + sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable + sudo apt-get install -yqq libgeos-dev + - name: Install Geos (Mac) + if: matrix.os == 'macos' + run: HOMEBREW_NO_INSTALL_CLEANUP=1 brew install geos - name: Set Up Ruby uses: ruby/setup-ruby@v1 with: From d85ecf237576aaa13b09cceaf4b2ea517cf70661 Mon Sep 17 00:00:00 2001 From: Keith Doggett Date: Mon, 28 Nov 2022 10:14:50 -0500 Subject: [PATCH 4/6] pin jruby to 9.3.7.0 --- .github/workflows/CI.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e5efdd1..81778be 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,7 @@ jobs: - "3.0" - "2.7" - "2.6" - - "jruby" + - "jruby-9.3.7.0" os: - ubuntu - macos diff --git a/README.md b/README.md index d8ae556..a4f7a84 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # rgeo-geojson [![Gem Version](https://badge.fury.io/rb/rgeo-geojson.svg)](http://badge.fury.io/rb/rgeo-geojson) -[![Build Status](https://travis-ci.org/rgeo/rgeo-geojson.svg?branch=master)](https://travis-ci.org/rgeo/rgeo-geojson) +[![CI](https://github.com/rgeo/rgeo/workflows/CI/badge.svg)](https://github.com/rgeo/rgeo-geojson/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush) `rgeo-geojson` is an extension to [RGeo](https://github.com/rgeo/rgeo) that provides GeoJSON encoding and decoding. From c37b86c394130b5a73f1f1232eb3057d446ed733 Mon Sep 17 00:00:00 2001 From: Keith Doggett Date: Mon, 28 Nov 2022 10:34:04 -0500 Subject: [PATCH 5/6] update badge url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4f7a84..38ad37a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # rgeo-geojson [![Gem Version](https://badge.fury.io/rb/rgeo-geojson.svg)](http://badge.fury.io/rb/rgeo-geojson) -[![CI](https://github.com/rgeo/rgeo/workflows/CI/badge.svg)](https://github.com/rgeo/rgeo-geojson/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush) +[![CI](https://github.com/rgeo/rgeo-geojson/workflows/CI/badge.svg)](https://github.com/rgeo/rgeo-geojson/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush) `rgeo-geojson` is an extension to [RGeo](https://github.com/rgeo/rgeo) that provides GeoJSON encoding and decoding. From 14f408568ebf64c067908810778fbfeab27b693d Mon Sep 17 00:00:00 2001 From: Keith Doggett Date: Mon, 28 Nov 2022 10:38:02 -0500 Subject: [PATCH 6/6] drop travis CI --- .travis.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cebe15a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -cache: bundler -addons: - apt: - packages: - - libgeos-dev -language: ruby -rvm: - - 2.7 - - 2.6 - - 2.5 - - 2.4 - - 2.3 - - jruby-9.2.13.0