lib/god.rb in god-0.7.13 vs lib/god.rb in god-0.7.14
- old
+ new
@@ -146,12 +146,10 @@
end
end
end
module God
- VERSION = '0.7.13'
-
LOG_BUFFER_SIZE_DEFAULT = 100
PID_FILE_DIRECTORY_DEFAULTS = ['/var/run/god', '~/.god/pids']
DRB_PORT_DEFAULT = 17165
DRB_ALLOW_DEFAULT = ['127.0.0.1']
LOG_LEVEL_DEFAULT = :info
@@ -624,10 +622,15 @@
end
self.main.join
end
+ def self.version
+ yml = YAML.load(File.read(File.join(File.dirname(__FILE__), *%w[.. VERSION.yml])))
+ "#{yml[:major]}.#{yml[:minor]}.#{yml[:patch]}"
+ end
+
# To be called on program exit to start god
#
# Returns nothing
def self.at_exit
self.start
@@ -652,10 +655,10 @@
def self.pattern_match(pattern, list)
regex = pattern.split('').join('.*')
list.select do |item|
item =~ Regexp.new(regex)
- end
+ end.sort_by { |x| x.size }
end
end
# Runs immediately before the program exits. If $run is true,
# start god, if $run is false, exit normally.