revix 0.1.0 → 0.1.1
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 +4 -4
- data/.github/workflows/rake.yml +15 -0
- data/.github/workflows/release.yml +25 -0
- data/Gemfile +6 -3
- data/README.adoc +1 -4
- data/lib/revix/version.rb +1 -1
- data/revix.gemspec +1 -3
- data/spec/models/amendment_spec.rb +31 -31
- metadata +6 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d0a8293b2686382f59383783773595a58a349aa873f04b1675fbd12dfe870e2
|
4
|
+
data.tar.gz: 5bdb1502dd733b2f41f1db39b0ffedd2107a49abe4ca22e8e553fb88584d5056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef9d3bb45f6985989d8ab350f3a306fd41e883e63932358c2acc29d84cf2dd2bfe307117af181de56c2246ecc079e42fcc306c7d48b8405c4ab3a591a31056d9
|
7
|
+
data.tar.gz: b599d5c348f8165a6af741bbcdc05279702dc1e039fa8458db167904bce445ae92f3da114a93ee9edbd8da8e4c1f1fadb679eb6d0f45e95ac44668f3678ec523
|
@@ -0,0 +1,15 @@
|
|
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: metanorma/ci/.github/workflows/generic-rake.yml@main
|
14
|
+
secrets:
|
15
|
+
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
@@ -0,0 +1,25 @@
|
|
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
|
+
jobs:
|
18
|
+
release:
|
19
|
+
uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
|
20
|
+
with:
|
21
|
+
next_version: ${{ github.event.inputs.next_version }}
|
22
|
+
secrets:
|
23
|
+
rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
|
24
|
+
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
25
|
+
|
data/Gemfile
CHANGED
@@ -5,6 +5,9 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in revix.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem "
|
9
|
-
gem "
|
10
|
-
gem "
|
8
|
+
gem "nokogiri"
|
9
|
+
gem "rake"
|
10
|
+
gem "rspec"
|
11
|
+
gem "rubocop"
|
12
|
+
gem "xml-c14n"
|
13
|
+
gem "lutaml-model", github: "lutaml/lutaml-model"
|
data/README.adoc
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
= Revix: revision history models
|
2
2
|
|
3
3
|
image:https://img.shields.io/gem/v/revix.svg["Gem Version", link="https://rubygems.org/gems/revix"]
|
4
|
-
image:https://github.com/metanorma/revix/workflows/
|
5
|
-
image:https://github.com/metanorma/revix/workflows/macos/badge.svg["OSX Build Status", link="https://github.com/metanorma/revix/actions?query=workflow%3Amacos"]
|
6
|
-
image:https://github.com/metanorma/revix/workflows/windows/badge.svg["Windows Build Status", link="https://github.com/metanorma/revix/actions?query=workflow%3Awindows"]
|
7
|
-
image:https://codeclimate.com/github/metanorma/revix/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/revix"]
|
4
|
+
image:https://github.com/metanorma/revix/actions/workflows/rake.yml/badge.svg["Windows Build Status", link="https://github.com/metanorma/revix/actions/workflows/rake.yml"]
|
8
5
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/revix.svg["Pull Requests", link="https://github.com/metanorma/revix/pulls"]
|
9
6
|
image:https://img.shields.io/github/commits-since/metanorma/revix/latest.svg["Commits since latest",link="https://github.com/metanorma/revix/releases"]
|
10
7
|
|
data/lib/revix/version.rb
CHANGED
data/revix.gemspec
CHANGED
@@ -29,7 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_dependency "lutaml-model", "~> 0.
|
33
|
-
spec.add_dependency "nokogiri"
|
34
|
-
spec.add_dependency "xml-c14n"
|
32
|
+
spec.add_dependency "lutaml-model", "~> 0.7"
|
35
33
|
end
|
@@ -1,78 +1,78 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require 'spec_helper'
|
4
4
|
|
5
5
|
RSpec.describe Revix::Amendment do
|
6
6
|
let(:simple_amendment_data) do
|
7
|
-
Revix::Amendment.new(description:
|
7
|
+
Revix::Amendment.new(description: 'Approved edition of S-102')
|
8
8
|
end
|
9
9
|
|
10
10
|
let(:complex_amendment_data) do
|
11
11
|
locations = [
|
12
|
-
Revix::Location.new(type:
|
13
|
-
Revix::Location.new(type:
|
14
|
-
Revix::Location.new(type:
|
15
|
-
Revix::Location.new(type:
|
12
|
+
Revix::Location.new(type: 'clause', value: '4.0'),
|
13
|
+
Revix::Location.new(type: 'clause', value: '12.0'),
|
14
|
+
Revix::Location.new(type: 'clause', value: '9.0'),
|
15
|
+
Revix::Location.new(type: 'whole', value: nil)
|
16
16
|
]
|
17
17
|
|
18
18
|
classifications = [
|
19
|
-
Revix::Classification.new(tag:
|
20
|
-
Revix::Classification.new(tag:
|
19
|
+
Revix::Classification.new(tag: 'severity', value: 'major'),
|
20
|
+
Revix::Classification.new(tag: 'type', value: 'editorial')
|
21
21
|
]
|
22
22
|
|
23
23
|
Revix::Amendment.new(
|
24
24
|
description: "Updated clause 4.0 and 12.0.\n\nPopulated clause 9.0.",
|
25
25
|
location: locations,
|
26
26
|
classification: classifications,
|
27
|
-
change:
|
27
|
+
change: 'modify'
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
31
|
-
describe
|
32
|
-
it
|
31
|
+
describe '.new' do
|
32
|
+
it 'creates a simple Amendment object' do
|
33
33
|
amendment = simple_amendment_data
|
34
34
|
expect(amendment).to be_a(Revix::Amendment)
|
35
|
-
expect(amendment.description).to eq(
|
36
|
-
expect(amendment.location).to
|
37
|
-
expect(amendment.classification).to
|
38
|
-
expect(amendment.change).to eq(
|
35
|
+
expect(amendment.description).to eq('Approved edition of S-102')
|
36
|
+
expect(amendment.location).to be_nil
|
37
|
+
expect(amendment.classification).to be_nil
|
38
|
+
expect(amendment.change).to eq('modify') # Default value
|
39
39
|
end
|
40
40
|
|
41
|
-
it
|
41
|
+
it 'creates a complex Amendment object' do
|
42
42
|
amendment = complex_amendment_data
|
43
43
|
expect(amendment).to be_a(Revix::Amendment)
|
44
44
|
expect(amendment.description).to eq("Updated clause 4.0 and 12.0.\n\nPopulated clause 9.0.")
|
45
45
|
expect(amendment.location.size).to eq(4)
|
46
|
-
expect(amendment.location.first.type).to eq(
|
47
|
-
expect(amendment.location.first.value).to eq(
|
48
|
-
expect(amendment.location.last.type).to eq(
|
46
|
+
expect(amendment.location.first.type).to eq('clause')
|
47
|
+
expect(amendment.location.first.value).to eq('4.0')
|
48
|
+
expect(amendment.location.last.type).to eq('whole')
|
49
49
|
expect(amendment.location.last.value).to be_nil
|
50
50
|
expect(amendment.classification.size).to eq(2)
|
51
|
-
expect(amendment.classification.first.tag).to eq(
|
52
|
-
expect(amendment.classification.first.value).to eq(
|
53
|
-
expect(amendment.change).to eq(
|
51
|
+
expect(amendment.classification.first.tag).to eq('severity')
|
52
|
+
expect(amendment.classification.first.value).to eq('major')
|
53
|
+
expect(amendment.change).to eq('modify')
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
describe
|
58
|
-
it
|
57
|
+
describe '#to_xml' do
|
58
|
+
it 'converts a complex Amendment object to XML' do
|
59
59
|
amendment = complex_amendment_data
|
60
60
|
xml = amendment.to_xml
|
61
61
|
expect(xml).to be_a(String)
|
62
|
-
expect(xml).to include(
|
62
|
+
expect(xml).to include('<amend>')
|
63
63
|
expect(xml).to include("<description>Updated clause 4.0 and 12.0.\n\nPopulated clause 9.0.</description>")
|
64
64
|
expect(xml).to include('<location type="clause">4.0</location>')
|
65
65
|
expect(xml).to include('<location type="clause">12.0</location>')
|
66
66
|
expect(xml).to include('<location type="clause">9.0</location>')
|
67
67
|
expect(xml).to include('<location type="whole"></location>')
|
68
|
-
expect(xml).to include(
|
69
|
-
expect(xml).to include(
|
70
|
-
expect(xml).to include(
|
71
|
-
expect(xml).to include(
|
72
|
-
expect(xml).to include(
|
68
|
+
expect(xml).to include('<tag>severity</tag>')
|
69
|
+
expect(xml).to include('<value>major</value>')
|
70
|
+
expect(xml).to include('<tag>type</tag>')
|
71
|
+
expect(xml).to include('<value>editorial</value>')
|
72
|
+
expect(xml).to include('<change>modify</change>')
|
73
73
|
end
|
74
74
|
|
75
|
-
it
|
75
|
+
it 'performs round-trip conversion from XML to object and back' do
|
76
76
|
original = complex_amendment_data
|
77
77
|
xml1 = original.to_xml
|
78
78
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: revix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-model
|
@@ -16,42 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: nokogiri
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: xml-c14n
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
26
|
+
version: '0.7'
|
55
27
|
description:
|
56
28
|
email:
|
57
29
|
- open.source@ribose.com
|
@@ -59,6 +31,8 @@ executables: []
|
|
59
31
|
extensions: []
|
60
32
|
extra_rdoc_files: []
|
61
33
|
files:
|
34
|
+
- ".github/workflows/rake.yml"
|
35
|
+
- ".github/workflows/release.yml"
|
62
36
|
- ".gitignore"
|
63
37
|
- Gemfile
|
64
38
|
- LICENSE
|