gepub 0.6.8.3 → 0.6.8.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/gepub/book.rb CHANGED
@@ -78,6 +78,9 @@ module GEPUB
78
78
  # returns Meta object contains last modified time.
79
79
  # === setting and reading other metadata: publisher, language, coverage, date, description, format, relation, rights, source, subject, type (delegated to Metadata)
80
80
  # they all have methods like: publisher(which returns 'main' publisher), add_publisher(content, id) (which add publisher), set_publisher or publisher= (clears and set publisher), and publisher_list(returns publisher Meta object in display-seq order).
81
+ # === Book#page_progression_direction= (delegated to Spine#page_progression_direction=)
82
+ # set page-proression-direction attribute to spine.
83
+
81
84
  class Book
82
85
  MIMETYPE='mimetype'
83
86
  MIMETYPE_CONTENTS='application/epub+zip'
data/lib/gepub/builder.rb CHANGED
@@ -260,6 +260,12 @@ module GEPUB
260
260
  MetaItem.new(@book.add_contributor(val, nil, role))
261
261
  end
262
262
 
263
+ # set page progression direction.
264
+ def page_progression_direction(val)
265
+ raise assert unless ['rtl', 'ltr', 'default'].member? val
266
+ @book.page_progression_direction = val
267
+ end
268
+
263
269
  # set optional file.
264
270
  # val should be String or Hash.
265
271
  # if val is String, file is read from the File specified by string and stored in EPUB to the path specified by string.
data/lib/gepub/package.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'nokogiri'
3
+ require 'forwardable'
3
4
 
4
5
  module GEPUB
5
6
  # Holds data in opf file.
@@ -12,6 +13,8 @@ module GEPUB
12
13
  |x|
13
14
  ["#{x}", "#{x}_list", "set_#{x}", "#{x}=", "add_#{x}"]
14
15
  }.flatten
16
+ def_delegators :@spine, :page_progression_direction=
17
+ def_delegators :@spine, :page_progression_direction
15
18
 
16
19
 
17
20
  class IDPool
@@ -83,6 +83,12 @@ module GEPUB
83
83
  itemref.page_spread_right
84
84
  end
85
85
 
86
+ def linear val
87
+ itemref = @book.spine.itemref_by_id[@last_defined_item.item.id]
88
+ raise 'linear should be called inside ordered' if (itemref.nil?)
89
+ itemref.linear = val
90
+ end
91
+
86
92
  def glob(arg)
87
93
  files(*Dir.glob(arg))
88
94
  end
data/lib/gepub/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module GEPUB
2
2
  # GEPUB gem version
3
- VERSION = "0.6.8.3"
3
+ VERSION = "0.6.8.5"
4
4
  end
data/lib/gepub.rb CHANGED
@@ -17,7 +17,6 @@ else
17
17
  end
18
18
  end
19
19
  end
20
- require 'forwardable'
21
20
  require 'gepub/version'
22
21
  require 'gepub/xml_util'
23
22
  require 'gepub/meta'
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.3
4
+ version: 0.6.8.5
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-07-03 00:00:00.000000000 Z
12
+ date: 2012-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70101613986380 !ruby/object:Gem::Requirement
16
+ requirement: &70309442002400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70101613986380
24
+ version_requirements: *70309442002400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &70101613984580 !ruby/object:Gem::Requirement
27
+ requirement: &70309442001900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.5.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70101613984580
35
+ version_requirements: *70309442001900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rubyzip
38
- requirement: &70101613994180 !ruby/object:Gem::Requirement
38
+ requirement: &70309442001440 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.9.7
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70101613994180
46
+ version_requirements: *70309442001440
47
47
  description: gepub is a generic EPUB parser/generator. Generates and parse EPUB2 and
48
48
  EPUB3
49
49
  email: