Module: Wand

Defined in:
lib/wand.rb,
lib/wand/version.rb

Constant Summary collapse

VERSION =
"0.4"

Class Method Summary collapse

Class Method Details

.executableObject



12
13
14
# File 'lib/wand.rb', line 12

def self.executable
  @executable ||= `which file`.chomp
end

.executable=(path) ⇒ Object



16
17
18
# File 'lib/wand.rb', line 16

def self.executable=(path)
  @executable = path
end

.wave(path, options = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/wand.rb', line 5

def self.wave(path, options={})
  type = MIME::Types.type_for(options[:original_filename] || path)[0].to_s
  type = parse_type(execute_file_cmd(path)) if blank?(type)
  type = nil if type =~ /^cannot/i
  type
end