kramdown-plantuml 1.0.1 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e51da02b82f51bd70b685e9d5286ca34cab9a8b9a3f3621998874638e94adfcc
4
- data.tar.gz: 0ce4c33a2185a964aa36efd4f3112ca8144d2222ce80831aa79f95eb0bfaa848
3
+ metadata.gz: df85b61ecd8a5b15d5288e03f95f70064926f71f144d245dfe693ea36e190d7b
4
+ data.tar.gz: 88de76e1cf968e5365b1af85bc0266b3de41ff58c131583771b7d63b61f93544
5
5
  SHA512:
6
- metadata.gz: 705fb1c0c560dc1fd6b601155e2cbb50f5fd8e49f78e0f28c1a1d1f370cb706684370184db0be718acac8c84a625fd6b404c194471772d74805ce65c927fcdb6
7
- data.tar.gz: a07b250f306da8269ec7a7250245ddbb98093cf05b5c38947f255e91d51ada5f4f2567f65d49ff795aadc44fbf5c38c51654bd69cbe0a369f79d9654428f3622
6
+ metadata.gz: 3f13d2f50b9cfeb43e221654345a2d882eb1c310611f1f7f4f2ebac94214d17aa7d95e1b6bd8133419fdf722a72f1bf87249ac91bc239650f32a371520a42845
7
+ data.tar.gz: 4b3d5fd4af58e295265e7af2577d0ee9993b98258f95f6919ae1f648e5e8a7e5b31b648b94736c027ac338ee59b545717cc72d78d0f5da77669abd311215668e
@@ -49,14 +49,9 @@ jobs:
49
49
  return ref.substring(tagPrefix.length);
50
50
  }
51
51
 
52
- const escapedBranchName = '${{ steps.gitversion.outputs.escapedBranchName }}';
53
- const commitsSinceVersionSource = '${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}';
54
- const preReleaseLabel = escapedBranchName + '.' + commitsSinceVersionSource;
55
- const majorMinorPatch = '${{ steps.gitversion.outputs.majorMinorPatch }}';
56
- return majorMinorPatch + preReleaseLabel;
52
+ return '${{ steps.gitversion.outputs.legacySemVerPadded }}';
57
53
  })();
58
54
 
59
- core.debug('Gem version: ' + gemVersion);
60
55
  core.setOutput('version', gemVersion);
61
56
 
62
57
  - name: Set up Ruby 2.6
@@ -109,7 +104,11 @@ jobs:
109
104
  touch $HOME/.gem/credentials
110
105
  chmod 0600 $HOME/.gem/credentials
111
106
  printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
112
- gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} ${{ steps.gem.outputs.name }}
107
+ set -e
108
+ gem push --KEY github \
109
+ --host https://rubygems.pkg.github.com/${OWNER} \
110
+ ${{ steps.gem.outputs.name }} \
111
+ || echo "push failed ($?) probably due to version '${{ steps.gemversion.outputs.version }}' already existing in GPR."
113
112
 
114
113
  - name: Publish to RubyGems
115
114
  if: startsWith(github.ref, 'refs/tags/') # Only publish tagged commits
@@ -60,7 +60,7 @@ representative at an online or offline event.
60
60
 
61
61
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
62
  reported to the community leaders responsible for enforcement at
63
- [INSERT CONTACT METHOD].
63
+ [opensource@swedbankpay.com][contact].
64
64
  All complaints will be reviewed and investigated promptly and fairly.
65
65
 
66
66
  All community leaders are obligated to respect the privacy and security of the
@@ -115,15 +115,17 @@ the community.
115
115
  ## Attribution
116
116
 
117
117
  This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.0, available at
119
- https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
118
+ version 2.0, available at [contributor-covenant.org][concov20].
120
119
 
121
120
  Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
- enforcement ladder](https://github.com/mozilla/diversity).
121
+ enforcement ladder][mozilla-cocel].
123
122
 
124
- [homepage]: https://www.contributor-covenant.org
125
-
126
- For answers to common questions about this code of conduct, see the FAQ at
127
- https://www.contributor-covenant.org/faq. Translations are available at
128
- https://www.contributor-covenant.org/translations.
123
+ For answers to common questions about this code of conduct, see the [FAQ][faq].
124
+ [Translations are available][translations].
129
125
 
126
+ [concov20]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
127
+ [contact]: mailto:opensource@swedbankpay.com
128
+ [faq]: https://www.contributor-covenant.org/faq
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [mozilla-cocel]: https://github.com/mozilla/diversity
131
+ [translations]: https://www.contributor-covenant.org/translations
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in kramdown-plantuml.gemspec
4
4
  gemspec
5
5
 
6
- gem "rake", "~> 12.0"
6
+ gem "rake", "~> 13.0"
7
7
  gem "kramdown"
8
8
  gem "open3"
9
9
 
data/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # Kramdown::PlantUml
2
2
 
3
- [![Contributor Covenant][coc-badge]][coc]
3
+ [![Gem Version][gem-badge]][gem-url]
4
4
  ![Build][build-badge]
5
5
  ![No Java][no-java-build-badge]
6
6
  ![No PlantUML][no-plantuml-badge]
7
+ [![MIT License][license-badge]][license]
8
+ [![CLA assistant][cla-badge]][cla]
9
+ [![Contributor Covenant][coc-badge]][coc]
7
10
 
