class Jigit::Jigitfile

Attributes

host[RW]

@return [String] JIRA server host

in_progress_status[RW]

@return [String] The status which represens In Progress state

other_statuses[RW]

@return [Array] The other possible statuses

Public Class Methods

new(path) click to toggle source
# File lib/jigit/core/jigitfile.rb, line 13
def initialize(path)
  raise "Path is a required parameter" if path.nil?
  raise "Couldn't find Jigitfile file at '#{path}'" unless File.exist?(path)
  jigitfile = File.read(path)
  yaml_hash = read_data_from_yaml_file(jigitfile, path)
  self.in_progress_status = yaml_hash[JigitfileConstants.in_progress_status]
  self.other_statuses = yaml_hash[JigitfileConstants.other_statuses]
  self.host = yaml_hash[JigitfileConstants.host]
end

Private Instance Methods

read_data_from_yaml_file(yaml_file, path) click to toggle source
# File lib/jigit/core/jigitfile.rb, line 25
def read_data_from_yaml_file(yaml_file, path)
  YAML.load(yaml_file)
rescue Psych::SyntaxError
  raise "File at '#{path}' doesn't have a legit YAML syntax"
end