Module: SpeculateAbout

Defined in:
lib/speculate_about.rb

Instance Method Summary collapse

Instance Method Details

#speculate_about(infile) ⇒ Object

Raises:

  • (ArgumentError)


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

def speculate_about(infile)
  raise ArgumentError, "#{infile} not found" unless File.readable? infile
  ast  = Speculations::Parser.new.parse_from_file(infile)
  code = ast.to_code.join("\n")
  ENV["SPECULATE_ABOUT_DEBUG"] ? _show(code, infile) : instance_eval(code, infile)
end