8
11
  `kramdown-plantuml` allows you to use [PlantUML][plantuml] syntax within [fenced
9
12
  code blocks][fenced] in [Jekyll] with its default [Kramdown][kramdown] Markdown
@@ -24,7 +27,17 @@ app -> client
24
27
  Using the `plantuml` language identifier in fenced code blocks will allow
25
28
  `kramdown-plantuml` to pick it up and replace it with a rendered [SVG][svg]
26
29
  diagram when the Markdown is rendered to HTML. The above diagram will be
27
- replaced with the following:
30
+ replaced with the following (abbreviated) HTML code:
31
+
32
+ ```html
33
+ <div class="plantuml">
34
+ <svg>
35
+ <!-- Snip converted SVG code -->
36
+ </svg>
37
+ </div>
38
+ ```
39
+
40
+ Which in place will be rendered as the following:
28
41
 
29
42
  ![Rendered SVG Diagram][diagram-svg]
30
43
 
@@ -74,27 +87,34 @@ git commits and tags, and push the `.gem` file to [rubygems.org][gems].
74
87
 
75
88
  Bug reports and pull requests are welcome on [GitHub][github]. This project is
76
89
  intended to be a safe, welcoming space for collaboration, and contributors are
77
- expected to adhere to the [code of conduct][coc].
90
+ expected to adhere to the [code of conduct][coc] and sign the [contributor's
91
+ license agreement][cla].
78
92
 
79
93
  ## License
80
94
 
81
- The gem is available as open source under the terms of the [MIT License][mit].
95
+ The gem is available as open source under the terms of the [MIT
96
+ License][license].
82
97
 
83
98
  ## Code of Conduct
84
99
 
85
- Everyone interacting in the Kramdown::PlantUml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/kramdown-plantuml/blob/master/CODE_OF_CONDUCT.md).
100
+ Everyone interacting in the Kramdown::PlantUml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct][coc].
86
101
 
87
102
  [plantuml]: https://plantuml.com/
88
103
  [jekyll]: https://jekyllrb.com/
89
104
  [kramdown]: https://kramdown.gettalong.org/
90
105
  [gems]: https://rubygems.org
91
106
  [github]: https://github.com/SwedbankPay/kramdown-plantuml/
92
- [coc]: CODE_OF_CONDUCT.md
107
+ [coc]: ./CODE_OF_CONDUCT.md
93
108
  [coc-badge]: https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg
94
- [mit]: https://opensource.org/licenses/MIT
109
+ [cla]: https://cla-assistant.io/SwedbankPay/kramdown-plantuml
110
+ [cla-badge]: https://cla-assistant.io/readme/badge/SwedbankPay/design.swedbankpay.com
111
+ [license]: https://opensource.org/licenses/MIT
112
+ [license-badge]: https://img.shields.io/github/license/SwedbankPay/kramdown-plantuml
95
113
  [fenced]: https://www.markdownguide.org/extended-syntax/#syntax-highlighting
96
114
  [svg]: https://developer.mozilla.org/en-US/docs/Web/SVG
97
115
  [diagram-svg]: spec/diagram.svg
116
+ [gem-badge]: https://badge.fury.io/rb/kramdown-plantuml.svg
117
+ [gem-url]: https://rubygems.org/gems/kramdown-plantuml
98
118
  [build-badge]: https://github.com/SwedbankPay/kramdown-plantuml/workflows/Ruby%20Gem/badge.svg?branch=master
99
119
  [no-java-build-badge]: https://github.com/SwedbankPay/kramdown-plantuml/workflows/No%20Java/badge.svg?branch=master
100
120
  [no-plantuml-badge]: https://github.com/SwedbankPay/kramdown-plantuml/workflows/No%20PlantUML/badge.svg?branch=master
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_development_dependency "rake", "~> 12.3"
31
+ spec.add_development_dependency "rake", "~> 13.0"
32
32
  spec.add_development_dependency "rspec", "~> 3.2"
33
33
  end
@@ -22,13 +22,24 @@ module Kramdown::PlantUml
22
22
  def convert_plantuml_to_svg(content)
23
23
  cmd = "java -jar #{@plant_uml_jar_file} -tsvg -pipe"
24
24
 
25
- stdout, stderr, status = Open3.capture3(cmd, :stdin_data => content)
25
+ stdout, stderr, _ = Open3.capture3(cmd, :stdin_data => content)
26
26
 
27
27
  unless stderr.empty?
28
28
  raise stderr
29
29
  end
30
+
31
+ xml_prologue_start = "<?xml"
32
+ xml_prologue_end = "?>"
30
33
 
31
- return stdout
34
+ start_index = stdout.index(xml_prologue_start)
35
+ end_index = stdout.index(xml_prologue_end, xml_prologue_start.length) + xml_prologue_end.length
36
+
37
+ stdout.slice! start_index, end_index
38
+
39
+ wrapper_element_start = "<div class=\"plantuml\">"
40
+ wrapper_element_end = "</div>"
41
+
42
+ return "#{wrapper_element_start}#{stdout}#{wrapper_element_end}"
32
43
  end
33
44
  end
34
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-plantuml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asbjørn Ulsberg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '12.3'
19
+ version: '13.0'
20
20
  type: :development
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: '12.3'
26
+ version: '13.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement