reverse_adoc 2.0.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25f2be20e5e84e1d83ff78423485e7d6d25df90fcb1df1550c45d1cb416bdca4
4
- data.tar.gz: 4c188639d798097fb0dcd95b9af46c9c533db118d64a1ee814e76d51d38852f4
3
+ metadata.gz: f001bed15179069c3cf7f80c084eea563df4f8dacff7288fca4294a73e331ed9
4
+ data.tar.gz: 381680a22721c5df61c7dce5151a2905bca961146f7c2eae5568c3b80c023b98
5
5
  SHA512:
6
- metadata.gz: f0121371a32bb3a2aff6b19c2d37f7d42f1b337fdda426c98f9bd431e563482eeebfb06cb3432aa3333eb4bec67f8eedc3c77762dcd80f9f75756d78d5439d35
7
- data.tar.gz: 0e2d79f8cb7021857d09ff84066d6a2aacd44288feb42524538051fa4e5f15cef6418278271aa716d5da7a227f2a57d050502d8e7d43eddccfe54413a4c1da57
6
+ metadata.gz: 637b51f67c80cb7b0a2b8b36979581553e9072f16bdccffbd92ba1eee85fee939ceb97bbbf88eeba92ec6f5e2c057e89b29dfd4a015a72dd88eb0332e94f3c0d
7
+ data.tar.gz: 11b0d2b61a70491a5e9ba921a84e13f781220c97a6302fcd2e7e559156ae90da3518ff7457e4852a7ddc07196cc3623d21e193fc813189ce68fa8b2713b0a8aa
@@ -0,0 +1,28 @@
1
+ # Formerly cimas-managed. Now consumer-owned per metanorma/cimas#68
2
+ # (workflow-file conversion from cimas-synced copied stubs to reusable-workflow
3
+ # references). Pins metanorma/ci reusable at @v1 (moving major, three-tier
4
+ # tagging discipline per metanorma/ci#372).
5
+ #
6
+ # cascade is false: reverse_adoc is a facade gem whose releases are dispatched
7
+ # manually (gh workflow run release.yml -f next_version=x.y.z). The default
8
+ # cascade fires do-release on every green push to main, which on a facade gem
9
+ # only re-builds the already-published version and lands a red duplicate-push
10
+ # run on main.
11
+ name: rake
12
+
13
+ on:
14
+ push:
15
+ branches: [ master, main ]
16
+ tags: [ v* ]
17
+ pull_request:
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ rake:
24
+ uses: metanorma/ci/.github/workflows/generic-rake.yml@v1
25
+ with:
26
+ cascade: false
27
+ secrets:
28
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -13,6 +13,21 @@ on:
13
13
  default: 'skip'
14
14
  repository_dispatch:
15
15
  types: [ do-release ]
16
+ # The publish leg: when the release PR (head branch `release/v*`) merges,
17
+ # the reusable tags the merge commit and publishes (ci#515). Ordinary PR
18
+ # closes are skipped inside the reusable — no noise on regular merges.
19
+ pull_request:
20
+ types:
21
+ - closed
22
+
23
+ # Least-privilege ceiling for the called rubygems-release.yml: its release job
24
+ # needs contents:write (git tag push), id-token:write (OIDC Trusted Publishing),
25
+ # and pull-requests:write (the release-PR leg opens and auto-merges the release
26
+ # PR — ci#515; reusable workflows are capped by the caller's permissions).
27
+ permissions:
28
+ contents: write
29
+ id-token: write
30
+ pull-requests: write
16
31
 
17
32
  jobs:
18
33
  release:
@@ -20,6 +35,8 @@ jobs:
20
35
  with:
21
36
  next_version: ${{ github.event.inputs.next_version }}
22
37
  secrets:
23
- rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
38
+ # Trusted Publishing (OIDC) is the only publish path: the org
39
+ # METANORMA_CI_RUBYGEMS_API_KEY secret was deleted (metanorma/ci#373),
40
+ # and rubygems-release.yml falls through to the OIDC/TP flow when the
41
+ # rubygems-api-key secret is absent (metanorma/ci#416).
24
42
  pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
25
-
data/Gemfile CHANGED
@@ -3,4 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
+
6
7
  gem "rake"
