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

(Hotfix) support for additional symbols, caption, title attributes #91

Merged
merged 1 commit into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/lutaml/uml/parsers/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ def parse(input_file, _options = {})
rule(:title_keyword) { kw_title >> spaces }
rule(:title_text) do
match['"\''].maybe >>
match['a-zA-Z0-9_\- '].repeat(1).as(:title) >>
match['a-zA-Z0-9_\- ,.:;'].repeat(1).as(:title) >>
match['"\''].maybe
end
rule(:title_definition) { title_keyword >> title_text }
rule(:caption_keyword) { kw_caption >> spaces }
rule(:caption_text) do
match['"\''].maybe >>
match['a-zA-Z0-9_\- '].repeat(1).as(:caption) >>
match['a-zA-Z0-9_\- ,.:;'].repeat(1).as(:caption) >>
match['"\''].maybe
end
rule(:caption_definition) { caption_keyword >> caption_text }
Expand Down
3 changes: 2 additions & 1 deletion spec/fixtures/dsl/diagram_attributes.lutaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
diagram MyView {
fontname "Arial"
title "my diagram"
title "my diagram, another symbols: text."
class Foo {}
caption "Block elements of StandardDocument, adapted from BasicDocument. Another - symbol"
}
4 changes: 3 additions & 1 deletion spec/lutaml/uml/parsers/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

it "creates Lutaml::Uml::Document object and sets its attributes" do
expect(parse).to be_instance_of(Lutaml::Uml::Document)
expect(parse.title).to eq("my diagram")
expect(parse.title).to eq("my diagram, another symbols: text.")
expect(parse.caption)
.to(eq("Block elements of StandardDocument, adapted from BasicDocument. Another - symbol"))
Copy link

Choose a reason for hiding this comment

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

Line is too long. [101/80]

expect(parse.fontname).to eq("Arial")
end

Expand Down