Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metanorma/metanorma-docker#55 make plantuml aware of imagesdir #204

Merged
merged 3 commits into from
Feb 8, 2020

Conversation

CAMOBAP
Copy link
Contributor

@CAMOBAP CAMOBAP commented Feb 7, 2020

@CAMOBAP CAMOBAP self-assigned this Feb 7, 2020
@@ -305,7 +305,7 @@
end

it "processes the PlantUML macro with imagesdir" do
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{spec/assets/[^.]+\.}, "spec/assets/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{spec/assets/[^./]+\.}, "spec/assets/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [192/80]
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -254,7 +254,7 @@
end

it "processes the PlantUML macro" do
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{plantuml/plantuml[^.]+\.}, "plantuml/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{plantuml/plantuml[^./]+\.}, "plantuml/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [192/80]
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.


FileUtils.mv outfile, path

imagesdir ?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/MultilineTernaryOperator: Avoid multi-line ternary operators, use if or unless instead.

File.exist?(path) or return

# TODO: this should raise failure if the destination path is not writable!
File.writable?(path) or return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/AndOr: Use || instead of or.

# TODO: this should raise failure if the destination path already exists!
File.exist?(path) or return

# TODO: this should raise failure if the destination path is not writable!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [82/80]

path.mkpath

# TODO: this should raise failure if the destination path already exists!
File.exist?(path) or return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/AndOr: Use || instead of or.

path = Pathname.new(localdir) + (imagesdir || "plantuml")
path.mkpath

# TODO: this should raise failure if the destination path already exists!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [81/80]

umlfile.unlink
File.join(path,File.basename(outfile))

path = Pathname.new(localdir) + (imagesdir || "plantuml")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Copy link
Contributor

@ronaldtse ronaldtse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CAMOBAP795 !

@ronaldtse ronaldtse merged commit b76cf68 into master Feb 8, 2020
@ronaldtse ronaldtse deleted the bugfix/respect-imagesdir-for-plantuml branch February 8, 2020 03:08
ronaldtse added a commit that referenced this pull request Feb 8, 2020
…will crash. Remediation of changes in #204 (original bug #187)
ronaldtse added a commit that referenced this pull request Feb 8, 2020
…will crash. Remediation of changes in #204 (original bug #187)
ronaldtse added a commit that referenced this pull request Feb 10, 2020
* master:
  Update GH workflows
  version bump
  PlantUML macro should copy instead of move output, otherwise Windows will crash. Remediation of changes in #204 (original bug #187)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants