geo_combine 0.4.0 → 0.6.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 (61) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +53 -0
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +20 -0
  5. data/.rubocop_todo.yml +165 -0
  6. data/Gemfile +3 -1
  7. data/README.md +80 -1
  8. data/Rakefile +4 -2
  9. data/bin/geocombine +1 -0
  10. data/geo_combine.gemspec +5 -0
  11. data/lib/geo_combine/bounding_box.rb +7 -1
  12. data/lib/geo_combine/ckan_metadata.rb +10 -8
  13. data/lib/geo_combine/cli.rb +3 -1
  14. data/lib/geo_combine/esri_open_data.rb +2 -0
  15. data/lib/geo_combine/exceptions.rb +3 -0
  16. data/lib/geo_combine/fgdc.rb +2 -2
  17. data/lib/geo_combine/formats.rb +2 -0
  18. data/lib/geo_combine/formatting.rb +3 -1
  19. data/lib/geo_combine/geo_blacklight_harvester.rb +211 -0
  20. data/lib/geo_combine/geoblacklight.rb +20 -6
  21. data/lib/geo_combine/geometry_types.rb +2 -0
  22. data/lib/geo_combine/iso19139.rb +2 -1
  23. data/lib/geo_combine/ogp.rb +13 -11
  24. data/lib/geo_combine/railtie.rb +2 -0
  25. data/lib/geo_combine/subjects.rb +2 -0
  26. data/lib/geo_combine/version.rb +3 -1
  27. data/lib/geo_combine.rb +7 -3
  28. data/lib/tasks/geo_combine.rake +57 -26
  29. data/lib/xslt/fgdc2html.xsl +38 -9
  30. data/lib/xslt/iso2html.xsl +1107 -1070
  31. data/spec/features/fgdc2html_spec.rb +53 -1
  32. data/spec/features/iso2html_spec.rb +17 -2
  33. data/spec/fixtures/docs/princeton_fgdc.xml +374 -0
  34. data/spec/fixtures/docs/repos.json +3224 -0
  35. data/spec/fixtures/docs/simple_xml.xml +10 -0
  36. data/spec/fixtures/docs/simple_xslt.xsl +11 -0
  37. data/spec/fixtures/docs/stanford_iso.xml +652 -0
  38. data/spec/fixtures/docs/tufts_fgdc.xml +977 -0
  39. data/spec/fixtures/indexing/basic_geoblacklight.json +27 -0
  40. data/spec/fixtures/indexing/geoblacklight.json +33 -0
  41. data/spec/fixtures/indexing/layers.json +16119 -0
  42. data/spec/fixtures/indexing/test.txt +1 -0
  43. data/spec/fixtures/json_docs.rb +2 -0
  44. data/spec/fixtures/xml_docs.rb +9 -1659
  45. data/spec/helpers.rb +7 -7
  46. data/spec/lib/geo_combine/bounding_box_spec.rb +18 -0
  47. data/spec/lib/geo_combine/ckan_metadata_spec.rb +34 -11
  48. data/spec/lib/geo_combine/esri_open_data_spec.rb +23 -2
  49. data/spec/lib/geo_combine/fgdc_spec.rb +41 -10
  50. data/spec/lib/geo_combine/formatting_spec.rb +13 -5
  51. data/spec/lib/geo_combine/geo_blacklight_harvester_spec.rb +194 -0
  52. data/spec/lib/geo_combine/geoblacklight_spec.rb +41 -11
  53. data/spec/lib/geo_combine/iso19139_spec.rb +26 -14
  54. data/spec/lib/geo_combine/ogp_spec.rb +28 -8
  55. data/spec/lib/geo_combine_spec.rb +7 -4
  56. data/spec/lib/tasks/geo_combine_spec.rb +45 -0
  57. data/spec/spec_helper.rb +19 -84
  58. data/spec/support/fixtures.rb +9 -0
  59. metadata +103 -6
  60. data/.coveralls.yml +0 -1
  61. data/.travis.yml +0 -7
data/spec/spec_helper.rb CHANGED
@@ -1,23 +1,15 @@
1
- # This file was generated by the `rspec --init` command. Conventionally, all
2
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
- # The generated `.rspec` file contains `--require spec_helper` which will cause
4
- # this file to always be loaded, without a need to explicitly require it in any
5
- # files.
6
- #
7
- # Given that it is always loaded, you are encouraged to keep this file as
8
- # light-weight as possible. Requiring heavyweight dependencies from this file
9
- # will add to the boot time of your test suite on EVERY test run, even for an
10
- # individual file that may not need all of that loaded. Instead, consider making
11
- # a separate helper file that requires the additional dependencies and performs
12
- # the additional setup, and require it from the spec files that actually need
13
- # it.
14
- #
15
- # The `.rspec` file also contains a few flags that are not defaults but that
16
- # users commonly want.
17
- #
18
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
- require 'coveralls'
20
- Coveralls.wear!
1
+ # frozen_string_literal: true
2
+
3
+ require 'simplecov'
4
+
5
+ SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
6
+ SimpleCov.start 'rails' do
7
+ add_filter 'lib/tasks/geo_combine.rake'
8
+ add_filter 'lib/geo_combine/version.rb'
9
+ add_filter 'lib/geo_combine/railtie.rb'
10
+ add_filter 'lib/geo_combine/cli.rb'
11
+ minimum_coverage 95 # When updating this value, update the README badge value
12
+ end
21
13
 
