Class: Clouseau::Detector

Inherits:
Object
  • Object
show all
Defined in:
lib/clouseau/detector.rb

Direct Known Subclasses

DotNet, Erlang, Java, Node, PHP, Python, Ruby

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.framework_nameObject

name of the detected framework



22
23
24
# File 'lib/clouseau/detector.rb', line 22

def framework_name
  @framework_name
end

.language_nameObject

name of the detected language



27
28
29
# File 'lib/clouseau/detector.rb', line 27

def language_name
  @language_name
end

.memory_suggestionObject

suggested minimum memory allocation for an application of this type



32
33
34
# File 'lib/clouseau/detector.rb', line 32

def memory_suggestion
  @memory_suggestion
end

Class Method Details

.detectionObject

each detection technique; an array of blocks which when called with a path yield true or false



17
18
19
# File 'lib/clouseau/detector.rb', line 17

def detection
  @detection ||= []
end

Instance Method Details

#detect(path) ⇒ Object

run through the detection methods and return ‘true’ if one matches



131
132
133
134
135
# File 'lib/clouseau/detector.rb', line 131

def detect(path)
  self.class.detection.any? do |d|
    d.call(path)
  end
end