metanorma / pubid-iso

Implementation of ISO pubid
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Doubled space #147

Closed andrew2net closed 1 year ago

andrew2net commented 1 year ago

As titled.

> pubid = Pubid::Iso::Identifier.parse_from_title("ISO/IEC 2382:2015 Information technology \u2014 Vocabulary")
#<Pubid::Iso::Identifier:0x00007fc2c03b3de8 @publisher="ISO", @number="2382"@8, @copublisher="IEC"@4, @year=2015>

> pubid.stage = Pubid::Iso::Stage.new(harmonized_code: "90.60")
#<Pubid::Iso::Stage:0x00007fc2c05b6b90 @abbr=nil, @harmonized_code=#<Pubid::Iso::HarmonizedStageCode:0x00007fc2c05b6aa0 @substage="60", @stage="90">>

> pubid.to_s
"ISO/IEC  2382:2015"
ronaldtse commented 1 year ago

Thanks @andrew2net ! Indeed a bug.

ronaldtse commented 1 year ago

This is resolved:

irb(main):004:0> pubid = Pubid::Iso::Identifier.parse_from_title("ISO/IEC 2382:2015 Information technology \u2014 Vocabulary")
=> #<Pubid::Iso::Identifier::InternationalStandard:0x0000000109fd4bc0 @copublisher="IEC", @number="2382"@8, @publisher="ISO", @year=2015>
irb(main):005:0> pubid.stage = Pubid::Iso::Stage.new(harmonized_code: "90.60")
=> #<Pubid::Iso::Stage:0x000000010a496ac8 @abbr=nil, @harmonized_code=#<Pubid::Iso::HarmonizedStageCode:0x000000010a496aa0 @stages=["90.60"]>>
irb(main):006:0> pubid.to_s
=> "ISO/IEC 2382:2015"