Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Found via `typos --hidden --format brief` and `codespell -H`
  • Loading branch information
kianmeng committed Oct 12, 2024
1 parent c9e47fd commit ff97d81
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions lib/gepub/book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def ordered(&block)
@package.ordered(&block)
end

# clenup and maintain consistency of metadata and items included in the Book
# cleanup and maintain consistency of metadata and items included in the Book
# object.
def cleanup
cleanup_for_epub2
Expand Down Expand Up @@ -249,7 +249,7 @@ def container_xml
end


# add tocdata like this : [ {link: chapter1.xhtml, text: 'Capter 1', level: 1} ] .
# add tocdata like this : [ {link: chapter1.xhtml, text: 'Chapter 1', level: 1} ] .
# if item corresponding to the link does not exists, error will be thrown.
def add_tocdata(toc_yaml)
newtoc = []
Expand Down Expand Up @@ -406,11 +406,11 @@ def self.parse_container(zip_file, files)

def self.check_consistency_of_package(package, package_path)
if package.nil?
raise 'this container do not cotains publication information file'
raise 'this container do not contains publication information file'
end

if package_path != package.path
warn "inconsistend EPUB file: container says opf is #{package_path}, but actually #{package.path}"
warn "inconsistent EPUB file: container says opf is #{package_path}, but actually #{package.path}"
end
end
private_class_method :check_consistency_of_package
Expand Down
4 changes: 2 additions & 2 deletions lib/gepub/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module GEPUB
#
# * Builder is obsolete on v0.7 and after. We will continue to support GEPUB::Builder works fine on version 1.x, but Builder will not be updated any more. For example, landmarks are not supported with Builder.
#
# = Synopsys
# = Synopsis
# # -*- coding: utf-8 -*-
# # GEPUB::Builder example.
# require 'ruby gem'
Expand Down Expand Up @@ -63,7 +63,7 @@ module GEPUB
# glob 'img/*.jpg' # means files(Dir.glob('img/*.jpg'))
#
# # Reads from file. will be placed at path indicated by key.
# files('img/image.jpg' => 'imgage.jpg')
# files('img/image.jpg' => 'image.jpg')
#
# # Read from IO object.
# files('img/image.png' => supplied_io, 'img/image2.png' => supplied_io2)
Expand Down
2 changes: 1 addition & 1 deletion lib/gepub/builder_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def method_missing(name, *args, &block)
if !(@last_defined_item[0].apply_one_to_multi ||
@last_defined_item.size != 1) &&
@last_defined_item.size != args.size
warn "appling #{args} to #{@last_defined_item}: length differs."
warn "applying #{args} to #{@last_defined_item}: length differs."
end

