relaton-omg 0.1.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 +7 -0
- data/.github/workflows/macos.yml +32 -0
- data/.github/workflows/ubuntu.yml +32 -0
- data/.github/workflows/windows.yml +35 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +21 -0
- data/README.adoc +113 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/rspec +29 -0
- data/bin/setup +8 -0
- data/grammars/biblio.rng +1142 -0
- data/lib/relaton_omg/hash_converter.rb +6 -0
- data/lib/relaton_omg/omg_bibliographic_item.rb +55 -0
- data/lib/relaton_omg/omg_bibliography.rb +22 -0
- data/lib/relaton_omg/processor.rb +40 -0
- data/lib/relaton_omg/scrapper.rb +124 -0
- data/lib/relaton_omg/version.rb +3 -0
- data/lib/relaton_omg/xml_parser.rb +25 -0
- data/lib/relaton_omg.rb +19 -0
- data/relaton_omg.gemspec +41 -0
- metadata +224 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7ec9aa37836c535145b32481875dcebf43e2de883f5aaaecc5a913f2a93392b3
|
4
|
+
data.tar.gz: ee62a50c3785c3476f0d0d6eaa29fc2549559d6f8854f1177a3a5532b58a6b04
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9e913fadbc4a8fe6fd6054cdbaffdd12ca3792e19feb770628adba3f3ddd3d4eb3df1fad6bd6a863747fe52309d37188f64b448ae2c40775636e35b53c1b4f51
|
7
|
+
data.tar.gz: f79cbd26320757ad389e00648b635646c7f35a4d95f9b8ffbdead5c64fc16598338c2b22b8fa1cde9579233abdf1aaf3e4e0238dd6a11f3ff9fbb0dabe7e9143
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: macos
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master ]
|
8
|
+
pull_request:
|
9
|
+
branches: [ '**' ]
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test-macos:
|
13
|
+
name: Test on Ruby ${{ matrix.ruby }} macOS
|
14
|
+
runs-on: macos-latest
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@master
|
21
|
+
- name: Use Ruby
|
22
|
+
uses: actions/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
architecture: 'x64'
|
26
|
+
- name: Update gems
|
27
|
+
run: |
|
28
|
+
sudo gem install bundler --force
|
29
|
+
bundle install --jobs 4 --retry 3
|
30
|
+
- name: Run specs
|
31
|
+
run: |
|
32
|
+
bundle exec rake
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: ubuntu
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master ]
|
8
|
+
pull_request:
|
9
|
+
branches: [ '**' ]
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test-linux:
|
13
|
+
name: Test on Ruby ${{ matrix.ruby }} Ubuntu
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@master
|
21
|
+
- name: Use Ruby
|
22
|
+
uses: actions/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
architecture: 'x64'
|
26
|
+
- name: Update gems
|
27
|
+
run: |
|
28
|
+
gem install bundler
|
29
|
+
bundle install --jobs 4 --retry 3
|
30
|
+
- name: Run specs
|
31
|
+
run: |
|
32
|
+
bundle exec rake
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: windows
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master ]
|
8
|
+
pull_request:
|
9
|
+
branches: [ '**' ]
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test-windows:
|
13
|
+
name: Test on Ruby ${{ matrix.ruby }} Windows
|
14
|
+
runs-on: windows-latest
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@master
|
21
|
+
- name: Use Ruby
|
22
|
+
uses: actions/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
architecture: 'x64'
|
26
|
+
- name: Update gems
|
27
|
+
shell: pwsh
|
28
|
+
run: |
|
29
|
+
gem install bundler
|
30
|
+
bundle config --local path vendor/bundle
|
31
|
+
bundle update
|
32
|
+
bundle install --jobs 4 --retry 3
|
33
|
+
- name: Run specs
|
34
|
+
run: |
|
35
|
+
bundle exec rake
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,10 @@
|
|
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
|
+
inherit_from:
|
6
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.3
|
9
|
+
Rails:
|
10
|
+
Enabled: true
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Andrei Kislichenko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.adoc
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
= RelatonOmg
|
2
|
+
|
3
|
+
image:https://img.shields.io/gem/v/relaton-omg.svg["Gem Version", link="https://rubygems.org/gems/relaton-omg"]
|
4
|
+
image:https://github.com/relaton/relaton-omg/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-omg/actions?workflow=macos"]
|
5
|
+
image:https://github.com/relaton/relaton-omg/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-omg/actions?workflow=windows"]
|
6
|
+
image:https://github.com/relaton/relaton-omg/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-omg/actions?workflow=ubuntu"]
|
7
|
+
image:https://codeclimate.com/github/relaton/relaton-omg/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-omg"]
|
8
|
+
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-omg.svg["Pull Requests", link="https://github.com/relaton/relaton-omg/pulls"]
|
9
|
+
image:https://img.shields.io/github/commits-since/relaton/relaton-omg/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-omg/releases"]
|
10
|
+
|
11
|
+
RelatonOmg is a Ruby gem that search and fetch standards from https://www.omg.org[The Object Management Group (OMG)].
|
12
|
+
|
13
|
+
The standards scrape form https://www.omg.org/spec
|
14
|
+
|
15
|
+
== Installation
|
16
|
+
|
17
|
+
Add this line to your application's Gemfile:
|
18
|
+
|
19
|
+
[source,ruby]
|
20
|
+
----
|
21
|
+
gem 'relaton-omg'
|
22
|
+
----
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle install
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install relaton-omg
|
31
|
+
|
32
|
+
== Usage
|
33
|
+
|
34
|
+
=== Search document
|
35
|
+
|
36
|
+
[source,ruby]
|
37
|
+
----
|
38
|
+
require 'relaton_omg'
|
39
|
+
|
40
|
+
item = RelatonOmg::OmgBibliography.search 'OMG AMI4CCM 1.0'
|
41
|
+
=> #<RelatonOmg::OmgBibliographicItem:0x007fda17eab2f0
|
42
|
+
...
|
43
|
+
|
44
|
+
# Return nil if document doesn't exist.
|
45
|
+
RelatonOmg::OmgBibliography.search 'OMG 1111'
|
46
|
+
[relaton-omg] no document found for "OMG 1111" reference.
|
47
|
+
=> nil
|
48
|
+
----
|
49
|
+
|
50
|
+
=== Serialization
|
51
|
+
|
52
|
+
[source,ruby]
|
53
|
+
----
|
54
|
+
item.to_xml
|
55
|
+
=><bibitem id="AMI4CCM1.0">
|
56
|
+
<fetched>2020-02-17</fetched>
|
57
|
+
<title type="main" format="text/plain" language="en" script="Latn">Asynchronous Method Invocation for CCM</title>
|
58
|
+
<uri type="src">https://www.omg.org/spec/AMI4CCM/1.0/</uri>
|
59
|
+
<uri type="pdf">https://www.omg.org/spec/AMI4CCM/1.0/PDF</uri>
|
60
|
+
<docidentifier type="OMG">AMI4CCM 1.0</docidentifier>
|
61
|
+
<date type="published">
|
62
|
+
<on>2013-03</on>
|
63
|
+
</date>
|
64
|
+
<version>
|
65
|
+
<revision-date>2013-03-01</revision-date>
|
66
|
+
<draft>1.0</draft>
|
67
|
+
</version>
|
68
|
+
<abstract format="text/plain" language="en" script="Latn">This specification defines a mechanism to perform asynchronous method invocation for CCM (AMI4CCM).</abstract>
|
69
|
+
<status>
|
70
|
+
<stage>formal</stage>
|
71
|
+
</status>
|
72
|
+
<license>RF-Limited</license>
|
73
|
+
<keyword>Corba Platform</keyword>
|
74
|
+
<keyword>Component Architecture</keyword>
|
75
|
+
</bibitem>"
|
76
|
+
----
|
77
|
+
|
78
|
+
=== Create bibliographic item form XML
|
79
|
+
|
80
|
+
[source,ruby]
|
81
|
+
----
|
82
|
+
item = RelatonOmg::OmgBibliographicItem.from_xml 'spec/fixtures/omg_ami4ccm_1_0.xml'
|
83
|
+
=> #<RelatonOmg::OmgBibliographicItem:0x007fb351582e90
|
84
|
+
...
|
85
|
+
----
|
86
|
+
|
87
|
+
=== Create bibliographic item form Hash
|
88
|
+
[source,ruby]
|
89
|
+
----
|
90
|
+
hash = RelatonOmg::OmgBibliographicItem.from_xml 'spec/fixtures/omg_ami4ccm_1_0.xml'
|
91
|
+
=> {"id"=>"AMI4CCM1.0",
|
92
|
+
...
|
93
|
+
|
94
|
+
item = RelatonOmg::OmgBibliographicItem.from_hash hash
|
95
|
+
=> #<RelatonOmg::OmgBibliographicItem:0x007f85b0247ec0
|
96
|
+
...
|
97
|
+
----
|
98
|
+
|
99
|
+
=== Create bibliographic item form YAML
|
100
|
+
[source,ruby]
|
101
|
+
----
|
102
|
+
item = RelatonOmg::OmgBibliographicItem.from_yaml 'spec/fixtures/omg_ami4ccm_1_0.yaml'
|
103
|
+
=> #<RelatonOmg::OmgBibliographicItem:0x007f85a00f45d8
|
104
|
+
...
|
105
|
+
----
|
106
|
+
|
107
|
+
== Contributing
|
108
|
+
|
109
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/relaton-ietf.
|
110
|
+
|
111
|
+
== License
|
112
|
+
|
113
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "relaton_omg"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|