Class: Npmdc::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/npmdc/config.rb

Constant Summary collapse

DEPEPENDENCY_TYPES =
%w(dependencies devDependencies).freeze
ENVIRONMENTS =
%w(development).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



9
10
11
12
13
14
15
# File 'lib/npmdc/config.rb', line 9

def initialize
  @color = true
  @format = :short
  @output = STDOUT
  @types = DEPEPENDENCY_TYPES
  @environments = ENVIRONMENTS
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



6
7
8
# File 'lib/npmdc/config.rb', line 6

def color
  @color
end

#environmentsObject

Returns the value of attribute environments.



6
7
8
# File 'lib/npmdc/config.rb', line 6

def environments
  @environments
end

#formatObject

Returns the value of attribute format.



6
7
8
# File 'lib/npmdc/config.rb', line 6

def format
  @format
end

#outputObject

Returns the value of attribute output.



6
7
8
# File 'lib/npmdc/config.rb', line 6

def output
  @output
end

#pathObject



17
18
19
# File 'lib/npmdc/config.rb', line 17

def path
  @path ||= Dir.pwd
end

#typesObject

Returns the value of attribute types.



6
7
8
# File 'lib/npmdc/config.rb', line 6

def types
  @types
end

Instance Method Details

#path?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/npmdc/config.rb', line 21

def path?
  instance_variable_defined?(:@path)
end