8
+ gem "rspec"
data/README.adoc CHANGED
@@ -1,6 +1,37 @@
1
- # AsciiDoc from HTML and Microsoft Word: reverse_adoc
1
+ = AsciiDoc from HTML: reverse_adoc
2
2
 
3
- This repository has been merged into Coradoc. See:
3
+ reverse_adoc is a compatibility facade over the ceradoc monorepo (the gem
4
+ formerly known as coradoc, renamed coradoc → coridoc → ceradoc in
5
+ November 2026): since 2.0.0 it ships no converter code of its own. The
6
+ HTML-to-AsciiDoc engine lives in https://github.com/ceradoc/ceradoc as
7
+ `ceradoc-html`, driven by the unified https://rubygems.org/gems/ceradoc[`ceradoc`]
8
+ API.
4
9
 
5
- * https://github.com/metanorma/coradoc/
6
- * https://github.com/metanorma/coradoc/tree/main/lib/coradoc/reverse_adoc
10
+ `require "reverse_adoc"` loads that engine, and `ReverseAdoc.convert`
11
+ delegates to it, so existing callers keep working:
12
+
13
+ [source,ruby]
14
+ ----
15
+ require 'reverse_adoc'
16
+
17
+ ReverseAdoc.convert("<b>hello</b>")
18
+ ----
19
+
20
+ New code should call ceradoc directly:
21
+
22
+ [source,ruby]
23
+ ----
24
+ require 'ceradoc'
25
+ require 'ceradoc/html'
26
+ require 'ceradoc/asciidoc'
27
+
28
+ Ceradoc.convert("<b>hello</b>", from: :html, to: :asciidoc)
29
+ ----
30
+
31
+ The legacy `ReverseAdoc.convert(input, options)` options hash is accepted
32
+ for arity compatibility and ignored; the conversion tuning moved into the
33
+ ceradoc pipeline.
34
+
35
+ == License
36
+
37
+ Copyright Ribose.
data/Rakefile CHANGED
@@ -1,3 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ReverseAdoc
4
+ VERSION = "2.0.1"
5
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ceradoc"
4
+ require "ceradoc/html"
5
+ require "ceradoc/asciidoc"
6
+
7
+ # Compatibility entry point of the reverse_adoc gem.
8
+ #
9
+ # Since 2.0.0 reverse_adoc ships no converter code of its own: the
10
+ # HTML-to-AsciiDoc engine moved into coradoc and now lives in the ceradoc
11
+ # monorepo as ceradoc-html (coradoc → coridoc → ceradoc, 2026-11-25).
12
+ # Requiring "reverse_adoc" loads that engine and delegates to its unified
13
+ # API, so downstream `require "reverse_adoc"` calls keep working.
14
+ module ReverseAdoc
15
+ # Convert HTML to AsciiDoc.
16
+ #
17
+ # Legacy options are accepted for arity compatibility and ignored: the
18
+ # tuning knobs moved into the ceradoc pipeline (see Ceradoc.convert).
19
+ def self.convert(input, *_options)
20
+ Ceradoc.convert(input, from: :html, to: :asciidoc)
21
+ end
22
+ end
data/reverse_adoc.gemspec CHANGED
@@ -1,14 +1,17 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
+ require_relative "lib/reverse_adoc/version"
4
+
3
5
  Gem::Specification.new do |s|
4
6
  s.name = "reverse_adoc"
5
- s.version = "2.0.0"
7
+ s.version = ReverseAdoc::VERSION
6
8
  s.authors = ["Ribose Inc."]
7
9
  s.email = ["open.source@ribose.com"]
8
10
 
9
11
  s.homepage = "http://github.com/metanorma/reverse_adoc"
10
- s.summary = "Generate AsciiDoc from HTML and Microsoft Word via CLI or library."
11
- s.description = "Generate AsciiDoc from HTML and Microsoft Word via CLI or library."
12
+ s.summary = "Compatibility facade for ceradoc: generate AsciiDoc from HTML."
13
+ s.description = "Compatibility facade for ceradoc: generate AsciiDoc from HTML. " \
14
+ "The former reverse_adoc converter lives in the ceradoc monorepo."
12
15
  s.license = "BSD-2-Clause"
13
16
 
14
17
  s.files = `git ls-files`.split("\n")
@@ -18,7 +21,14 @@ Gem::Specification.new do |s|
18
21
  end
19
22
  s.bindir = "exe"
