class Jigit::JigitfileGenerator
Public Class Methods
new(path = nil)
click to toggle source
# File lib/jigit/core/jigitfile_generator.rb, line 7 def initialize(path = nil) @path = path ? path : ".jigit" @jigitfile_hash = {} end
Public Instance Methods
save()
click to toggle source
# File lib/jigit/core/jigitfile_generator.rb, line 27 def save FileUtils.mkdir_p(@path) File.open("#{@path}/Jigitfile.yml", "w") do |file| file.write(@jigitfile_hash.to_yaml) end end
write_in_progress_status_name(name)
click to toggle source
# File lib/jigit/core/jigitfile_generator.rb, line 17 def write_in_progress_status_name(name) raise "In progress status name can not be empty" if name.nil? || name.empty? @jigitfile_hash[JigitfileConstants.in_progress_status] = name end
write_jira_host(host)
click to toggle source
# File lib/jigit/core/jigitfile_generator.rb, line 12 def write_jira_host(host) raise "Host can not be empty" if host.nil? || host.empty? @jigitfile_hash[JigitfileConstants.host] = host end
write_other_statuses(other_statuses)
click to toggle source
# File lib/jigit/core/jigitfile_generator.rb, line 22 def write_other_statuses(other_statuses) raise "All statuses must be string" if other_statuses.select { |status| !status.kind_of?(String) }.count > 0 @jigitfile_hash[JigitfileConstants.other_statuses] = other_statuses end