Module: ErrorLocator

Defined in:
lib/error-locator.rb,
lib/error-locator/version.rb

Constant Summary collapse

VERSION =
"0.0.5"

Class Method Summary collapse

Class Method Details

.call(env) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/error-locator.rb', line 2

def self.call(env)
  req = Rack::Request.new(env)
  line = req.params['line']
  filename = line[/[^:]+[:]\d+/]
  if !filename.blank?
    f = File.expand_path(filename)
    `$EDITOR "#{f}"` if File.exists?(f)
  end
  [200, {}, [] ]
end