Class: AbideDevUtils::Ppt::ScoreModule

Inherits:
Object
  • Object
show all
Defined in:
lib/abide_dev_utils/ppt/score_module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(module_dir) ⇒ ScoreModule

Returns a new instance of ScoreModule.



13
14
15
16
17
18
# File 'lib/abide_dev_utils/ppt/score_module.rb', line 13

def initialize(module_dir)
  @module_name = module_dir.split(File::SEPARATOR)[-1]
  @module_dir = real_module_dir(module_dir)
  @manifests_dir = File.join(real_module_dir(module_dir), 'manifests')
  @metadata = JSON.parse(File.join(@module_dir, 'metadata.json'))
end

Instance Attribute Details

#manifests_dirObject (readonly)

Returns the value of attribute manifests_dir.



11
12
13
# File 'lib/abide_dev_utils/ppt/score_module.rb', line 11

def manifests_dir
  @manifests_dir
end

#module_dirObject (readonly)

Returns the value of attribute module_dir.



11
12
13
# File 'lib/abide_dev_utils/ppt/score_module.rb', line 11

def module_dir
  @module_dir
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



11
12
13
# File 'lib/abide_dev_utils/ppt/score_module.rb', line 11

def module_name
  @module_name
end

Instance Method Details

#lintObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/abide_dev_utils/ppt/score_module.rb', line 20

def lint
  linter_exit_code, linter_output = lint_manifests
  {
    exit_code: linter_exit_code,
    manifests: manifest_count,
    lines: line_count,
    linter_version: linter_version,
    output: linter_output
  }.to_json
end