relaton-plateau 1.19.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b586efb3d3b6188375642c4114578d2f04a60333442fbf0e5340ba6a68b1edee
4
+ data.tar.gz: 30d4e809336062273b5969cac328ee5fe28eec96c287991d2f27422666cc1291
5
+ SHA512:
6
+ metadata.gz: d65e27275dca1182ba55a3df9477d8d894e5e206ab83c59d66e83fad18b3eede7785bdb530af29c4b071a01b1d70061cccee78f3a5b2837a84e79e481992c1de
7
+ data.tar.gz: 4e7bca8756f84e820a1ebca666a8e950e901428f33ca6dfa66fb1140f2f07dba2858023e89dc38394cf5014e21fb8b4cafa4e11cede06f0661e67b37a8a47226
@@ -0,0 +1,13 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ uses: relaton/support/.github/workflows/rake.yml@main
@@ -0,0 +1,24 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release
4
+
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ next_version:
9
+ description: |
10
+ Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
11
+ Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
12
+ required: true
13
+ default: 'skip'
14
+ repository_dispatch:
15
+ types: [ do-release ]
16
+
17
+
18
+ jobs:
19
+ release:
20
+ uses: relaton/support/.github/workflows/release.yml@main
21
+ with:
22
+ next_version: ${{ github.event.inputs.next_version }}
23
+ secrets:
24
+ rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /.idea/
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
13
+ Gemfile.lock
14
+ .vscode/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
1
+ # This project follows the Ribose OSS style guide.
2
+ # https://github.com/riboseinc/oss-guides
3
+ # All project-specific additions and overrides should be specified in this file.
4
+
5
+ require: rubocop-rails
6
+
7
+ inherit_from:
8
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
+ AllCops:
10
+ TargetRubyVersion: 3.0
11
+ Rails:
12
+ Enabled: false
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in relaton-plateau.gemspec
6
+ gemspec
7
+
8
+ gem "equivalent-xml", "~> 0.6"
9
+ gem "rake", "~> 13.0"
10
+ gem "rspec", "~> 3.0"
11
+ gem "rubocop", "~> 1.21"
12
+ gem "simplecov", "~> 0.22"
13
+ gem "vcr", "~> 6.0"
14
+ gem "webmock", "~> 3.0"
data/README.adoc ADDED
@@ -0,0 +1,227 @@
1
+ = RelatonPlateau: retrieve Project PLATEAU Standards for bibliographic use using the BibliographicItem model
2
+
3
+ image:https://img.shields.io/gem/v/relaton-plateau.svg["Gem Version", link="https://rubygems.org/gems/relaton-plateau"]
4
+ image:https://github.com/relaton/relaton-plateau/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-plateau/actions?workflow=macos"]
5
+ image:https://github.com/relaton/relaton-plateau/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-plateau/actions?workflow=windows"]
6
+ image:https://github.com/relaton/relaton-plateau/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-plateau/actions?workflow=ubuntu"]
7
+ image:https://codeclimate.com/github/relaton/relaton-plateau/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-plateau"]
8
+ image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-plateau.svg["Pull Requests", link="https://github.com/relaton/relaton-plateau/pulls"]
9
+ image:https://img.shields.io/github/commits-since/relaton/relaton/latest.svg["Commits since latest",link="https://github.com/relaton/relaton/releases"]
10
+
11
+ RelatonPlateau is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-plateau#iso-bibliographic-item[IsoBibliographicItem model].
12
+
13
+ You can use it to retrieve metadata of ISO Standards from https://www.iso.org, and access such metadata through the `IsoBibliographicItem` object.
14
+
15
+ == Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ [source,ruby]
20
+ ----
21
+ gem 'relaton-plateau'
22
+ ----
23
+
24
+ And then execute:
25
+
26
+ $ bundle
27
+
28
+ Or install it yourself as:
29
+
30
+ $ gem install relaton-plateau
31
+
32
+ == Usage
33
+
34
+ === Fetching
35
+
36
+ [source,ruby]
37
+ ----
38
+ require "relaton/plateau"
39
+
40
+ bib = Relaton::Plateau::Bibliography.get("PLATEAU Handbook #00 第1.0版")
41
+ [relaton-plateau] INFO: (PLATEAU Handbook #00 第1.0版) Fetching ...
42
+ [relaton-plateau] INFO: (PLATEAU Handbook #00 第1.0版) Found `PLATEAU Handbook #00 第1.0版`
43
+ => #<Relaton::Plateau::BibItem:0x0000000104afbcc0
44
+ ...
45
+ ----
46
+
47
+ === Serializing
48
+
49
+ ==== XML
50
+
51
+ [source,ruby]
52
+ ----
53
+ # Render bibitem
54
+ puts bib.to_xml
55
+ <bibitem id="PLATEAUHandbook#00第1.0版" type="standard" schema-version="v1.2.9">
56
+ <title type="main" format="text/plain" language="ja" script="Jpan">3D都市モデルの導入ガイダンス</title>
57
+ <title type="main" format="text/plain" language="en" script="Latn">Guidance on the Installation for 3D City Model</title>
58
+ <uri type="pdf">https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_doc_0000_ver01.pdf</uri>
59
+ <docidentifier type="PLATEAU" primary="true">PLATEAU Handbook #00 第1.0版</docidentifier>
60
+ <date type="published">
61
+ <on>2021-03-26</on>
62
+ </date>
63
+ <edition number="1.0">第1.0版</edition>
64
+ <abstract format="text/plain" language="ja" script="Jpan">地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス</abstract>
65
+ </bibitem>
66
+
67
+ # Render bibdata
68
+ puts bib.to_xml(bibdata: true)
69
+ <bibdata type="standard" schema-version="v1.2.9">
70
+ <title type="main" format="text/plain" language="ja" script="Jpan">3D都市モデルの導入ガイダンス</title>
71
+ <title type="main" format="text/plain" language="en" script="Latn">Guidance on the Installation for 3D City Model</title>
72
+ <uri type="pdf">https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_doc_0000_ver01.pdf</uri>
73
+ <docidentifier type="PLATEAU" primary="true">PLATEAU Handbook #00 第1.0版</docidentifier>
74
+ <date type="published">
75
+ <on>2021-03-26</on>
76
+ </date>
77
+ <edition number="1.0">第1.0版</edition>
78
+ <abstract format="text/plain" language="ja" script="Jpan">地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス</abstract>
79
+ <ext>
80
+ <doctype>handbook</doctype>
81
+ <structuredidentifier type="Handbook">
82
+ <agency>PLATEAU</agency>
83
+ <docnumber>00</docnumber>
84
+ <edition>第1.0版</edition>
85
+ </structuredidentifier>
86
+ <cover>
87
+ <image src="https://www.mlit.go.jp//plateau/uploads/2022/06/1@2x.jpg" mimetype="image/jpeg"/>
88
+ </cover>
89
+ <filesize>18381880</filesize>
90
+ </ext>
91
+ </bibdata>
92
+ ----
93
+
94
+ ==== YAML
95
+ [source,ruby]
96
+ ----
97
+ puts bib.to_hash.to_yaml
98
+ ---
99
+ schema-version: v1.2.9
100
+ id: PLATEAUHandbook#00第1.0版
101
+ title:
102
+ - content: 3D都市モデルの導入ガイダンス
103
+ language:
104
+ - ja
105
+ script:
106
+ - Jpan
107
+ format: text/plain
108
+ type: main
109
+ - content: Guidance on the Installation for 3D City Model
110
+ language:
111
+ - en
112
+ script:
113
+ - Latn
114
+ format: text/plain
115
+ type: main
116
+ link:
117
+ - content: https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_doc_0000_ver01.pdf
118
+ type: pdf
119
+ type: standard
120
+ docid:
121
+ - id: 'PLATEAU Handbook #00 第1.0版'
122
+ type: PLATEAU
123
+ primary: true
124
+ date:
125
+ - type: published
126
+ value: '2021-03-26'
127
+ edition:
128
+ content: 第1.0版
129
+ number: '1.0'
130
+ revdate: '2021-03-26'
131
+ abstract:
132
+ - content: 地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス
133
+ language:
134
+ - ja
135
+ script:
136
+ - Jpan
137
+ format: text/plain
138
+ doctype:
139
+ type: handbook
140
+ structuredidentifier:
141
+ - docnumber: '00'
142
+ type: Handbook
143
+ agency:
144
+ - PLATEAU
145
+ edition: 第1.0版
146
+ ext:
147
+ cover:
148
+ image:
149
+ src: https://www.mlit.go.jp//plateau/uploads/2022/06/1@2x.jpg
150
+ mimetype: image/jpeg
151
+ filesize: 18381880
152
+ ----
153
+
154
+ ==== BibXML
155
+
156
+ [source,ruby]
157
+ ----
158
+ puts bib.to_bibxml
159
+ <reference anchor="PLATEAU.Handbook.#00.第1.0版">
160
+ <front>
161
+ <title>3D都市モデルの導入ガイダンス</title>
162
+ <date year="2021" month="March" day="26"/>
163
+ <abstract>地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス</abstract>
164
+ </front>
165
+ </reference>
166
+ ----
167
+
168
+ ==== AsciiBib
169
+
170
+ [source,ruby]
171
+ ----
172
+ puts bib.to_asciibib
173
+ [%bibitem]
174
+ == {blank}
175
+ id:: PLATEAUHandbook#00第1.0版
176
+ title::
177
+ title.type:: main
178
+ title.content:: 3D都市モデルの導入ガイダンス
179
+ title.language:: ja
180
+ title.script:: Jpan
181
+ title.format:: text/plain
182
+ title::
183
+ title.type:: main
184
+ title.content:: Guidance on the Installation for 3D City Model
185
+ title.language:: en
186
+ title.script:: Latn
187
+ title.format:: text/plain
188
+ type:: standard
189
+ docid.type:: PLATEAU
190
+ docid.primary:: true
191
+ docid.id:: PLATEAU Handbook #00 第1.0版
192
+ edition.content:: 第1.0版
193
+ edition.number:: 1.0
194
+ date.type:: published
195
+ date.on:: 2021-03-26
196
+ abstract.content:: 地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス
197
+ abstract.language:: ja
198
+ abstract.script:: Jpan
199
+ abstract.format:: text/plain
200
+ link.type:: pdf
201
+ link.content:: https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_doc_0000_ver01.pdf
202
+ doctype.type:: handbook
203
+ structured_identifier.docnumber:: 00
204
+ structured_identifier.agency:: PLATEAU
205
+ structured_identifier.type:: Handbook
206
+ structured_identifier.edition:: 第1.0版
207
+ cover.image.src:: https://www.mlit.go.jp//plateau/uploads/2022/06/1@2x.jpg
208
+ cover.image.mimetype:: image/jpeg
209
+ filesize:: 18381880
210
+ ----
211
+
212
+ === Fetching data
213
+
214
+ Two datasets are available for fetching: `platau-handbooks` and `plateau-technical-reports`. The data is stored in the `data` directory. The format can be `xml`, 'yaml', or `bibxml`.
215
+
216
+ [source,ruby]
217
+ ----
218
+ Relaton::Plateau::Fetcher.fetch("plateau-handbooks", output: "dir", format: "xml")
219
+ ----
220
+
221
+ == Contributing
222
+
223
+ Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/relaton-plateau
224
+
225
+ == License
226
+
227
+ The gem is available as open source under the terms of the https://opensource.org/licenses/MIT[MIT license].
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec]
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "relaton/plateau"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here