-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update Nokogiri to v1.15 & doctype model
- Loading branch information
1 parent
a0f08fa
commit 9f6c032
Showing
24 changed files
with
52,901 additions
and
52,383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module RelatonIetf | ||
class DocumentType < RelatonBib::DocumentType | ||
DOCTYPES = %w[rfc internet-draft].freeze | ||
|
||
def initialize(type:, abbreviation: nil) | ||
check_type type | ||
super | ||
end | ||
|
||
def check_type(type) | ||
unless DOCTYPES.include? type | ||
Util.warn "WARNING: Invalid doctype: `#{type}`" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
module RelatonIetf | ||
class HashConverter < RelatonBib::HashConverter | ||
class << self | ||
def hash_to_bib(hash) | ||
ret = super | ||
return unless ret | ||
module HashConverter | ||
include RelatonBib::HashConverter | ||
extend self | ||
def hash_to_bib(hash) | ||
ret = super | ||
return unless ret | ||
|
||
stream_hash_to_bib ret | ||
ret | ||
end | ||
stream_hash_to_bib ret | ||
ret | ||
end | ||
|
||
# | ||
# Ovverides superclass's method | ||
# | ||
# @param item [Hash] | ||
# @retirn [RelatonIetf::IetfBibliographicItem] | ||
def bib_item(item) | ||
IetfBibliographicItem.new(**item) | ||
end | ||
# | ||
# Ovverides superclass's method | ||
# | ||
# @param item [Hash] | ||
# @retirn [RelatonIetf::IetfBibliographicItem] | ||
def bib_item(item) | ||
IetfBibliographicItem.new(**item) | ||
end | ||
|
||
# @param ret [Hash] | ||
def editorialgroup_hash_to_bib(ret) | ||
return unless ret[:editorialgroup] | ||
# @param ret [Hash] | ||
def editorialgroup_hash_to_bib(ret) | ||
return unless ret[:editorialgroup] | ||
|
||
technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg| | ||
Committee.new RelatonBib::WorkGroup.new(**wg) | ||
end | ||
ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee | ||
technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg| | ||
Committee.new RelatonBib::WorkGroup.new(**wg) | ||
end | ||
ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee | ||
end | ||
|
||
def stream_hash_to_bib(ret) | ||
ret[:stream] = ret[:ext][:stream] if ret[:ext]&.key? :stream | ||
end | ||
def stream_hash_to_bib(ret) | ||
ret[:stream] = ret[:ext][:stream] if ret[:ext]&.key? :stream | ||
end | ||
|
||
def create_doctype(**args) | ||
DocumentType.new(**args) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module RelatonIetf | ||
VERSION = "1.16.2".freeze | ||
VERSION = "1.17.0".freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
describe RelatonIetf::DocumentType do | ||
it "warn if doctype is invalid" do | ||
expect do | ||
described_class.new type: "type" | ||
end.to output(/\[relaton-ietf\] WARNING: Invalid doctype: `type`/).to_stderr_from_any_process | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.