Class: Nit::Config

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/nit/config.rb

Overview

we have to derive from Group to get the create_file working - that’s messy.

Defined Under Namespace

Classes: File

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



43
44
45
46
# File 'lib/nit/config.rb', line 43

def initialize
  super
  @file = File.new(filename, self) # FIXME: remove the Thor::App dependency, see above!
end

Instance Method Details

#ignored_filesObject



48
49
50
# File 'lib/nit/config.rb', line 48

def ignored_files
  file.read("ignored_files") or []
end

#ignored_files=(files) ⇒ Object



52
53
54
# File 'lib/nit/config.rb', line 52

def ignored_files=(files)
  file.write("ignored_files", files.collect(&:to_s))
end

#index_rendererObject



65
66
67
68
# File 'lib/nit/config.rb', line 65

def index_renderer
  const = file.read("index_renderer") || "AppendIndexRenderer"
  Nit::Command::Status.const_get(const)
end

#index_renderer=(value) ⇒ Object



70
71
72
# File 'lib/nit/config.rb', line 70

def index_renderer=(value)
  file.write("index_renderer", value)
end

#indexerObject



56
57
58
59
# File 'lib/nit/config.rb', line 56

def indexer
  const = file.read("indexer") || "CharIndexer"
  Nit::Files.const_get(const)
end

#indexer=(value) ⇒ Object



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

def indexer=(value)
  file.write("indexer", value)
end