Class: Licensed::Commands::Environment

Inherits:
Command
  • Object
show all
Defined in:
lib/licensed/commands/environment.rb

Defined Under Namespace

Classes: AppEnvironment

Instance Attribute Summary

Attributes inherited from Command

#config, #options, #reporter

Instance Method Summary collapse

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from Licensed::Commands::Command

Instance Method Details

#create_reporter(options) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/licensed/commands/environment.rb', line 38

def create_reporter(options)
  case options[:format]
  when "json"
    Licensed::Reporters::JsonReporter.new
  else
    Licensed::Reporters::YamlReporter.new
  end
end

#run(**options) ⇒ Object



31
32
33
34
35
36
# File 'lib/licensed/commands/environment.rb', line 31

def run(**options)
  super do |report|
    report["root"] = config.root
    report["git_repo"] = Licensed::Git.git_repo?
  end
end