lib/cronicle/exporter.rb in cronicle-0.1.4 vs lib/cronicle/exporter.rb in cronicle-0.1.5
- old
+ new
@@ -30,15 +30,15 @@
crontabs_by_host
end
def parse_crontab(crontab, libexec_contents)
scripts = {}
- libexec_dir = @options.fetch(:libexec)
+ libexec_dir = @options.fetch(:var_dir) + '/libexec'
crontab.each_line.map(&:strip).each do |line|
next if line =~ /\A#/
- md = line.match(/\A(@\w+|\S+(?:\s+\S+){4})\s+(.\S+)(.*)\z/)
+ md = line.match(/\A(@\w+|\S+(?:\s+\S+){4})\s+(?:cd\s+\S+\s+&&\s+\S*bundle\s+exec\s+)?(.\S+)(.*)\z/)
schedule, path, extra = md.captures if md
if %r|\A#{Regexp.escape(libexec_dir)}/(?:[^/]+)/(.+)| =~ path
name = $1