20
23
  s.require_paths = ["lib"]
21
- s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
24
+ # >= 3.3.0 is the floor every ceradoc gem carries (ceradoc hub,
25
+ # ceradoc-adoc, ceradoc-html); the facade cannot resolve below it.
26
+ s.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
22
27
 
23
- s.add_dependency "coradoc", ">= 0.3"
28
+ # reverse_adoc is a facade: the HTML-to-AsciiDoc engine lives in the
29
+ # ceradoc monorepo (renamed coradoc → coridoc → ceradoc, 2026-11-25).
30
+ # The hub floors follow the metanorma-plugin-lutaml html2adoc precedent.
31
+ s.add_dependency "ceradoc", "~> 3.0"
32
+ s.add_dependency "ceradoc-adoc", "~> 2.0"
33
+ s.add_dependency "ceradoc-html", "~> 1.1"
24
34
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "reverse_adoc"
4
+
5
+ RSpec.describe ReverseAdoc do
6
+ # Inline formatting (<b>/<i>) is currently dropped by ceradoc-html's
7
+ # html→asciidoc path (1.1.25 registers :b on monorepo main only), so
8
+ # these specs assert the surface that converts today: blocks, links,
9
+ # and plain text.
10
+ it "converts headings" do
11
+ expect(described_class.convert("<h1>Hello</h1>")).to include("= Hello")
12
+ end
13
+
14
+ it "converts paragraph text" do
15
+ expect(described_class.convert("<p>plain paragraph text</p>"))
16
+ .to include("plain paragraph text")
17
+ end
18
+
19
+ it "converts links" do
20
+ expect(described_class.convert("<p>a <a href=\"http://x.example\">link</a></p>"))
21
+ .to include("http://x.example[link]")
22
+ end
23
+
24
+ it "accepts and ignores a legacy options hash for arity compatibility" do
25
+ expect(described_class.convert("<h1>Hello</h1>", unknown_tags: :raise))
26
+ .to eq(described_class.convert("<h1>Hello</h1>"))
27
+ end
28
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.expect_with :rspec do |expectations|
5
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
6
+ end
7
+
8
+ config.disable_monkey_patching!
9
+ config.order = :random
10
+ end
metadata CHANGED
@@ -1,46 +1,80 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reverse_adoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-21 00:00:00.000000000 Z
11
+ date: 2026-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: coradoc
14
+ name: ceradoc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '3.0'
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.3'
27
- description: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ceradoc-adoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ceradoc-html
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.1'
55
+ description: 'Compatibility facade for ceradoc: generate AsciiDoc from HTML. The former
56
+ reverse_adoc converter lives in the ceradoc monorepo.'
28
57
  email:
29
58
  - open.source@ribose.com
30
59
  executables: []
31
60
  extensions: []
32
61
  extra_rdoc_files: []
33
62
  files:
63
+ - ".github/workflows/rake.yml"
34
64
  - ".github/workflows/release.yml"
35
65
  - Gemfile
36
66
  - README.adoc
37
67
  - Rakefile
68
+ - lib/reverse_adoc.rb
69
+ - lib/reverse_adoc/version.rb
38
70
  - reverse_adoc.gemspec
71
+ - spec/reverse_adoc_spec.rb
72
+ - spec/spec_helper.rb
39
73
  homepage: http://github.com/metanorma/reverse_adoc
40
74
  licenses:
41
75
  - BSD-2-Clause
42
76
  metadata: {}
43
- post_install_message:
77
+ post_install_message:
44
78
  rdoc_options: []
45
79
  require_paths:
46
80
  - lib
@@ -48,15 +82,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
48
82
  requirements:
49
83
  - - ">="
50
84
  - !ruby/object:Gem::Version
51
- version: 2.7.0
85
+ version: 3.3.0
52
86
  required_rubygems_version: !ruby/object:Gem::Requirement
53
87
  requirements:
54
88
  - - ">="
55
89
  - !ruby/object:Gem::Version
56
90
  version: '0'
57
91
  requirements: []
58
- rubygems_version: 3.3.27
59
- signing_key:
92
+ rubygems_version: 3.5.22
93
+ signing_key:
60
94
  specification_version: 4
61
- summary: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.
95
+ summary: 'Compatibility facade for ceradoc: generate AsciiDoc from HTML.'
62
96
  test_files: []