Class: Horatio::Detector::NodePackage

Inherits:
Object
  • Object
show all
Includes:
IOHandler, JSONReader, NULLWritter, Validator
Defined in:
lib/horatio/detector/node_package.rb

Instance Attribute Summary

Attributes included from IOHandler

#input, #output

Instance Method Summary collapse

Methods included from NULLWritter

#increment

Methods included from JSONReader

#name, #version

Methods included from IOHandler

#default_output, #detect, included, #initialize, #memo_read

Methods included from Validator

#validate, #validate_name, #validate_version

Instance Method Details

#default_inputObject



15
16
17
# File 'lib/horatio/detector/node_package.rb', line 15

def default_input
  'package.json'
end

#descriptionObject



25
26
27
# File 'lib/horatio/detector/node_package.rb', line 25

def description
  'Node.js package.json'
end

#infoObject



19
20
21
22
23
# File 'lib/horatio/detector/node_package.rb', line 19

def info
  memo_read do
    File.open(input, 'r') { |f| JSON.parse(f.read) }
  end
end