Class: Fizzy::ProjectConfig

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

Constant Summary collapse

FILENAME =
".fizzy.yml"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_dir = Dir.pwd) ⇒ ProjectConfig

Returns a new instance of ProjectConfig.



9
10
11
12
13
14
15
# File 'lib/fizzy/project_config.rb', line 9

def initialize(start_dir = Dir.pwd)
  @path = find_config(start_dir)
  data = @path ? YAML.safe_load_file(@path) : {}
  @data = data.is_a?(Hash) ? data : {}
rescue Psych::SyntaxError => e
  raise Thor::Error, "Bad .fizzy.yml at #{@path}: #{e.message}"
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/fizzy/project_config.rb', line 7

def path
  @path
end

Instance Method Details

#accountObject



19
# File 'lib/fizzy/project_config.rb', line 19

def  = @data["account"]

#boardObject



21
# File 'lib/fizzy/project_config.rb', line 21

def board = @data["board"]

#boardsObject



25
# File 'lib/fizzy/project_config.rb', line 25

def boards = @data["boards"] || {}

#found?Boolean

Returns:

  • (Boolean)


17
# File 'lib/fizzy/project_config.rb', line 17

def found? = !@path.nil?

#urlObject



23
# File 'lib/fizzy/project_config.rb', line 23

def url = @data["url"]