epubinfo 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "epubinfo"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Christof Dorner"]
12
- s.date = "2012-04-01"
12
+ s.date = "2012-04-04"
13
13
  s.description = "Currently only supports EPUB 3 specification."
14
14
  s.email = "christof@chdorner.com"
15
15
  s.extra_rdoc_files = [
@@ -34,9 +34,9 @@ Gem::Specification.new do |s|
34
34
  "lib/epubinfo/models/person.rb",
35
35
  "lib/epubinfo/parser.rb",
36
36
  "lib/epubinfo/utils.rb",
37
- "spec/lib/epubinfo/identifier_spec.rb",
38
37
  "spec/lib/epubinfo/models/book_spec.rb",
39
38
  "spec/lib/epubinfo/models/date_spec.rb",
39
+ "spec/lib/epubinfo/models/identifier_spec.rb",
40
40
  "spec/lib/epubinfo/models/person_spec.rb",
41
41
  "spec/lib/epubinfo/parser_spec.rb",
42
42
  "spec/lib/epubinfo_spec.rb",
@@ -13,6 +13,6 @@ module EPUBInfo
13
13
  # @return [EPUBInfo::Models::Book] the model
14
14
  def self.get(path)
15
15
  parser = EPUBInfo::Parser.parse(path)
16
- EPUBInfo::Models::Book.new(parser)
16
+ EPUBInfo::Models::Book.new(parser.metadata_document)
17
17
  end
18
18
  end
@@ -6,6 +6,7 @@ module EPUBInfo
6
6
  :source, :languages, :rights
7
7
 
8
8
  def initialize(document)
9
+ return if document.nil?
9
10
  metadata = document.css('metadata')
10
11
  self.titles = metadata.xpath('.//dc:title', EPUBInfo::Utils::DC_NAMESPACE).map(&:content)
11
12
  self.creators = metadata.xpath('.//dc:creator', EPUBInfo::Utils::DC_NAMESPACE).map {|c| EPUBInfo::Models::Person.new(c) }
@@ -27,6 +28,22 @@ module EPUBInfo
27
28
  def dates; @dates || []; end
28
29
  def identifiers; @identifiers || []; end
29
30
  def languages; @languages || []; end
31
+
32
+ def to_hash
33
+ {
34
+ :titles => @titles,
35
+ :creators => @creators.map(&:to_hash),
36
+ :subjects => @subjects,
37
+ :description => @description,
38
+ :publisher => @publisher,
39
+ :contributors => @contributors.map(&:to_hash),
40
+ :dates => @dates.map(&:to_hash),
41
+ :identifiers => @identifiers.map(&:to_hash),
42
+ :source => @source,
43
+ :languages => @languages,
44
+ :rights => @rights
45
+ }
46
+ end
30
47
  end
31
48
  end
32
49
  end
@@ -1,3 +1,5 @@
1
+ require 'time'
2
+
1
3
  module EPUBInfo
2
4
  module Models
3
5
  class Date
@@ -7,6 +9,13 @@ module EPUBInfo
7
9
  self.time = Time.parse(node.content)
8
10
  self.event = node.attribute('event').content rescue nil
9
11
  end
12
+
13
+ def to_hash
14
+ {
15
+ :time => @time,
16
+ :event => @event
17
+ }
18
+ end
10
19
  end
11
20
  end
12
21
  end
@@ -7,6 +7,13 @@ module EPUBInfo
7
7
  self.identifier = node.content
8
8
  self.scheme = node.attribute('scheme').content rescue nil
9
9
  end
10
+
11
+ def to_hash
12
+ {
13
+ :identifier => @identifier,
14
+ :scheme => @scheme
15
+ }
16
+ end
10
17
  end
11
18
  end
12
19
  end
@@ -8,6 +8,14 @@ module EPUBInfo
8
8
  self.file_as = node.attribute('file-as').content rescue nil
9
9
  self.role = node.attribute('role').content rescue nil
10
10
  end
11
+
12
+ def to_hash
13
+ {
14
+ :name => @name,
15
+ :file_as => @file_as,
16
+ :role => @role
17
+ }
18
+ end
11
19
  end
12
20
  end
13
21
  end
@@ -1,109 +1,111 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe EPUBInfo::Models::Book do
4
- context 'EPUB2' do
5
- subject { EPUBInfo::Models::Book.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf'))) }
6
-
7
- its(:titles) { should == ['Metamorphosis'] }
8
- its(:subjects) { should == ['Psychological fiction', 'Metamorphosis -- Fiction'] }
9
- its(:description) { should == 'Classic story of self-discovery, told in a unique manner by Kafka.' }
10
- its(:publisher) { should == 'Random House' }
11
- its(:source) { should == 'http://www.gutenberg.org/files/5200/5200-h/5200-h.htm' }
12
- its(:languages) { should == ['en'] }
13
- its(:rights) { should == 'Copyrighted. Read the copyright notice inside this book for details.' }
14
-
15
- context 'creators' do
16
- it 'count should be 1' do
17
- subject.creators.count.should == 1
18
- end
4
+ describe '#initialize' do
5
+ context 'EPUB2' do
6
+ subject { EPUBInfo::Models::Book.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf'))) }
7
+
8
+ its(:titles) { should == ['Metamorphosis'] }
9
+ its(:subjects) { should == ['Psychological fiction', 'Metamorphosis -- Fiction'] }
10
+ its(:description) { should == 'Classic story of self-discovery, told in a unique manner by Kafka.' }
11
+ its(:publisher) { should == 'Random House' }
12
+ its(:source) { should == 'http://www.gutenberg.org/files/5200/5200-h/5200-h.htm' }
13
+ its(:languages) { should == ['en'] }
14
+ its(:rights) { should == 'Copyrighted. Read the copyright notice inside this book for details.' }
15
+
16
+ context 'creators' do
17
+ it 'count should be 1' do
18
+ subject.creators.count.should == 1
19
+ end
19
20
 
20
- it 'values should be of type Person' do
21
- subject.creators.each do |creator|
22
- creator.should be_kind_of EPUBInfo::Models::Person
21
+ it 'values should be of type Person' do
22
+ subject.creators.each do |creator|
23
+ creator.should be_kind_of EPUBInfo::Models::Person
24
+ end
23
25
  end
24
26
  end
25
- end
26
27
 
27
- context 'contributors' do
28
- it 'count should be 1' do
29
- subject.contributors.count.should == 1
30
- end
28
+ context 'contributors' do
29
+ it 'count should be 1' do
30
+ subject.contributors.count.should == 1
31
+ end
31
32
 
32
- it 'values should be of type Person' do
33
- subject.contributors.each do |contributor|
34
- contributor.should be_kind_of EPUBInfo::Models::Person
33
+ it 'values should be of type Person' do
34
+ subject.contributors.each do |contributor|
35
+ contributor.should be_kind_of EPUBInfo::Models::Person
36
+ end
35
37
  end
36
38
  end
37
- end
38
39
 
39
- context 'dates' do
40
- it 'count should be 1' do
41
- subject.dates.count.should == 2
42
- end
40
+ context 'dates' do
41
+ it 'count should be 1' do
42
+ subject.dates.count.should == 2
43
+ end
43
44
 
44
- it 'values should be of type Date' do
45
- subject.dates.each do |date|
46
- date.should be_kind_of EPUBInfo::Models::Date
45
+ it 'values should be of type Date' do
46
+ subject.dates.each do |date|
47
+ date.should be_kind_of EPUBInfo::Models::Date
48
+ end
47
49
  end
48
50
  end
49
- end
50
51
 
51
- context 'identifiers' do
52
- it 'count should be 1' do
53
- subject.identifiers.count.should == 1
54
- end
52
+ context 'identifiers' do
53
+ it 'count should be 1' do
54
+ subject.identifiers.count.should == 1
55
+ end
55
56
 
56
- it 'values should be of type Identifier' do
57
- subject.identifiers.each do |identifier|
58
- identifier.should be_kind_of EPUBInfo::Models::Identifier
57
+ it 'values should be of type Identifier' do
58
+ subject.identifiers.each do |identifier|
59
+ identifier.should be_kind_of EPUBInfo::Models::Identifier
60
+ end
59
61
  end
60
62
  end
61
63
  end
62
- end
63
64
 
64
- context 'EPUB3' do
65
- subject { EPUBInfo::Models::Book.new(Nokogiri::XML(File.new('spec/support/xml/wasteland_metadata_epub3.opf'))) }
65
+ context 'EPUB3' do
66
+ subject { EPUBInfo::Models::Book.new(Nokogiri::XML(File.new('spec/support/xml/wasteland_metadata_epub3.opf'))) }
66
67
 
67
- its(:titles) { should == ['The Waste Land'] }
68
- its(:subjects) { should == ['Fiction'] }
69
- its(:description) { should == 'Each facsimile page of the original manuscript is accompanied here by a typeset transcript on the facing page' }
70
- its(:publisher) { should == 'Some Publisher' }
71
- its(:source) { should == 'http://code.google.com/p/epub-samples/downloads/detail?name=wasteland-20120118.epub' }
72
- its(:languages) { should == ['en-US'] }
73
- its(:rights) { should == 'This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.' }
68
+ its(:titles) { should == ['The Waste Land'] }
69
+ its(:subjects) { should == ['Fiction'] }
70
+ its(:description) { should == 'Each facsimile page of the original manuscript is accompanied here by a typeset transcript on the facing page' }
71
+ its(:publisher) { should == 'Some Publisher' }
72
+ its(:source) { should == 'http://code.google.com/p/epub-samples/downloads/detail?name=wasteland-20120118.epub' }
73
+ its(:languages) { should == ['en-US'] }
74
+ its(:rights) { should == 'This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.' }
74
75
 
75
- context 'creators' do
76
- it 'count should be 1' do
77
- subject.creators.count.should == 1
78
- end
76
+ context 'creators' do
77
+ it 'count should be 1' do
78
+ subject.creators.count.should == 1
79
+ end
79
80
 
80
- it 'values should be of type Person' do
81
- subject.creators.each do |creator|
82
- creator.should be_kind_of EPUBInfo::Models::Person
81
+ it 'values should be of type Person' do
82
+ subject.creators.each do |creator|
83
+ creator.should be_kind_of EPUBInfo::Models::Person
84
+ end
83
85
  end
84
86
  end
85
- end
86
87
 
87
- context 'contributors' do
88
- it 'count should be 0' do
89
- subject.contributors.count.should == 0
88
+ context 'contributors' do
89
+ it 'count should be 0' do
90
+ subject.contributors.count.should == 0
91
+ end
90
92
  end
91
- end
92
93
 
93
- context 'dates' do
94
- it 'count should be 1' do
95
- subject.dates.count.should == 1
94
+ context 'dates' do
95
+ it 'count should be 1' do
96
+ subject.dates.count.should == 1
97
+ end
96
98
  end
97
- end
98
99
 
99
- context 'identifiers' do
100
- it 'count should be 1' do
101
- subject.identifiers.count.should == 1
102
- end
100
+ context 'identifiers' do
101
+ it 'count should be 1' do
102
+ subject.identifiers.count.should == 1
103
+ end
103
104
 
104
- it 'values should be of type Identifier' do
105
- subject.identifiers.each do |identifier|
106
- identifier.should be_kind_of EPUBInfo::Models::Identifier
105
+ it 'values should be of type Identifier' do
106
+ subject.identifiers.each do |identifier|
107
+ identifier.should be_kind_of EPUBInfo::Models::Identifier
108
+ end
107
109
  end
108
110
  end
109
111
  end
@@ -120,5 +122,22 @@ describe EPUBInfo::Models::Book do
120
122
  its(:identifiers) { should == [] }
121
123
  its(:languages) { should == [] }
122
124
  end
125
+
126
+ describe '#to_hash' do
127
+ context 'keys' do
128
+ subject { EPUBInfo::Models::Book.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf'))).to_hash.keys }
129
+ it { should include :titles }
130
+ it { should include :creators }
131
+ it { should include :subjects }
132
+ it { should include :description }
133
+ it { should include :publisher }
134
+ it { should include :contributors }
135
+ it { should include :dates }
136
+ it { should include :identifiers }
137
+ it { should include :source }
138
+ it { should include :languages }
139
+ it { should include :rights }
140
+ end
141
+ end
123
142
  end
124
143
 
@@ -1,8 +1,18 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe EPUBInfo::Models::Date do
4
- subject { EPUBInfo::Models::Date.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:date').first) }
4
+ describe '#initialize' do
5
+ subject { EPUBInfo::Models::Date.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:date').first) }
5
6
 
6
- its(:time) { should == Time.parse('2005-08-17') }
7
- its(:event) { should == 'publication' }
7
+ its(:time) { should == Time.parse('2005-08-17') }
8
+ its(:event) { should == 'publication' }
9
+ end
10
+
11
+ describe '#to_hash' do
12
+ context 'keys' do
13
+ subject { EPUBInfo::Models::Date.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:date').first).to_hash.keys }
14
+ it { should include :time }
15
+ it { should include :event }
16
+ end
17
+ end
8
18
  end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe EPUBInfo::Models::Identifier do
4
+ describe '#initialize' do
5
+ context 'EPUB2' do
6
+ subject { EPUBInfo::Models::Identifier.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:identifier', EPUBInfo::Utils::DC_NAMESPACE).first) }
7
+
8
+ its(:identifier) { should == 'http://www.gutenberg.org/ebooks/5200' }
9
+ its(:scheme) { should == 'URI' }
10
+ end
11
+
12
+ context 'EPUB3' do
13
+ subject { EPUBInfo::Models::Identifier.new(Nokogiri::XML(File.new('spec/support/xml/wasteland_metadata_epub3.opf')).css('metadata').xpath('.//dc:identifier', EPUBInfo::Utils::DC_NAMESPACE).first) }
14
+
15
+ its(:identifier) { should == 'code.google.com.epub-samples.wasteland-basic' }
16
+ end
17
+ end
18
+
19
+ describe '#to_hash' do
20
+ context 'keys' do
21
+ subject { EPUBInfo::Models::Identifier.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:identifier', EPUBInfo::Utils::DC_NAMESPACE).first).to_hash.keys }
22
+ it { should include :identifier }
23
+ it { should include :scheme }
24
+ end
25
+ end
26
+ end
27
+
@@ -1,20 +1,31 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe EPUBInfo::Models::Person do
4
- context 'creator' do
5
- subject { EPUBInfo::Models::Person.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:creator').first) }
4
+ describe '#initialize' do
5
+ context 'creator' do
6
+ subject { EPUBInfo::Models::Person.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:creator').first) }
6
7
 
7
- its(:name) { should == 'Franz Kafka' }
8
- its(:file_as) { should == 'Kafka, Franz' }
9
- its(:role) { should be_nil }
10
- end
8
+ its(:name) { should == 'Franz Kafka' }
9
+ its(:file_as) { should == 'Kafka, Franz' }
10
+ its(:role) { should be_nil }
11
+ end
12
+
13
+ context 'contributor' do
14
+ subject { EPUBInfo::Models::Person.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:contributor').first) }
11
15
 
12
- context 'contributor' do
13
- subject { EPUBInfo::Models::Person.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:contributor').first) }
16
+ its(:name) { should == 'David Wyllie' }
17
+ its(:file_as) { should == 'Wyllie, David' }
18
+ its(:role) { should == 'trl' }
19
+ end
20
+ end
14
21
 
15
- its(:name) { should == 'David Wyllie' }
16
- its(:file_as) { should == 'Wyllie, David' }
17
- its(:role) { should == 'trl' }
22
+ describe '#initialize' do
23
+ context 'keys' do
24
+ subject { EPUBInfo::Models::Person.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:creator').first).to_hash.keys }
25
+ it { should include :name }
26
+ it { should include :file_as }
27
+ it { should include :role }
28
+ end
18
29
  end
19
30
  end
20
31
 
@@ -6,7 +6,9 @@ describe EPUBInfo do
6
6
  describe '#get' do
7
7
  it 'calls parser' do
8
8
  document = EPUBInfo::Parser.parse(epub_path).metadata_document
9
- EPUBInfo::Parser.should_receive(:parse) { document }
9
+ parser = mock
10
+ parser.stub(:metadata_document)
11
+ EPUBInfo::Parser.should_receive(:parse) { parser }
10
12
  EPUBInfo.get(epub_path)
11
13
  end
12
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epubinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000 Z
12
+ date: 2012-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubyzip
16
- requirement: &70277487870140 !ruby/object:Gem::Requirement
16
+ requirement: &70144976238900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.9.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70277487870140
24
+ version_requirements: *70144976238900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &70277487869060 !ruby/object:Gem::Requirement
27
+ requirement: &70144976237580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.5.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70277487869060
35
+ version_requirements: *70144976237580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70277487868220 !ruby/object:Gem::Requirement
38
+ requirement: &70144976236920 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.9.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70277487868220
46
+ version_requirements: *70144976236920
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: yard
49
- requirement: &70277487867080 !ruby/object:Gem::Requirement
49
+ requirement: &70144976236060 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.7.5
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70277487867080
57
+ version_requirements: *70144976236060
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &70277487864120 !ruby/object:Gem::Requirement
60
+ requirement: &70144976235400 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.1.3
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70277487864120
68
+ version_requirements: *70144976235400
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &70277487862520 !ruby/object:Gem::Requirement
71
+ requirement: &70144976234360 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.8.3
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70277487862520
79
+ version_requirements: *70144976234360
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: simplecov
82
- requirement: &70277487877760 !ruby/object:Gem::Requirement
82
+ requirement: &70144976233760 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70277487877760
90
+ version_requirements: *70144976233760
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: guard
93
- requirement: &70277487876700 !ruby/object:Gem::Requirement
93
+ requirement: &70144976233080 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70277487876700
101
+ version_requirements: *70144976233080
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: guard-rspec
104
- requirement: &70277487875840 !ruby/object:Gem::Requirement
104
+ requirement: &70144976231960 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70277487875840
112
+ version_requirements: *70144976231960
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rb-fsevent
115
- requirement: &70277487874480 !ruby/object:Gem::Requirement
115
+ requirement: &70144976229800 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70277487874480
123
+ version_requirements: *70144976229800
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: growl
126
- requirement: &70277487872840 !ruby/object:Gem::Requirement
126
+ requirement: &70144976228360 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70277487872840
134
+ version_requirements: *70144976228360
135
135
  description: Currently only supports EPUB 3 specification.
136
136
  email: christof@chdorner.com
137
137
  executables: []
@@ -157,9 +157,9 @@ files:
157
157
  - lib/epubinfo/models/person.rb
158
158
  - lib/epubinfo/parser.rb
159
159
  - lib/epubinfo/utils.rb
160
- - spec/lib/epubinfo/identifier_spec.rb
161
160
  - spec/lib/epubinfo/models/book_spec.rb
162
161
  - spec/lib/epubinfo/models/date_spec.rb
162
+ - spec/lib/epubinfo/models/identifier_spec.rb
163
163
  - spec/lib/epubinfo/models/person_spec.rb
164
164
  - spec/lib/epubinfo/parser_spec.rb
165
165
  - spec/lib/epubinfo_spec.rb
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: 995591802829821889
186
+ hash: 1349912243114699965
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements:
@@ -1,17 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe EPUBInfo::Models::Identifier do
4
- context 'EPUB2' do
5
- subject { EPUBInfo::Models::Identifier.new(Nokogiri::XML(File.new('spec/support/xml/metamorphosis_metadata_epub2.opf')).css('metadata').xpath('.//dc:identifier', EPUBInfo::Utils::DC_NAMESPACE).first) }
6
-
7
- its(:identifier) { should == 'http://www.gutenberg.org/ebooks/5200' }
8
- its(:scheme) { should == 'URI' }
9
- end
10
-
11
- context 'EPUB3' do
12
- subject { EPUBInfo::Models::Identifier.new(Nokogiri::XML(File.new('spec/support/xml/wasteland_metadata_epub3.opf')).css('metadata').xpath('.//dc:identifier', EPUBInfo::Utils::DC_NAMESPACE).first) }
13
-
14
- its(:identifier) { should == 'code.google.com.epub-samples.wasteland-basic' }
15
- end
16
- end
17
-