mn-requirements 0.5.11 → 0.5.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bec40fff7706ba8af4ebbc7e39c0a9110cd5ffc96730cace20586ae6beeb93c2
4
- data.tar.gz: 7c3d55500016be83b0cbb85e2f85dfcbc416208a3d2a48ec8fa527ecd54f4607
3
+ metadata.gz: 9574557770c7270c92d1b0fd472a1ab5678bc31952402a12d6a7c1ec0de06833
4
+ data.tar.gz: be81a6da8c6acb7cd8f7d0ad0c62e56b4ccaf25f09fbed311d6d4a8e0536e554
5
5
  SHA512:
6
- metadata.gz: 307c6f011e3b445bdb3cd2a3340286d4012dde7da55bad0473ec15924cc47dbac6661a330e06d4946344e03c9cc40571a59419566fde258aecd0f23f2656ad76
7
- data.tar.gz: 6dadbc51c3ca8304eb295d14175b805709310bf13b7fdf4ddfafa4febac2dd54f3271d4b6eb735b28dc00896c03021d4cd0b6fdee074ad7cde0de071f2a48518
6
+ metadata.gz: c86a5f706ba90a0370c0da823c199db19973f5a2014b23c7dd134c60eee40ee33d97823a8a3b70cabe8970e235e9532271bc6cb462f654e911449ed58ccd67cd
7
+ data.tar.gz: ac5234f0e6e48b2502bbf041729db20c84144d30145e4edff57fd4365903fae59632300629ff925656a34e6ab5c6da671131dbda989a33f0d714eb8abb8a242d
data/.rubocop.yml CHANGED
@@ -1,10 +1,31 @@
1
1
  # Auto-generated by Cimas: Do not edit it manually!
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
4
- - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
5
+ # .rubocop_todo.yml MUST be the last entry. inherit_from is last-wins:
6
+ # if listed before oss-guides, the shared config's stricter Metrics/
7
+ # (MethodLength, BlockLength, etc.) rules override the todo's per-file
8
+ # grandfathering, and the todo becomes inert on those cops. Empirically
9
+ # verified on suma 2026-07-06: with todo listed first, 34 Metrics/* offenses
10
+ # remained; moved last, cleared. Every gem in the metanorma-org fleet
11
+ # already ships a `.rubocop_todo.yml` on its live tree (audited 2026-07-06,
12
+ # 54/54 have it), so this reference is safe to emit unconditionally.
13
+ - .rubocop_todo.yml
14
+
15
+ # Rubocop plugins enabled centrally so every metanorma-org gem picks them up
16
+ # on cimas sync — best practice belongs at the shared-template layer, not
17
+ # per-repo. Per ronaldtse feedback on metanorma/ci#332.
18
+ plugins:
19
+ - rubocop-rspec
20
+ - rubocop-performance
21
+ - rubocop-rake
5
22
 
6
23
  # local repo-specific modifications
7
24
  # ...
8
25
 
9
26
  AllCops:
10
- TargetRubyVersion: 2.5
27
+ # 3.3 matches the org-wide minimum being pushed via #274 (Raise minimum
28
+ # Ruby version to 3.3 due to EOL of 3.2 on 2026-03-31). Was 3.4 before
29
+ # this commit — 3.4 was above the org's stated minimum and would have
30
+ # applied Rubocop rules that fail-close on gems still targeting 3.3.
31
+ TargetRubyVersion: 3.3
@@ -72,6 +72,26 @@ module Metanorma
72
72
  requirement_metadata1(reqt, dl, reqt.at("./title"))
73
73
  end
74
74
 
75
+ # The provisions model fixes the metadata head order
76
+ # (title?, identifier?, subject*, inherit*, classification*), but the
77
+ # elements are emitted in authored order, so a requirement authoring its
78
+ # subject after its classifications is invalid. Reorder the metadata head
79
+ # into the canonical sequence, preserving relative order within each type.
80
+ # https://github.com/metanorma/metanorma-standoc/issues/1239
81
+ REQT_METADATA_HEAD = %w(title identifier subject inherit
82
+ classification).freeze
83
+
84
+ def requirement_metadata_reorder(reqt)
85
+ ordered = REQT_METADATA_HEAD.flat_map { |n| reqt.xpath("./#{n}").to_a }
86
+ ordered.size < 2 and return
87
+ ordered.reverse_each do |e|
88
+ e.unlink
89
+ if reqt.children.empty? then reqt.add_child(e)
90
+ else reqt.children.first.previous = e
91
+ end
92
+ end
93
+ end
94
+
75
95
  def requirement_metadata1_attrs
76
96
  %w(obligation model type class render)
77
97
  end
@@ -1,4 +1,3 @@
1
- require "isodoc"
2
1
 
3
2
  module Metanorma
4
3
  class Requirements
@@ -79,6 +79,13 @@ module Metanorma
79
79
  requirement_inherit_cleanup(xmldoc)
80
80
  requirement_descriptions_cleanup(xmldoc)
81
81
  requirement_identifier_cleanup(xmldoc)
82
+ requirement_metadata_reorder(xmldoc)
83
+ end
84
+
85
+ def requirement_metadata_reorder(xmldoc)
86
+ xmldoc.xpath(REQRECPER).each do |r|
87
+ model(r["model"]).requirement_metadata_reorder(r)
88
+ end
82
89
  end
83
90
 
84
91
  def requirement_type_cleanup(xmldoc)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  class Requirements
3
- VERSION = "0.5.11".freeze
3
+ VERSION = "0.5.13".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mn-requirements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-05-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: isodoc-i18n
@@ -271,7 +270,6 @@ executables: []
271
270
  extensions: []
272
271
  extra_rdoc_files: []
273
272
  files:
274
- - ".hound.yml"
275
273
  - ".rubocop.yml"
276
274
  - CODE_OF_CONDUCT.md
277
275
  - Gemfile
@@ -307,7 +305,6 @@ homepage: https://github.com/metanorma/mn-requirements
307
305
  licenses:
308
306
  - BSD-2-Clause
309
307
  metadata: {}
310
- post_install_message:
311
308
  rdoc_options: []
312
309
  require_paths:
313
310
  - lib
@@ -322,8 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
319
  - !ruby/object:Gem::Version
323
320
  version: '0'
324
321
  requirements: []
325
- rubygems_version: 3.5.22
326
- signing_key:
322
+ rubygems_version: 4.0.16
327
323
  specification_version: 4
328
324
  summary: Requirements processing and rendering according to different models
329
325
  test_files: []
data/.hound.yml DELETED
@@ -1,5 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- ruby:
4
- enabled: true
5
- config_file: .rubocop.yml