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

Update to lutaml-model 0.3.10 for schemaLocation support #10

Merged
merged 4 commits into from
Sep 11, 2024
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
4 changes: 2 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-08-30 12:07:56 UTC using RuboCop version 1.65.1.
# on 2024-09-11 04:07:13 UTC using RuboCop version 1.66.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -17,7 +17,7 @@ Gemspec/RequiredRubyVersion:
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 37
Max: 40

# Offense count: 323
# Configuration parameters: AllowedConstants.
Expand Down
11 changes: 6 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ source "https://rubygems.org"
# Specify your gem's dependencies in ogc-gml.gemspec
gemspec

gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"

gem "rubocop", "~> 1.21"
gem "equivalent-xml"
gem "pry"
gem "rake"
gem "rspec"
gem "rubocop"
gem "xml-c14n"
2 changes: 0 additions & 2 deletions lib/ogc/gml/dictionary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class Dictionary < Lutaml::Model::Serializable
attribute :remarks, :string
attribute :dictionary_entry, DictionaryEntry, collection: true
attribute :indirect_entry, IndirectEntry, collection: true
attribute :schema_location, :string

xml do
root "Dictionary"
namespace "http://www.opengis.net/gml/3.2", "gml"

map_attribute "schemaLocation", to: :schema_location, prefix: "xsi", namespace: "http://www.w3.org/2001/XMLSchema-instance"
map_attribute "id", to: :id, prefix: "gml", namespace: "http://www.opengis.net/gml/3.2"
map_attribute "aggregationType", to: :aggregation_type, prefix: "gml", namespace: "http://www.opengis.net/gml/3.2"

Expand Down
9 changes: 1 addition & 8 deletions ogc-gml.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = ">= 2.7.0"

spec.add_runtime_dependency "lutaml-model"
spec.add_runtime_dependency "lutaml-model", "~> 0.3.10"
spec.add_runtime_dependency "nokogiri"

spec.add_development_dependency "equivalent-xml"
spec.add_development_dependency "pry", "~> 0.12.2"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.11"
spec.add_development_dependency "rubocop", "~> 1.58"
spec.add_development_dependency "xml-c14n"
end
2 changes: 1 addition & 1 deletion spec/ogc/gml/composite_curve_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
).gsub("\t", " ")
end

it "does something useful" do
it "round-trips CompositeCurve.xml" do
output = Ogc::Gml::CompositeCurve.from_xml(input).to_xml(
pretty: true,
declaration: true,
Expand Down
7 changes: 5 additions & 2 deletions spec/ogc/gml/polygon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ def file_contents(filename)
%w[
gmlring2.xml
].each do |filename|
xit "round-trips #{filename}" do
input = file_contents(filename)
it "round-trips #{filename}" do
input = file_contents(filename).sub(
"xsi:schemaLocation=\"http://www.opengis.net/gml/3.2\n http://schemas.opengis.net/gml/3.2.1/gml.xsd\"",
" "
)
output = Ogc::Gml::Polygon.from_xml(input).to_xml(
pretty: true,
declaration: true,
Expand Down
Loading