Class: Tnef::Executable

Inherits:
Object
  • Object
show all
Defined in:
lib/tnef/executable.rb

Class Method Summary collapse

Class Method Details

.installed?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/tnef/executable.rb', line 21

def self.installed?
  !path.nil?
end

.pathObject


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tnef/executable.rb', line 5

def self.path
  return @path if defined?(@path)

  @path = begin
    gem_local_path = File.expand_path('../../ext/tnef/bin/tnef', File.dirname(__FILE__))

    if File.executable?(gem_local_path)
      gem_local_path
    elsif other_path = system('which tnef > /dev/null')
      `which tnef`.strip
    else
      nil
    end
  end
end