22
14
  require 'geo_combine'
23
15
  require 'fixtures/xml_docs'
@@ -26,78 +18,21 @@ require 'helpers'
26
18
  require 'rspec-html-matchers'
27
19
  require 'byebug'
28
20
 
21
+ # Setup webmock for specific tests
22
+ require 'webmock/rspec'
23
+ WebMock.allow_net_connect!
24
+
25
+ # include the spec support files
26
+ Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
27
+
29
28
  RSpec.configure do |config|
30
29
  config.include Helpers
31
30
  config.include RSpecHtmlMatchers
32
- # rspec-expectations config goes here. You can use an alternate
33
- # assertion/expectation library such as wrong or the stdlib/minitest
34
- # assertions if you prefer.
35
31
  config.expect_with :rspec do |expectations|
36
- # This option will default to `true` in RSpec 4. It makes the `description`
37
- # and `failure_message` of custom matchers include text for helper methods
38
- # defined using `chain`, e.g.:
39
- # be_bigger_than(2).and_smaller_than(4).description
40
- # # => "be bigger than 2 and smaller than 4"
41
- # ...rather than:
42
- # # => "be bigger than 2"
43
32
  expectations.include_chain_clauses_in_custom_matcher_descriptions = true
44
33
  end
45
34
 
46
- # rspec-mocks config goes here. You can use an alternate test double
47
- # library (such as bogus or mocha) by changing the `mock_with` option here.
48
35
  config.mock_with :rspec do |mocks|
49
- # Prevents you from mocking or stubbing a method that does not exist on
50
- # a real object. This is generally recommended, and will default to
51
- # `true` in RSpec 4.
52
36
  mocks.verify_partial_doubles = true
53
37
  end
54
-
55
- # The settings below are suggested to provide a good initial experience
56
- # with RSpec, but feel free to customize to your heart's content.
57
- =begin
58
- # These two settings work together to allow you to limit a spec run
59
- # to individual examples or groups you care about by tagging them with
60
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
61
- # get run.
62
- config.filter_run :focus
63
- config.run_all_when_everything_filtered = true
64
-
65
- # Limits the available syntax to the non-monkey patched syntax that is
66
- # recommended. For more details, see:
67
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
68
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
69
- # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
70
- config.disable_monkey_patching!
71
-
72
- # This setting enables warnings. It's recommended, but in some cases may
73
- # be too noisy due to issues in dependencies.
74
- config.warnings = true
75
-
76
- # Many RSpec users commonly either run the entire suite or an individual
77
- # file, and it's useful to allow more verbose output when running an
78
- # individual spec file.
79
- if config.files_to_run.one?
80
- # Use the documentation formatter for detailed output,
81
- # unless a formatter has already been configured
82
- # (e.g. via a command-line flag).
83
- config.default_formatter = 'doc'
84
- end
85
-
86
- # Print the 10 slowest examples and example groups at the
87
- # end of the spec run, to help surface which specs are running
88
- # particularly slow.
89
- config.profile_examples = 10
90
-
91
- # Run specs in random order to surface order dependencies. If you find an
92
- # order dependency and want to debug it, you can fix the order by providing
93
- # the seed, which is printed after each run.
94
- # --seed 1234
95
- config.order = :random
96
-
97
- # Seed global randomization in this process using the `--seed` CLI option.
98
- # Setting this allows you to use `--seed` to deterministically reproduce
99
- # test failures related to randomization by passing the same `--seed` value
100
- # as the one that triggered the failure.
101
- Kernel.srand config.seed
102
- =end
103
38
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ def read_fixture(fname)
4
+ File.read(File.join(fixture_dir, fname))
5
+ end
6
+
7
+ def fixture_dir
8
+ @fixture_dir ||= File.join(File.dirname(__FILE__), '../fixtures')
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_combine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2022-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -164,6 +164,76 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.25'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.25'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-rspec
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '2.8'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '2.8'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-rake
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: simplecov
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: webmock
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '3.14'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '3.14'
167
237
  description: A Ruby toolkit for managing geospatial metadata
168
238
  email:
169
239
  - pjreed@stanford.edu
@@ -172,10 +242,11 @@ executables:
172
242
  extensions: []
173
243
  extra_rdoc_files: []
174
244
  files:
175
- - ".coveralls.yml"
245
+ - ".github/workflows/ruby.yml"
176
246
  - ".gitignore"
177
247
  - ".rspec"
