Class: AmusingGit::Config

Inherits:
Object
  • Object
show all
Includes:
PrettyPrinter
Defined in:
lib/amusing_git/config/config.rb

Instance Method Summary collapse

Methods included from PrettyPrinter

#colorize, #green, #print_error, #print_info, #print_success, #red, #yellow

Constructor Details

#initializeConfig

Returns a new instance of Config.



8
9
10
# File 'lib/amusing_git/config/config.rb', line 8

def initialize
  @config = read_config
end

Instance Method Details

#hooksObject



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

def hooks
  @config["hooks"] || []
end

#messagesObject



12
13
14
15
16
17
18
19
# File 'lib/amusing_git/config/config.rb', line 12

def messages
  messages_file = @config["messages"]
  if messages_file.nil?
    print_error("AmusingGit: messages file not found...\n")
    return []
  end
  File.read(messages_file).split("\n")
end