Class: SiteInspector::Endpoint::Sniffer
- Inherits:
-
Check
- Object
- Check
- SiteInspector::Endpoint::Sniffer
show all
- Defined in:
- lib/site-inspector/checks/sniffer.rb
Constant Summary
collapse
- OPEN_SOURCE_FRAMEWORKS =
[
:drupal,
:joomla,
:movabletype,
:phpbb,
:wordpress,
:php,
:expression_engine,
:cowboy
]
Instance Attribute Summary
Attributes inherited from Check
#endpoint
Instance Method Summary
collapse
Methods inherited from Check
enabled=, enabled?, #host, #initialize, #inspect, #name, name, #request, #response
Instance Method Details
#advertising ⇒ Object
40
41
42
|
# File 'lib/site-inspector/checks/sniffer.rb', line 40
def advertising
sniff :advertising
end
|
#analytics ⇒ Object
32
33
34
|
# File 'lib/site-inspector/checks/sniffer.rb', line 32
def analytics
sniff :analytics
end
|
#framework ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'lib/site-inspector/checks/sniffer.rb', line 18
def framework
cms = sniff :cms
return cms unless cms.nil?
return :expression_engine if endpoint.cookies.any? { |c| c.keys.first =~ /^exp_/ }
return :php if endpoint.cookies['PHPSESSID']
return :coldfusion if endpoint.cookies['CFID'] && endpoint.cookies['CFTOKEN']
return :cowboy if endpoint..server.to_s.downcase == 'cowboy'
nil
end
|
#javascript ⇒ Object
36
37
38
|
# File 'lib/site-inspector/checks/sniffer.rb', line 36
def javascript
sniff :javascript
end
|
#open_source? ⇒ Boolean
28
29
30
|
# File 'lib/site-inspector/checks/sniffer.rb', line 28
def open_source?
OPEN_SOURCE_FRAMEWORKS.include?(framework)
end
|
#to_h ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/site-inspector/checks/sniffer.rb', line 44
def to_h
{
framework: framework,
analytics: analytics,
javascript: javascript,
advertising: advertising
}
end
|