178
- - ".travis.yml"
248
+ - ".rubocop.yml"
249
+ - ".rubocop_todo.yml"
179
250
  - Gemfile
180
251
  - LICENSE.txt
181
252
  - README.md
@@ -191,6 +262,7 @@ files:
191
262
  - lib/geo_combine/fgdc.rb
192
263
  - lib/geo_combine/formats.rb
193
264
  - lib/geo_combine/formatting.rb
265
+ - lib/geo_combine/geo_blacklight_harvester.rb
194
266
  - lib/geo_combine/geoblacklight.rb
195
267
  - lib/geo_combine/geometry_types.rb
196
268
  - lib/geo_combine/iso19139.rb
@@ -226,6 +298,16 @@ files:
226
298
  - spec/fixtures/docs/ogp_harvard_line.json
227
299
  - spec/fixtures/docs/ogp_harvard_raster.json
228
300
  - spec/fixtures/docs/ogp_tufts_vector.json
301
+ - spec/fixtures/docs/princeton_fgdc.xml
302
+ - spec/fixtures/docs/repos.json
303
+ - spec/fixtures/docs/simple_xml.xml
304
+ - spec/fixtures/docs/simple_xslt.xsl
305
+ - spec/fixtures/docs/stanford_iso.xml
306
+ - spec/fixtures/docs/tufts_fgdc.xml
307
+ - spec/fixtures/indexing/basic_geoblacklight.json
308
+ - spec/fixtures/indexing/geoblacklight.json
309
+ - spec/fixtures/indexing/layers.json
310
+ - spec/fixtures/indexing/test.txt
229
311
  - spec/fixtures/json_docs.rb
230
312
  - spec/fixtures/xml_docs.rb
231
313
  - spec/helpers.rb
@@ -234,11 +316,14 @@ files:
234
316
  - spec/lib/geo_combine/esri_open_data_spec.rb
235
317
  - spec/lib/geo_combine/fgdc_spec.rb
236
318
  - spec/lib/geo_combine/formatting_spec.rb
319
+ - spec/lib/geo_combine/geo_blacklight_harvester_spec.rb
237
320
  - spec/lib/geo_combine/geoblacklight_spec.rb
238
321
  - spec/lib/geo_combine/iso19139_spec.rb
239
322
  - spec/lib/geo_combine/ogp_spec.rb
240
323
  - spec/lib/geo_combine_spec.rb
324
+ - spec/lib/tasks/geo_combine_spec.rb
241
325
  - spec/spec_helper.rb
326
+ - spec/support/fixtures.rb
242
327
  homepage: ''
243
328
  licenses:
244
329
  - Apache
@@ -258,8 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
343
  - !ruby/object:Gem::Version
259
344
  version: '0'
260
345
  requirements: []
261
- rubyforge_project:
262
- rubygems_version: 2.4.5
346
+ rubygems_version: 3.0.3
263
347
  signing_key:
264
348
  specification_version: 4
265
349
  summary: A Ruby toolkit for managing geospatial metadata
@@ -274,6 +358,16 @@ test_files:
274
358
  - spec/fixtures/docs/ogp_harvard_line.json
275
359
  - spec/fixtures/docs/ogp_harvard_raster.json
276
360
  - spec/fixtures/docs/ogp_tufts_vector.json
361
+ - spec/fixtures/docs/princeton_fgdc.xml
362
+ - spec/fixtures/docs/repos.json
363
+ - spec/fixtures/docs/simple_xml.xml
364
+ - spec/fixtures/docs/simple_xslt.xsl
365
+ - spec/fixtures/docs/stanford_iso.xml
366
+ - spec/fixtures/docs/tufts_fgdc.xml
367
+ - spec/fixtures/indexing/basic_geoblacklight.json
368
+ - spec/fixtures/indexing/geoblacklight.json
369
+ - spec/fixtures/indexing/layers.json
370
+ - spec/fixtures/indexing/test.txt
277
371
  - spec/fixtures/json_docs.rb
278
372
  - spec/fixtures/xml_docs.rb
279
373
  - spec/helpers.rb
@@ -282,8 +376,11 @@ test_files:
282
376
  - spec/lib/geo_combine/esri_open_data_spec.rb
283
377
  - spec/lib/geo_combine/fgdc_spec.rb
284
378
  - spec/lib/geo_combine/formatting_spec.rb
379
+ - spec/lib/geo_combine/geo_blacklight_harvester_spec.rb
285
380
  - spec/lib/geo_combine/geoblacklight_spec.rb
286
381
  - spec/lib/geo_combine/iso19139_spec.rb
287
382
  - spec/lib/geo_combine/ogp_spec.rb
288
383
  - spec/lib/geo_combine_spec.rb
384
+ - spec/lib/tasks/geo_combine_spec.rb
289
385
  - spec/spec_helper.rb
386
+ - spec/support/fixtures.rb
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- service_name: travis-ci
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.2.7
6
- - 2.3.4
7
- - 2.4.1