@last_defined_item.each_with_index {
Expand Down
2 changes: 1 addition & 1 deletion lib/gepub/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def add_identifier(string, id=nil, type=nil)

def add_date(date, deprecated_id = nil, id: nil)
if deprecated_id
warn "secound argument is deprecated. use id: keyword argument"
warn "second argument is deprecated. use id: keyword argument"
id = deprecated_id
end
add_metadata('date', date, id: id, itemclass: DateMeta)
Expand Down
2 changes: 1 addition & 1 deletion lib/gepub/metadata_add.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Metadata
get_first_node(node)
else
if deprecated_id
warn "secound argument is deprecated. use id: keyword argument"
warn "second argument is deprecated. use id: keyword argument"
id = deprecated_id
end
send(node + "_clear")
Expand Down
2 changes: 1 addition & 1 deletion lib/gepub/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def version(val=UNASSIGNED)
end

def set_version(val)
warn 'set_version is obsolete: use verion instead.'
warn 'set_version is obsolete: use version instead.'
@attributes['version'] = val
@metadata.opf_version = val
@manifest.opf_version = val
Expand Down
2 changes: 1 addition & 1 deletion spec/book_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
end
end
end
describe 'identifer=' do
describe 'identifier=' do
context 'set identifier' do
it 'will set unique-identifier and related attributes' do
GEPUB::Book.new do |book|
Expand Down
2 changes: 1 addition & 1 deletion spec/builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
expect(xml.root['prefix']).to eq 'rendition: http://www.idpf.org/vocab/rendition/#'
end

it 'whould handle ibooks version' do
it 'would handle ibooks version' do
workdir = File.join(File.dirname(__FILE__),'fixtures', 'builder')
builder = GEPUB::Builder.new {
ibooks_version '1.1.1'
Expand Down
2 changes: 1 addition & 1 deletion spec/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
epubcheck(epub_file)
end

it 'should generate simple EPUB3 with rather complicated matadata' do
it 'should generate simple EPUB3 with rather complicated metadata' do
book = GEPUB::Book.new
book.primary_identifier('http:/example.jp/bookid_in_url', 'BookID', 'URL')
book.language = 'ja'
Expand Down
8 changes: 4 additions & 4 deletions spec/gepub_deprectad_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'nokogiri'

describe GEPUB::Item do
it "should return atttributes" do
it "should return attributes" do
item = GEPUB::Item.new('theid', 'foo/bar.bar', 'application/xhtml+xml')
expect(item.itemid).to eq('theid')
expect(item.href).to eq('foo/bar.bar')
Expand Down Expand Up @@ -52,7 +52,7 @@
@book.spine.push(item1)

item2 = @book.add_ordered_item('text/barbar.xhtml',
StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, whith is test chapter.</p></body></html>'),
StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, with is test chapter.</p></body></html>'),
'c2')
item2.toc_text 'test chapter'

Expand Down Expand Up @@ -182,7 +182,7 @@
item1.add_content(StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c1</title></head><body><p>the first page</p></body></html>'))
@book.spine.push(item1)
item2 = @book.add_ordered_item('text/barbar.xhtml',
StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, whith is test chapter.</p></body></html>'),
StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, with is test chapter.</p></body></html>'),
'c2')
item2.toc_text 'test chapter'
@book.generate_epub(epub_file)
Expand All @@ -209,7 +209,7 @@
item1.add_content(StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c1</title></head><body><p>the first page</p></body></html>'))
@book.spine.push(item1)
item2 = @book.add_ordered_item('text/barbar.xhtml',
StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, whith is test chapter.</p></body></html>'),
StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, with is test chapter.</p></body></html>'),
'c2')
@book.generate_epub(epub_file)
epubcheck(epub_file)
Expand Down
8 changes: 4 additions & 4 deletions spec/gepub_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'nokogiri'

describe GEPUB::Item do
it "should return atttributes" do
it "should return attributes" do
item = GEPUB::Item.new('theid', 'foo/bar.bar', 'application/xhtml+xml')
expect(item.itemid).to eq('theid')
expect(item.href).to eq('foo/bar.bar')
Expand Down Expand Up @@ -52,7 +52,7 @@
@book.spine.push(item1)

item2 = @book.add_ordered_item('text/barbar.xhtml',
content: StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, whith is test chapter.</p></body></html>'),
content: StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, with is test chapter.</p></body></html>'),
id: 'c2',
toc_text: 'test chapter')

Expand Down Expand Up @@ -178,7 +178,7 @@
item1.add_content(StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c1</title></head><body><p>the first page</p></body></html>'))
@book.spine.push(item1)
item2 = @book.add_ordered_item('text/barbar.xhtml',
content: StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, whith is test chapter.</p></body></html>'),
content: StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, with is test chapter.</p></body></html>'),
id: 'c2')
item2.toc_text 'test chapter'
@book.generate_epub(epub_file)
Expand Down Expand Up @@ -206,7 +206,7 @@
item1.add_content(StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c1</title></head><body><p>the first page</p></body></html>'))
@book.spine.push(item1)
item2 = @book.add_ordered_item('text/barbar.xhtml',
content: StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, whith is test chapter.</p></body></html>'),
content: StringIO.new('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>c2</title></head><body><p>second page, with is test chapter.</p></body></html>'),
id: 'c2')
@book.generate_epub(epub_file)
epubcheck(epub_file)
Expand Down
2 changes: 1 addition & 1 deletion tools/generate_function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Metadata
get_first_node(node)
else
if deprecated_id
warn "secound argument is deprecated. use id: keyword argument"
warn "second argument is deprecated. use id: keyword argument"
id = deprecated_id
end
send(node + "_clear")
Expand Down

0 comments on commit ff97d81

Please sign in to comment.