Skip to content

Commit 9107290

Browse files
authored
Merge pull request #146 from kianmeng/fix-typos
Fix typos
2 parents c9e47fd + ff97d81 commit 9107290

12 files changed

+22
-22
lines changed

lib/gepub/book.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def ordered(&block)
176176
@package.ordered(&block)
177177
end
178178

179-
# clenup and maintain consistency of metadata and items included in the Book
179+
# cleanup and maintain consistency of metadata and items included in the Book
180180
# object.
181181
def cleanup
182182
cleanup_for_epub2
@@ -249,7 +249,7 @@ def container_xml
249249
end
250250

251251

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

407407
def self.check_consistency_of_package(package, package_path)
408408
if package.nil?
409-
raise 'this container do not cotains publication information file'
409+
raise 'this container do not contains publication information file'
410410
end
411411

412412
if package_path != package.path
413-
warn "inconsistend EPUB file: container says opf is #{package_path}, but actually #{package.path}"
413+
warn "inconsistent EPUB file: container says opf is #{package_path}, but actually #{package.path}"
414414
end
415415
end
416416
private_class_method :check_consistency_of_package

lib/gepub/builder.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module GEPUB
55
#
66
# * 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.
77
#
8-
# = Synopsys
8+
# = Synopsis
99
# # -*- coding: utf-8 -*-
1010
# # GEPUB::Builder example.
1111
# require 'ruby gem'
@@ -63,7 +63,7 @@ module GEPUB
6363
# glob 'img/*.jpg' # means files(Dir.glob('img/*.jpg'))
6464
#
6565
# # Reads from file. will be placed at path indicated by key.
66-
# files('img/image.jpg' => 'imgage.jpg')
66+
# files('img/image.jpg' => 'image.jpg')
6767
#
6868
# # Read from IO object.
6969
# files('img/image.png' => supplied_io, 'img/image2.png' => supplied_io2)

lib/gepub/builder_mixin.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def method_missing(name, *args, &block)
88
if !(@last_defined_item[0].apply_one_to_multi ||
99
@last_defined_item.size != 1) &&
1010
@last_defined_item.size != args.size
11-
warn "appling #{args} to #{@last_defined_item}: length differs."
11+
warn "applying #{args} to #{@last_defined_item}: length differs."
1212
end
1313

1414
@last_defined_item.each_with_index {

lib/gepub/metadata.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def add_identifier(string, id=nil, type=nil)
166166

167167
def add_date(date, deprecated_id = nil, id: nil)
168168
if deprecated_id
169-
warn "secound argument is deprecated. use id: keyword argument"
169+
warn "second argument is deprecated. use id: keyword argument"
170170
id = deprecated_id
171171
end
172172
add_metadata('date', date, id: id, itemclass: DateMeta)

lib/gepub/metadata_add.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Metadata
2121
get_first_node(node)
2222
else
2323
if deprecated_id
24-
warn "secound argument is deprecated. use id: keyword argument"
24+
warn "second argument is deprecated. use id: keyword argument"
2525
id = deprecated_id
2626
end
2727
send(node + "_clear")

lib/gepub/package.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def version(val=UNASSIGNED)
216216
end
217217

218218
def set_version(val)
219-
warn 'set_version is obsolete: use verion instead.'
219+
warn 'set_version is obsolete: use version instead.'
220220
@attributes['version'] = val
221221
@metadata.opf_version = val
222222
@manifest.opf_version = val

spec/book_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
end
3636
end
3737
end
38-
describe 'identifer=' do
38+
describe 'identifier=' do
3939
context 'set identifier' do
4040
it 'will set unique-identifier and related attributes' do
4141
GEPUB::Book.new do |book|

spec/builder_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
expect(xml.root['prefix']).to eq 'rendition: http://www.idpf.org/vocab/rendition/#'
391391
end
392392

393-
it 'whould handle ibooks version' do
393+
it 'would handle ibooks version' do
394394
workdir = File.join(File.dirname(__FILE__),'fixtures', 'builder')
395395
builder = GEPUB::Builder.new {
396396
ibooks_version '1.1.1'

spec/example_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
epubcheck(epub_file)
7070
end
7171

72-
it 'should generate simple EPUB3 with rather complicated matadata' do
72+
it 'should generate simple EPUB3 with rather complicated metadata' do
7373
book = GEPUB::Book.new
7474
book.primary_identifier('http:/example.jp/bookid_in_url', 'BookID', 'URL')
7575
book.language = 'ja'

spec/gepub_deprectad_api_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'nokogiri'
44

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

5454
item2 = @book.add_ordered_item('text/barbar.xhtml',
55-
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>'),
55+
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>'),
5656
'c2')
5757
item2.toc_text 'test chapter'
5858

@@ -182,7 +182,7 @@
182182
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>'))
183183
@book.spine.push(item1)
184184
item2 = @book.add_ordered_item('text/barbar.xhtml',
185-
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>'),
185+
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>'),
186186
'c2')
187187
item2.toc_text 'test chapter'
188188
@book.generate_epub(epub_file)
@@ -209,7 +209,7 @@
209209
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>'))
210210
@book.spine.push(item1)
211211
item2 = @book.add_ordered_item('text/barbar.xhtml',
212-
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>'),
212+
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>'),
213213
'c2')
214214
@book.generate_epub(epub_file)
215215
epubcheck(epub_file)

spec/gepub_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'nokogiri'
44

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

5454
item2 = @book.add_ordered_item('text/barbar.xhtml',
55-
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>'),
55+
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>'),
5656
id: 'c2',
5757
toc_text: 'test chapter')
5858

@@ -178,7 +178,7 @@
178178
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>'))
179179
@book.spine.push(item1)
180180
item2 = @book.add_ordered_item('text/barbar.xhtml',
181-
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>'),
181+
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>'),
182182
id: 'c2')
183183
item2.toc_text 'test chapter'
184184
@book.generate_epub(epub_file)
@@ -206,7 +206,7 @@
206206
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>'))
207207
@book.spine.push(item1)
208208
item2 = @book.add_ordered_item('text/barbar.xhtml',
209-
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>'),
209+
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>'),
210210
id: 'c2')
211211
@book.generate_epub(epub_file)
212212
epubcheck(epub_file)

tools/generate_function.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Metadata
7272
get_first_node(node)
7373
else
7474
if deprecated_id
75-
warn "secound argument is deprecated. use id: keyword argument"
75+
warn "second argument is deprecated. use id: keyword argument"
7676
id = deprecated_id
7777
end
7878
send(node + "_clear")

0 commit comments

Comments
 (0)