Module: Creek::Utils

Included in:
Drawing, Sheet
Defined in:
lib/creek/utils.rb

Instance Method Summary collapse

Instance Method Details

#expand_to_rels_path(filepath) ⇒ Object



5
6
7
# File 'lib/creek/utils.rb', line 5

def expand_to_rels_path(filepath)
  filepath.sub(/(\/[^\/]+$)/, '/_rels\1.rels')
end

#file_exist?(path) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/creek/utils.rb', line 9

def file_exist?(path)
  @book.files.file.exist?(path)
end

#parse_xml(xml_path) ⇒ Object



13
14
15
16
# File 'lib/creek/utils.rb', line 13

def parse_xml(xml_path)
  doc = @book.files.file.open(xml_path)
  Nokogiri::XML::Document.parse(doc)
end