Class: RubyNPM::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



65
66
67
68
69
70
71
72
# File 'lib/ruby_npm.rb', line 65

def initialize
  @binary = 'npm'
  @logger = default_logger
  @options = default_options
  @stdin = nil
  @stdout = $stdout
  @stderr = $stderr
end

Instance Attribute Details

#binaryObject

Returns the value of attribute binary.



53
54
55
# File 'lib/ruby_npm.rb', line 53

def binary
  @binary
end

#loggerObject

Returns the value of attribute logger.



53
54
55
# File 'lib/ruby_npm.rb', line 53

def logger
  @logger
end

#optionsObject

Returns the value of attribute options.



53
54
55
# File 'lib/ruby_npm.rb', line 53

def options
  @options
end

#stderrObject

Returns the value of attribute stderr.



53
54
55
# File 'lib/ruby_npm.rb', line 53

def stderr
  @stderr
end

#stdinObject

Returns the value of attribute stdin.



53
54
55
# File 'lib/ruby_npm.rb', line 53

def stdin
  @stdin
end

#stdoutObject

Returns the value of attribute stdout.



53
54
55
# File 'lib/ruby_npm.rb', line 53

def stdout
  @stdout
end

Instance Method Details

#default_loggerObject



55
56
57
58
59
# File 'lib/ruby_npm.rb', line 55

def default_logger
  logger = Logger.new($stdout)
  logger.level = Logger::INFO
  logger
end

#default_optionsObject



61
62
63
# File 'lib/ruby_npm.rb', line 61

def default_options
  Options::Factory.new(Options::DEFINITIONS)
end