Class: SharpOffice::Office

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/sharp_office/office.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/sharp_office/office.rb', line 7

def path
  @path
end

Instance Method Details

#start(path, options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/sharp_office/office.rb', line 10

def start(path, options)
  @options = options
  @path = File.expand_path(path)

  system_or_exit(convert_to_pdf) unless options[:ignore_pdf]
  system_or_exit(convert_to_swf) unless options[:ignore_swf]
  system_or_exit(convert_to_cover) unless options[:ignore_cover]
  image = MiniMagick::Image.open(cover_path)
  image.resize "300x300"
  image.write cover_path

  #File.delete(tmp_file_path)

  {:status => 'ok', :pdf_path => pdf_path, :swf_path => swf_path, :cover_path => cover_path}
end