No more check_executable, check extname instead.

When File.executable?() is used, it checks if the file is an
executable AND that exe permission is set. Well, we don't really
have to set the permission we can still load/use the module. So
really, all we care is the module must be a ".rb" to make sure
it loads at startup.  So that's what we need to check.
unstable
sinn3r 2012-10-12 14:37:42 -05:00
parent 2bbbbee381
commit 2b9c04318f
1 changed files with 4 additions and 4 deletions

View File

@ -58,9 +58,9 @@ class Msftidy
#
##
def check_executable
if not File.executable?(@name)
warn("File is not executable. Double check your file type and permissions.")
def check_extname
if File.extname(@name) != '.rb'
error("Module should be a '.rb' file, or it won't load.")
end
end
@ -228,7 +228,7 @@ end
def run_checks(f_rel)
tidy = Msftidy.new(f_rel)
tidy.check_executable
tidy.check_extname
tidy.test_old_rubies(f_rel)
tidy.check_ranking
tidy.check_disclosure_date