Module: Clouseau

Defined in:
lib/clouseau.rb,
lib/clouseau/version.rb,
lib/clouseau/detector.rb,
lib/clouseau/detectors/php.rb,
lib/clouseau/detectors/java.rb,
lib/clouseau/detectors/lift.rb,
lib/clouseau/detectors/node.rb,
lib/clouseau/detectors/play.rb,
lib/clouseau/detectors/rack.rb,
lib/clouseau/detectors/ruby.rb,
lib/clouseau/detectors/flask.rb,
lib/clouseau/detectors/rails.rb,
lib/clouseau/detectors/django.rb,
lib/clouseau/detectors/dotnet.rb,
lib/clouseau/detectors/erlang.rb,
lib/clouseau/detectors/grails.rb,
lib/clouseau/detectors/python.rb,
lib/clouseau/detectors/spring.rb,
lib/clouseau/detectors/sinatra.rb

Defined Under Namespace

Classes: Detector, Django, DotNet, Erlang, Flask, Grails, Java, Lift, Node, PHP, Play, Python, Rack, Rails, Ruby, Sinatra, Spring

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.detect(path) ⇒ Object



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

def detect(path)
  detectors.find do |d|
    d.new.detect(path)
  end
end

.detectorsObject

array of registered detectors, in the order they’ll be tried

see Detector.inherited



7
8
9
# File 'lib/clouseau/detector.rb', line 7

def self.detectors
  @detectors ||= []
end

.matches(path) ⇒ Object



12
13
14
15
16
# File 'lib/clouseau.rb', line 12

def matches(path)
  detectors.select do |d|
    d.new.detect(path)
  end
end