Module: SharpOffice

Defined in:
lib/sharp_office.rb,
lib/sharp_office/office.rb,
lib/sharp_office/version.rb

Defined Under Namespace

Classes: Office

Constant Summary collapse

VERSION =
"1.0.3"

Class Method Summary collapse

Class Method Details

.loggerObject



12
13
14
15
16
17
# File 'lib/sharp_office.rb', line 12

def self.logger
  return @logger if @logger
  logger = Logger.new(STDOUT)
  logger.level = Logger::INFO
  @logger = logger
end

.logger=(log) ⇒ Object



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

def self.logger=(log)
  @logger = log
end

.process(path, options = {:pages => '1-20'}) ⇒ Object

Raises:

  • (Errno::ENOENT)


19
20
21
22
# File 'lib/sharp_office.rb', line 19

def self.process(path, options={:pages => '1-20'})
  raise Errno::ENOENT, "the file '#{path}' does not exist" unless File.exists?(path)
  Office.instance.start(path, options)
end