-
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
eabd6cb
commit 91cfaf1
Showing
10 changed files
with
49 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module RelatonJis | ||
class DocumentType < RelatonBib::DocumentType | ||
DOCTYPES = %w[japanese-industrial-standard technical-report technical-specification amendment].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,9 +1,16 @@ | ||
module RelatonJis | ||
class HashConverter < RelatonBib::HashConverter | ||
module HashConverter | ||
include RelatonBib::HashConverter | ||
extend self | ||
|
||
# @param item_hash [Hash] | ||
# @return [Relaton3gpp::BibliographicItem] | ||
def self.bib_item(item_hash) | ||
def bib_item(item_hash) | ||
BibliographicItem.new(**item_hash) | ||
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,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module RelatonJis | ||
VERSION = "1.16.8" | ||
VERSION = "1.17.0" | ||
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
describe RelatonJis::DocumentType do | ||
it "warn if type is not valid" do | ||
expect do | ||
RelatonJis::DocumentType.new type: "invalid" | ||
end.to output(/\[relaton-jis\] WARNING: invalid doctype: `invalid`/).to_stderr | ||
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