class TrelloConfig
Attributes
board_name[RW]
comment_style[RW]
default_list[RW]
excludes[RW]
file_types[RW]
project_name[RW]
todo_types[RW]
Public Class Methods
new(directory = Dir.pwd.to_s)
click to toggle source
# File lib/totrello/trello_config.rb, line 8 def initialize(directory = Dir.pwd.to_s) load_config("#{directory}/.totrello.yml") default_config(directory) end
Public Instance Methods
default_config(directory = Dir.pwd.to_s)
click to toggle source
# File lib/totrello/trello_config.rb, line 13 def default_config(directory = Dir.pwd.to_s) @project_name ||= directory.split('/').last @board_name ||= directory.split('/').last @default_list ||= 'To Do' @excludes ||= Array(nil) @todo_types ||= Array(['TODO', '#TODO', '#TODO:', 'TODO:']) @file_types ||= Array(['.rb', '.erb']) @comment_style ||= Array(['#']) end
load_config(config_file)
click to toggle source
# File lib/totrello/trello_config.rb, line 23 def load_config(config_file) return if config_file == '' config_yaml = YAML.load_file(config_file) config_yaml['totrello'].each do |key, value| instance_variable_set("@#{key}", value) end end