gepub 0.6.8.6 → 0.6.8.7

Sign up to get free protection for your applications and to get access to all the features.
data/gepub.gemspec CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_development_dependency "rspec", "~> 2.11"
22
- s.add_runtime_dependency "nokogiri", "~> 1.5.0"
22
+ s.add_runtime_dependency "nokogiri", "~> 1.5.6"
23
23
  s.add_runtime_dependency "rubyzip", "~> 0.9.7"
24
24
  end
data/lib/gepub/book.rb CHANGED
@@ -91,7 +91,7 @@ module GEPUB
91
91
  def self.rootfile_from_container(rootfile)
92
92
  doc = Nokogiri::XML::Document.parse(rootfile)
93
93
  ns = doc.root.namespaces
94
- defaultns = ns.select{ |name, value| value == CONTAINER_NS }.keys[0]
94
+ defaultns = ns.select{ |name, value| value == CONTAINER_NS }.to_a[0][0]
95
95
  doc.css("#{defaultns}|rootfiles > #{defaultns}|rootfile")[0]['full-path']
96
96
  end
97
97
 
data/lib/gepub/builder.rb CHANGED
@@ -245,7 +245,7 @@ module GEPUB
245
245
  end
246
246
 
247
247
  def unique_identifier(val, id = 'BookID', scheme = 'nil')
248
- @last_defined_item = MetaItem.new(@book.set_main_id(val, id, scheme))
248
+ @last_defined_item = MetaItem.new(@book.set_primary_identifier(val, id, scheme))
249
249
  end
250
250
 
251
251
  def alts(alt_vals = {})
@@ -74,8 +74,8 @@ module GEPUB
74
74
  end
75
75
 
76
76
  def unregister_item(item)
77
- @items[item.id] = nil
78
- @items_by_href[item.href] = nil
77
+ @items.delete(item.id)
78
+ @items_by_href.delete(item.href)
79
79
  @id_pool[item.id] = nil
80
80
  end
81
81
 
data/lib/gepub/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module GEPUB
2
2
  # GEPUB gem version
3
- VERSION = "0.6.8.6"
3
+ VERSION = "0.6.8.7"
4
4
  end
data/spec/package_spec.rb CHANGED
@@ -71,14 +71,14 @@ describe GEPUB::Package do
71
71
  xml.root.namespaces.size.should == 1
72
72
  xml.root.namespaces['xmlns'].should == GEPUB::XMLUtil::OPF_NS
73
73
  xml.root['version'].should == '3.0'
74
- xml.root['lang'].should == 'ja'
74
+ xml.root['xml:lang'].should == 'ja'
75
75
  # TODO: should check all elements
76
76
  end
77
77
 
78
78
  it 'should generate package with prefix attribute' do
79
79
  package = GEPUB::Package.new('OEBPS/package.opf') do
80
80
  |package|
81
- package.set_main_id('http://example.jp', 'BookID', 'url')
81
+ package.set_primary_identifier('http://example.jp', 'BookID', 'url')
82
82
  package['xml:lang'] = 'ja'
83
83
  package.enable_rendition
84
84
  end
@@ -102,7 +102,7 @@ describe GEPUB::Package do
102
102
  it 'should generate opf2.0' do
103
103
  opf = GEPUB::Package.new('OEBPS/package.opf', { 'version' => '2.0'}) {
104
104
  |opf|
105
- opf.set_main_id('http://example.jp', 'BookID', 'url')
105
+ opf.set_primary_identifier('http://example.jp', 'BookID', 'url')
106
106
  opf['xml:lang'] = 'ja'
107
107
 
108
108
  # metadata add: style 1
@@ -133,7 +133,7 @@ describe GEPUB::Package do
133
133
  xml.root.namespaces.size.should == 1
134
134
  xml.root.namespaces['xmlns'].should == GEPUB::XMLUtil::OPF_NS
135
135
  xml.root['version'].should == '2.0'
136
- xml.root['lang'].should == 'ja'
136
+ xml.root['xml:lang'].should == 'ja'
137
137
  end
138
138
  end
139
139
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gepub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8.6
4
+ version: 0.6.8.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-22 00:00:00.000000000 Z
12
+ date: 2013-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 1.5.0
37
+ version: 1.5.6
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 1.5.0
45
+ version: 1.5.6
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rubyzip
48
48
  requirement: !ruby/object:Gem::Requirement