Class: Bookbinder::Package::Openbook

Inherits:
Bookbinder::Package show all
Defined in:
lib/bookbinder/package/openbook.rb

Constant Summary collapse

DEFAULT_CONTENT_ROOT =
''

Instance Attribute Summary collapse

Attributes inherited from Bookbinder::Package

#content_root, #file_aliases, #file_system, #map, #options, #warnings

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Bookbinder::Package

#apply_transform, build, #build, #copy_to, #export, #file, #file_path, #if_file, #import, #initialize, #read, read, require_transforms, #reset_transforms, #save_open_files, #to_map, #transforms, #warn, #write

Constructor Details

This class inherits a constructor from Bookbinder::Package

Instance Attribute Details

#mipObject

Returns the value of attribute mip.



6
7
8
# File 'lib/bookbinder/package/openbook.rb', line 6

def mip
  @mip
end

Class Method Details

.recognize(path) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/bookbinder/package/openbook.rb', line 9

def self.recognize(path)
  ext = File.extname(path).downcase
  return (
    ext == '.openbook' ||
    File.exists?(File.join(path, 'book.json')) ||
    (ext.empty? && !File.exists?(path))
  )
end

.transformsObject



19
20
21
22
23
24
# File 'lib/bookbinder/package/openbook.rb', line 19

def self.transforms
  @transforms ||= [
    Bookbinder::Transform::Generator,
    Bookbinder::Transform::BookJSON
  ]
end

Instance Method Details

#from_mapObject



27
28
29
30
# File 'lib/bookbinder/package/openbook.rb', line 27

def from_map
  @mip = duplicate_map(@map)
  super
end