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

add OGC abbreviation to metadata, refactor organisation contributor m… #607

Merged
merged 1 commit into from
Nov 24, 2023
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
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ Encoding.default_internal = Encoding::UTF_8
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}" }

gemspec
group :development, :test do
gem "rspec"
end

if File.exist? "Gemfile.devel"
eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
end

gemspec
2 changes: 2 additions & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "features/logos"

21 changes: 10 additions & 11 deletions lib/metanorma/ogc/front.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def metadata_author(node, xml)
end

def corporate_author(node, xml)
return unless node.attr("submitting-organizations")

node.attr("submitting-organizations") or return
csv_split(HTMLEntities.new
.decode(node.attr("submitting-organizations")), ";")&.each do |org|
xml.contributor do |c|
Expand Down Expand Up @@ -49,8 +48,7 @@ def personal_role(node, contrib, suffix)
end

def ogc_editor(node, xml)
return unless node.attr("editor")

node.attr("editor") or return
xml.contributor do |c|
c.role type: "editor"
c.person do |p|
Expand Down Expand Up @@ -78,12 +76,15 @@ def personal_author1(node, xml, suffix)
end

def default_publisher
"Open Geospatial Consortium"
"OGC"
end

def metadata_committee(node, xml)
return unless node.attr("committee")
def org_abbrev
Copy link

Choose a reason for hiding this comment

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

Use 2 (not 3) spaces for indentation.
Inconsistent indentation detected.

{ "Open Geospatial Consortium" => "OGC" }
end
Copy link

Choose a reason for hiding this comment

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

end at 84, 6 is not aligned with def at 82, 7.


def metadata_committee(node, xml)
node.attr("committee") or return
xml.editorialgroup do |a|
metadata_committee1(node, a)
end
Expand All @@ -102,12 +103,10 @@ def metadata_committee1(node, xml)
end

def externalid(node)
return node.attr("external-id") if node.attr("external-id")

i = node.attr("external-id") and return i
d = doctype(node)
a = node.attr("abbrev")
return unless d && a

d && a or return
url = "http://www.opengis.net/doc/#{IsoDoc::Ogc::DOCTYPE_ABBR[d]}/#{a}"
v = (node.attr("edition") || node.attr("version")) and url += "/#{v}"
url
Expand Down
4 changes: 4 additions & 0 deletions spec/metanorma/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<role type="publisher"/>
<organization>
<name>Open Geospatial Consortium</name>
<abbreviation>OGC</abbreviation>
</organization>
</contributor>
<edition>2.0</edition>
Expand All @@ -138,6 +139,7 @@
<owner>
<organization>
<name>Open Geospatial Consortium</name>
<abbreviation>OGC</abbreviation>
</organization>
</owner>
</copyright>
Expand Down Expand Up @@ -291,6 +293,7 @@
<role type="publisher"/>
<organization>
<name>Open Geospatial Consortium</name>
<abbreviation>OGC</abbreviation>
</organization>
</contributor>
<edition>2.0</edition>
Expand All @@ -309,6 +312,7 @@
<owner>
<organization>
<name>Open Geospatial Consortium</name>
<abbreviation>OGC</abbreviation>
</organization>
</owner>
</copyright>
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def boilerplate(xmldoc)
<role type="publisher"/>
<organization>
<name>Open Geospatial Consortium</name>
<abbreviation>OGC</abbreviation>
</organization>
</contributor>

Expand All @@ -192,6 +193,7 @@ def boilerplate(xmldoc)
<owner>
<organization>
<name>Open Geospatial Consortium</name>
<abbreviation>OGC</abbreviation>
</organization>
</owner>
</copyright>
Expand Down
Loading