Class: SharpOffice::Office
- Inherits:
-
Object
- Object
- SharpOffice::Office
- Includes:
- Singleton
- Defined in:
- lib/sharp_office/office.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#path ⇒ Object (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 = @path = File.(path) system_or_exit(convert_to_pdf) unless [:ignore_pdf] system_or_exit(convert_to_swf) unless [:ignore_swf] system_or_exit(convert_to_cover) unless [: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 |