INNER CODE UNIT · Ruby
self
thesp0nge/dawnscanner · lib/dawn/core.rb:95
def self.detect_mvc_from_file(target)
code = File.read(target)
parsed_code = Parser::CurrentRuby.parse(code)
ast = Dawn::Processor::Require.new
ast.process_all(parsed_code)
return Dawn::Sinatra.new(target) if ast.is_sinatra
return nil
end
def self.detect_mvc(target)
# Issue#268
return detect_mvc_from_file(target) if (File.file?(target) and File.extname(target) == ".rb")
raise ArgumentError.new("you must set target directory") if target.nil?