lib/gepub/resource_builder.rb in gepub-0.6.8.5 vs lib/gepub/resource_builder.rb in gepub-0.6.8.6

- old
+ new

@@ -13,12 +13,12 @@ def media_type(val) @item.set_media_type(val) end - def method_missing(name, *args) - @item.send(name.to_sym, *args) + def method_missing(name, *args, &block) + @item.send(name.to_sym, *args, &block) end end def initialize(book, attributes = {}, &block) @last_defined_item = nil @@ -81,10 +81,26 @@ itemref = @book.spine.itemref_by_id[@last_defined_item.item.id] raise 'page_spread_right should be called inside ordered' if (itemref.nil?) itemref.page_spread_right end + def rendition_layout val + itemref = @book.spine.itemref_by_id[@last_defined_item.item.id] + raise 'rendition should be called inside ordered' if (itemref.nil?) + itemref.rendition_layout = val + end + def rendition_orientation val + itemref = @book.spine.itemref_by_id[@last_defined_item.item.id] + raise 'rendition should be called inside ordered' if (itemref.nil?) + itemref.rendition_orientation = val + end + def rendition_spread val + itemref = @book.spine.itemref_by_id[@last_defined_item.item.id] + raise 'rendition should be called inside ordered' if (itemref.nil?) + itemref.rendition_spread = val + end + def linear val itemref = @book.spine.itemref_by_id[@last_defined_item.item.id] raise 'linear should be called inside ordered' if (itemref.nil?) itemref.linear = val end @@ -102,9 +118,16 @@ @dir_prefix = dir_prefix_org end def add_resource_dir(name) import "#{name}/resources.conf", :dir_prefix => name + end + + def add_resource_dirs(dirs) + dirs.each do + |dir| + add_resource_dir dir + end end def cover_image(val) file(val) @last_defined_item.cover_image