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 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
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .rubocop-https---raw-githubusercontent-com-riboseinc-oss-guides-master-ci-rubocop-yml
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,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
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in relaton_omg.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
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
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
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")
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