Method: Classifile::Classify#run

Defined in:
lib/classifile/classify.rb

#run(target_file, to_path, &block) ⇒ Object



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

def run(target_file, to_path, &block)
  raise "TypeError" unless target_file.is_a?(TargetFile)

  state = State.new(target_file)
  state.to_path = to_path
  state.save_name = target_file.basename

  begin
    state.instance_exec(state.file, &block)
  rescue Failed
    # Ignored

  end
  state.gotcha
end