-
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
45b005c
commit 2d71db9
Showing
20 changed files
with
3,062 additions
and
2,812 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
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,17 @@ | ||
module RelatonIeee | ||
class DocumentType < RelatonBib::DocumentType | ||
DOCTYPES = %w[guide recommended-practice standard witepaper redline other].freeze | ||
|
||
def initialize(type:, abbreviation: nil) | ||
check_type type | ||
super | ||
end | ||
|
||
def check_type(type) | ||
unless DOCTYPES.include? type | ||
Util.warn "Invalid doctype: `#{type}`. " \ | ||
"It should be one of: `#{DOCTYPES.join('`, `')}`." | ||
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,40 +1,44 @@ | ||
module RelatonIeee | ||
class HashConverter < RelatonBib::HashConverter | ||
class << self | ||
# @param args [Hash] | ||
# @param neated [TrueClas, FalseClass] default true | ||
# @return [Hash] | ||
def hash_to_bib(args) | ||
hash = super | ||
return unless hash.is_a?(Hash) | ||
module HashConverter | ||
include RelatonBib::HashConverter | ||
extend self | ||
# @param args [Hash] | ||
# @param neated [TrueClas, FalseClass] default true | ||
# @return [Hash] | ||
def hash_to_bib(args) | ||
hash = super | ||
return unless hash.is_a?(Hash) | ||
|
||
# editorialgroup_hash_to_bib hash | ||
ext_hash_to_bib hash | ||
hash | ||
end | ||
# editorialgroup_hash_to_bib hash | ||
ext_hash_to_bib hash | ||
hash | ||
end | ||
|
||
# @param item_hash [Hash] | ||
# @return [RelatonIeee::IeeeBibliographicItem] | ||
def bib_item(item_hash) | ||
IeeeBibliographicItem.new(**item_hash) | ||
end | ||
# @param item_hash [Hash] | ||
# @return [RelatonIeee::IeeeBibliographicItem] | ||
def bib_item(item_hash) | ||
IeeeBibliographicItem.new(**item_hash) | ||
end | ||
|
||
# @param hash [Hash] | ||
def editorialgroup_hash_to_bib(hash) | ||
return unless hash[:editorialgroup] | ||
# @param hash [Hash] | ||
def editorialgroup_hash_to_bib(hash) | ||
return unless hash[:editorialgroup] | ||
|
||
hash[:editorialgroup] = EditorialGroup.new(**hash[:editorialgroup]) | ||
end | ||
hash[:editorialgroup] = EditorialGroup.new(**hash[:editorialgroup]) | ||
end | ||
|
||
def ext_hash_to_bib(hash) | ||
ext = hash.delete(:ext) | ||
return unless ext | ||
def ext_hash_to_bib(hash) | ||
ext = hash.delete(:ext) | ||
return unless ext | ||
|
||
attrs = %i[standard_status standard_modified pubstatus holdstatus] | ||
ext.select { |k, _| attrs.include? k }.each do |k, v| | ||
hash[k] = v | ||
end | ||
attrs = %i[standard_status standard_modified pubstatus holdstatus] | ||
ext.select { |k, _| attrs.include? k }.each do |k, v| | ||
hash[k] = v | ||
end | ||
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 RelatonIeee | ||
VERSION = "1.16.3".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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
describe RelatonIeee::DocumentType do | ||
before { RelatonIeee.instance_variable_set :@configuration, nil } | ||
|
||
it "warn when doctype is invalid" do | ||
expect do | ||
described_class.new type: "invalid" | ||
end.to output( | ||
"[relaton-ieee] Invalid doctype: `invalid`. It should be one of: " \ | ||
"`guide`, `recommended-practice`, `standard`, `witepaper`, `redline`, `other`.\n", | ||
).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.