Bugs: Browse | Submit New | Admin

[#16132] flymake executing script/runner files

Date:
2007-12-06 05:15
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
flymake executing script/runner files

Detailed description
If I have a standalone script that needs to access the Rails environment, then I use the script/runner in the following
manner (this is a contrived example):

#! /usr/bin/env script/runner
x = Time.now
MyModel.find(:all).each do |row|
  row.time = x
end

While I'm editing this file, named update_time.rb, flymake will kick in and try to sanity check with the "-c"
option. What actually runs is this:

  ruby ../script/runner -c update_time_flymake.rb

which has the unfortunate side effects of:
 a) not doing any syntax checking, and
 b) actually executing, and updating all my records

this is a Bad Thing.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-12-06 05:33
Sender: Mike Dalessio

never mind. if I use

  #! /usr/bin/ruby ../script/runner

instead of /usr/bin/env as above, this doesn't happen. i guess
this ticket can be closed as not-a-problem.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item