eeepub 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
data/lib/eeepub/easy.rb CHANGED
@@ -46,7 +46,32 @@ module EeePub
46
46
  def save(filename)
47
47
  Dir.mktmpdir do |dir|
48
48
  prepare(dir)
49
- super
49
+
50
+ NCX.new(
51
+ :uid => @uid,
52
+ :title => @titles[0],
53
+ :nav => @nav
54
+ ).save(File.join(dir, @ncx_file))
55
+
56
+ OPF.new(
57
+ :title => @titles,
58
+ :identifier => @identifiers,
59
+ :creator => @creators,
60
+ :publisher => @publishers,
61
+ :date => @dates,
62
+ :language => @languages,
63
+ :subject => @subjects,
64
+ :description => @descriptions,
65
+ :rights => @rightss,
66
+ :relation => @relations,
67
+ :manifest => @files.map{|i| File.basename(i)},
68
+ :ncx => @ncx_file
69
+ ).save(File.join(dir, @opf_file))
70
+
71
+ OCF.new(
72
+ :dir => dir,
73
+ :container => @opf_file
74
+ ).save(filename)
50
75
  end
51
76
  end
52
77
 
@@ -60,6 +85,10 @@ module EeePub
60
85
  filenames << filename
61
86
  end
62
87
 
88
+ assets.each do |file|
89
+ FileUtils.cp(file, dir)
90
+ end
91
+
63
92
  files(filenames + assets)
64
93
  nav(
65
94
  [sections, filenames].transpose.map do |section, filename|
@@ -44,6 +44,8 @@ HTML
44
44
 
45
45
  it 'spec for prepare' do
46
46
  Dir.mktmpdir do |dir|
47
+ mock(FileUtils).cp('image.png', dir)
48
+
47
49
  @easy.send(:prepare, dir)
48
50
 
49
51
  file1 = File.join(dir, 'section_0.html')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 0
9
- version: 0.5.0
8
+ - 1
9
+ version: 0.5.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - jugyo