Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby and install dependencies
uses: ruby/setup-ruby@v1
with:
Expand All @@ -22,7 +22,7 @@ jobs:
ruby: [3.1, 3.2, 3.3]
faraday_version: ['', '~> 1.0'] # Defaults to whatever's the most recent version.
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Ruby and install dependencies
uses: ruby/setup-ruby@v1
Expand All @@ -32,13 +32,13 @@ jobs:
env:
FARADAY_VERSION: ${{ matrix.faraday_version }}

- name: Run tests
- name: "Run tests for Ruby ${{ matrix.ruby }} and Faraday ${{ matrix.faraday_version == '~> 1.0' && '1.x' || 'latest' }}"
run: bundle exec rake spec
env:
FARADAY_VERSION: ${{ matrix.faraday_version }}

- name: Upload coverage artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: coverage
name: "coverage-${{ matrix.ruby }}-${{ matrix.faraday_version == '~> 1.0' && 'faraday-1.x' || 'faraday-latest' }}"
path: coverage/
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require:
- rubocop-rspec

plugins:
- rubocop-rake

inherit_from: .rubocop_todo.yml
Expand Down
4 changes: 2 additions & 2 deletions geo_combine.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rspec-html-matchers'
spec.add_development_dependency 'rubocop', '~> 1.25'
spec.add_development_dependency 'rubocop-rspec', '~> 2.8'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'rubocop-rake'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'webmock', '~> 3.14'
Expand Down
2 changes: 1 addition & 1 deletion lib/geo_combine/ckan_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def geoblacklight_terms
layer_slug_s: @metadata['name'],
solr_geom: envelope,
dc_subject_sm: subjects,
dct_references_s: external_references.to_json.to_s,
dct_references_s: external_references.to_json,
dc_format_s: downloadable? ? 'ZIP' : nil # TODO: we only allow direct ZIP file downloads
}.compact
end
Expand Down
20 changes: 10 additions & 10 deletions lib/geo_combine/ogp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def references
# Builds a Solr Envelope using CQL syntax
# @return [String]
def envelope
raise ArgumentError unless west >= -180 && west <= 180 &&
raise ArgumentError unless west.between?(-180, 180) &&
east >= -180 && east <= 180 &&
north >= -90 && north <= 90 &&
south >= -90 && south <= 90 &&
Expand All @@ -144,6 +144,15 @@ def fgdc
GeoCombine::Fgdc.new(metadata['FgdcText']) if metadata['FgdcText']
end

SLUG_STRIP_VALUES = %w[
SDE_DATA.
SDE.
SDE2.
GISPORTAL.GISOWNER01.
GISDATA.
MORIS.
].freeze

private

##
Expand Down Expand Up @@ -207,15 +216,6 @@ def slug
sluggify(filter_name(name))
end

SLUG_STRIP_VALUES = %w[
SDE_DATA.
SDE.
SDE2.
GISPORTAL.GISOWNER01.
GISDATA.
MORIS.
].freeze

def filter_name(name)
# strip out schema and usernames
SLUG_STRIP_VALUES.each do |strip_val|
Expand Down