Class: Nib::History::Config

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

Constant Summary collapse

PATH =
'/tmp/nib/config'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, history_command) ⇒ Config

Returns a new instance of Config.



8
9
10
11
12
13
14
# File 'lib/nib/history/config.rb', line 8

def initialize(type, history_command)
  @type = type
  @history_command = history_command
  @host_path = "#{ENV['HOME']}/.#{type}"

  FileUtils.mkdir_p PATH
end

Instance Attribute Details

#history_commandObject (readonly)

Returns the value of attribute history_command.



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

def history_command
  @history_command
end

#host_pathObject (readonly)

Returns the value of attribute host_path.



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

def host_path
  @host_path
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#container_pathObject



16
17
18
# File 'lib/nib/history/config.rb', line 16

def container_path
  config_file.path
end