eeepub_ext 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3ac6e610d8a21b64cd16c3b6f7a909aa9fc453c
4
- data.tar.gz: 6722b01dcc35cf8aec238a52f2fa37a191f3e9ae
3
+ metadata.gz: 60ad21cac40fc06f39008ec1d59742d785280f2a
4
+ data.tar.gz: b013f31313fc0d73bdf3ee9fa10b3061fe647be6
5
5
  SHA512:
6
- metadata.gz: 537891429ef5cbf7cd8e2cc6602a39fbe259b9458be236d1f46e92849f58e5c6e25972efc7124cffb881dcb701d4cffc02ce625666ae427035b35949960a7e1b
7
- data.tar.gz: 48a7309bf507d1331c704e25f9f78e21753b9ec706095adcb197c1768ab05a2cc24927ece9c65f916e96a1292008778fb65cf73b4ecc9aaf3ee3761085329f31
6
+ metadata.gz: af7d451601842be93f3d41b413d50267f303c39d66fb890b594ee777bc38082afc7a6c366fc59619d41b3f1c5fda5f19ac30142d6de3a5dfaa5c40b8454e90f4
7
+ data.tar.gz: 5fc21232757a8cc1203c57aa7bca8c70707151677c1d3c67313e7d0ff962cdb960daee15af7823ab72038509f4a6b7c4ec1e22b2625835398d5e322a2e337ee1
@@ -1,5 +1,11 @@
1
1
  ### Changelog
2
2
 
3
+ ### 0.8.4
4
+
5
+ - Add some code from the [PR#14](https://github.com/jugyo/eeepub/pull/34)
6
+ - Fix the failing tests
7
+ - Minor code cleanup
8
+
3
9
  ### 0.8.3
4
10
 
5
11
  - Provide link to the right location for the source
@@ -1,12 +1,12 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "eeepub_ext"
4
- s.version = "0.8.3"
4
+ s.version = "0.8.4"
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ["jugyo"]
7
7
  s.email = ["agilecreativity@gmail.com"]
8
8
  # NOTE: the original location of the gem
9
- # s.homepage = "http://github.com/jugyo/eeepub"
9
+ # s.homepage = "http://github.com/jugyo/eeepub"
10
10
  # NOTE: the current location of the modified gem
11
11
  s.homepage = "https://github.com/agilecreativity/eeepub"
12
12
  s.summary = %q{ePub generator - with rubyzip bug fix (unofficial fork version)}
@@ -15,16 +15,17 @@ Gem::Specification.new do |s|
15
15
  I added the bug fix to rubyzip to make it work with my own gem (source2epub).
16
16
  This gem will be deprecated as soon as the original author (jugyo) merge
17
17
  the pull request from the community with this change and many others fixes.}
18
+ s.required_ruby_version = ">= 2.0.0"
18
19
  s.files = `git ls-files`.split("\n")
19
20
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
22
  s.require_paths = ["lib"]
22
- s.add_dependency "builder", "~> 3.2.2"
23
- s.add_dependency "rubyzip", "~> 1.1.6"
24
- s.add_development_dependency "rspec", "~> 3.1.0"
25
- s.add_development_dependency "nokogiri", "~> 1.6.3.1"
26
- s.add_development_dependency "rr", "~> 1.1.2"
27
- s.add_development_dependency "simplecov", "~> 0.9.0"
28
- s.add_development_dependency "pry", "~> 0.10.1"
29
- s.add_development_dependency "pry-byebug", "~> 2.0.0" if RUBY_VERSION >= "2.0.0"
23
+ s.add_dependency "builder", "~> 3.2"
24
+ s.add_dependency "rubyzip", "~> 1.2"
25
+ s.add_development_dependency "rspec", "~> 3.1"
26
+ s.add_development_dependency "nokogiri", "~> 1.6"
27
+ s.add_development_dependency "rr", "~> 1.1"
28
+ s.add_development_dependency "simplecov", "~> 0.9"
29
+ s.add_development_dependency "pry", "~> 0.10"
30
+ s.add_development_dependency "pry-byebug", '~> 3.3'
30
31
  end
