lib/invoker/parsers/config.rb in invoker-1.5.1 vs lib/invoker/parsers/config.rb in invoker-1.5.3
- old
+ new
@@ -40,21 +40,22 @@
def tld
power_config && power_config.tld
end
def autorunnable_processes
- processes.reject(&:disable_autorun)
+ process_to_run = processes.reject(&:disable_autorun)
+ process_to_run.sort_by { |process| process.index }
end
def process(label)
processes.detect { |pconfig| pconfig.label == label }
end
private
def autodetect_config_file
- Dir.glob("{invoker.ini,Procfile}").first
+ Dir.glob("{invoker.ini,Procfile.dev,Procfile}").first
end
def invalid_config_file?
@filename.nil?
end
@@ -121,9 +122,23 @@
dir: expand_directory(section["directory"]),
cmd: section["command"]
}
pconfig['port'] = section['port'] if section['port']
pconfig['disable_autorun'] = section['disable_autorun'] if section['disable_autorun']
+ pconfig['index'] = section['index'].to_i if section['index']
+ section_index = pconfig['index'].to_i
+ if section_index
+ pconfig['index'] = section_index
+ else
+ pconfig['index'] = 0
+ end
+
+ sleep_duration = section['sleep'].to_i
+ if sleep_duration > 0
+ pconfig['sleep_duration'] = sleep_duration
+ else
+ pconfig['sleep_duration'] = 1
+ end
OpenStruct.new(pconfig)
end
def supports_subdomain?(section)