@@ -89,6 +89,8 @@ module EeePub
89
89
  'application/x-dtbncx+xml'
90
90
  when /.*\.opf$/i
91
91
  'application/oebps-package+xml'
92
+ when /.*\.otf$/i
93
+ 'application/x-font-otf'
92
94
  end
93
95
  end
94
96
 
@@ -91,7 +91,7 @@ module EeePub
91
91
  output_path = File.expand_path(output_path)
92
92
  create_epub do
93
93
  mimetype = Zip::OutputStream::open(output_path) do |os|
94
- os.put_next_entry("mimetype", nil, nil, Zip::Entry::STORED, Zlib::NO_COMPRESSION)
94
+ os.put_next_entry("mimetype")
95
95
  os << "application/epub+zip"
96
96
  end
97
97
  zipfile = Zip::File.open(output_path)
@@ -115,15 +115,30 @@ module EeePub
115
115
  end
116
116
 
117
117
  private
118
+
118
119
  def create_epub
119
120
  FileUtils.chdir(dir) do
120
121
  meta_inf = 'META-INF'
121
122
  FileUtils.mkdir_p(meta_inf)
122
123
 
123
124
  container.save(File.join(meta_inf, 'container.xml'))
125
+ write_ibook_font_file(meta_inf)
124
126
  yield
125
127
  end
128
+ end
126
129
 
130
+ def write_ibook_font_file(meta_inf)
131
+ content = %Q|
132
+ <?xml version="1.0" encoding="UTF-8"?>
133
+ <display_options>
134
+ <platform name="*">
135
+ <option name="specified-fonts">true</option>
136
+ </platform>
137
+ </display_options>
138
+ |
139
+ File.open(File.join(meta_inf,'com.apple.ibooks.display-options.xml'),'w') do |file|
140
+ file.write(content.strip)
141
+ end
127
142
  end
128
143
  end
129
144
  end
@@ -1,5 +1,3 @@
1
- # TODO: for debugging only
2
- require 'pry'
3
1
  require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
4
2
 
5
3
  describe "EeePub::Easy" do
@@ -45,7 +43,6 @@ HTML
45
43
  end
46
44
 
47
45
  it 'spec for prepare' do
48
- pending "TODO: this result in error, disable for now"
49
46
  Dir.mktmpdir do |dir|
50
47
  mock(FileUtils).cp('image.png', dir)
51
48
 
@@ -54,8 +51,8 @@ HTML
54
51
  file1 = File.join(dir, 'section_0.html')
55
52
  file2 = File.join(dir, 'section_1.html')
56
53
 
57
- File.exists?(file1).should be_true
58
- File.exists?(file2).should be_true
54
+ expect(File.exists?(file1)).to be_truthy
55
+ expect(File.exists?(file2)).to be_truthy
59
56
 
60
57
  File.read(file1).should == @easy.sections[0][1]
61
58
  File.read(file2).should == @easy.sections[1][1]
@@ -17,6 +17,7 @@ describe "EeePub::Maker" do
17
17
  ncx_file 'toc.ncx'
18
18
  opf_file 'content.opf'
19
19
  cover 'cover.jpg'
20
+ guide 'xxx'
20
21
  files ['foo.html', 'bar.html']
21
22
  nav [
22
23
  {:label => '1. foo', :content => 'foo.html'},
@@ -43,7 +44,6 @@ describe "EeePub::Maker" do
43
44
  }
44
45
 
45
46
  it 'should save' do
46
- pending "TODO: this result in error, disable for now"
47
47
  stub(FileUtils).cp.with_any_args
48
48
  mock(Dir).mktmpdir { '/tmp' }
49
49
  mock(EeePub::NCX).new(
@@ -54,21 +54,23 @@ describe "EeePub::Maker" do
54
54
  ],
55
55
  :uid=>{:value=>"http://example.com/book/foo", :scheme=>"URL", :id=>"http://example.com/book/foo"}
56
56
  ) { stub!.save }
57
+
57
58
  mock(EeePub::OPF).new(
58
59
  :title => ["sample"],
60
+ :unique_identifier=>"http://example.com/book/foo",
61
+ :identifier => [{:value => "http://example.com/book/foo", :scheme => "URL", :id => "http://example.com/book/foo"}],
59
62
  :creator => ["jugyo"],
63
+ :publisher => ["jugyo.org"],
60
64
  :date => ["2010-05-06"],
61
65
  :language => ['en'],
62
66
  :subject => ['epub sample'],
63
67
  :description => ['this is epub sample'],
64
68
  :rights => ['xxx'],
69
+ :cover => 'cover.jpg',
65
70
  :relation => ['xxx'],
71
+ :manifest => ['foo.html', 'bar.html'],
66
72
  :ncx => "toc.ncx",
67
- :cover => 'cover.jpg',
68
- :publisher => ["jugyo.org"],
69
- :unique_identifier=>"http://example.com/book/foo",
70
- :identifier => [{:value => "http://example.com/book/foo", :scheme => "URL", :id => "http://example.com/book/foo"}],
71
- :manifest => ['foo.html', 'bar.html']
73
+ :guide => 'xxx'
72
74
  ) { stub!.save }
73
75
  mock(EeePub::OCF).new(
74
76
  :container => "content.opf",
@@ -90,6 +92,7 @@ describe "EeePub::Maker" do
90
92
  description 'this is epub sample'
91
93
  rights 'xxx'
92
94
  relation 'xxx'
95
+ guide 'xxx'
93
96
  identifier 'http://example.com/book/foo', :scheme => 'URL'
94
97
  uid 'http://example.com/book/foo'
95
98
  ncx_file 'toc.ncx'
@@ -104,7 +107,6 @@ describe "EeePub::Maker" do
104
107
  end
105
108
 
106
109
  it 'should save' do
107
- pending "TODO: this result in error, disable for now"
108
110
  stub(FileUtils).cp.with_any_args
109
111
  stub(FileUtils).mkdir_p.with_any_args
110
112
  mock(Dir).mktmpdir { '/tmp' }
@@ -119,6 +121,7 @@ describe "EeePub::Maker" do
119
121
  :rights => ['xxx'],
120
122
  :relation => ['xxx'],
121
123
  :ncx => "toc.ncx",
124
+ :guide => 'xxx',
122
125
  :cover => 'cover.jpg',
123
126
  :publisher => ["jugyo.org"],
124
127
  :unique_identifier=>"http://example.com/book/foo",
@@ -126,6 +129,7 @@ describe "EeePub::Maker" do
126
129
  :manifest => ["foo/bar/foo.html", "foo/bar/baz/bar.html"]
127
130
  ) { stub!.save }
128
131
  mock(EeePub::OCF).new.with_any_args { stub!.save }
132
+
129
133
  @maker.save('test.epub')
130
134
  end
131
135
  end
@@ -42,9 +42,7 @@ describe "EeePub::OCF" do
42
42
  end
43
43
 
44
44
  it 'should stream epub' do
45
- pending "TODO: this result in error, disable for now"
46
45
  output = @ocf.render
47
- output.size.should == 134
48
- output.is_binary_data?.should be_true
46
+ expect(output.size).to eq 135
49
47
  end
50
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eeepub_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-05 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -16,112 +16,112 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.2
19
+ version: '3.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.2
26
+ version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.6
33
+ version: '1.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.1.6
40
+ version: '1.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.1.0
47
+ version: '3.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.1.0
54
+ version: '3.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.6.3.1
61
+ version: '1.6'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.6.3.1
68
+ version: '1.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rr
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.1.2
75
+ version: '1.1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.1.2
82
+ version: '1.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.9.0
89
+ version: '0.9'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.9.0
96
+ version: '0.9'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.10.1
103
+ version: '0.10'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.10.1
110
+ version: '0.10'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pry-byebug
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 2.0.0
117
+ version: '3.3'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 2.0.0
124
+ version: '3.3'
125
125
  description: |-
126
126
  EeePub is a Ruby ePub generator.
127
127
  This code is baded on the original eeepub version 0.8.1.
@@ -170,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: 2.0.0
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - ">="
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.2.2
181
+ rubygems_version: 2.2.5
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: ePub generator - with rubyzip bug fix (unofficial fork version)