]> git.openstreetmap.org Git - rails.git/blob - lib/daemons/gpx_import_ctl
Merge remote-tracking branch 'upstream/pull/2023'
[rails.git] / lib / daemons / gpx_import_ctl
1 #!/usr/bin/env ruby
2 require "rubygems"
3 require "daemons"
4 require "yaml"
5 require "erb"
6
7 class Hash
8   def with_symbols!
9     each_key { |key| self[key.to_s.to_sym] = self[key] }
10     self
11   end
12 end
13
14 options = YAML.safe_load(
15   ERB.new(
16     IO.read(
17       File.dirname(__FILE__) + "/../../config/daemons.yml"
18     )
19   ).result
20 ).with_symbols!
21 options[:dir_mode] = options[:dir_mode].to_sym
22
23 Daemons.run File.dirname(__FILE__) + "/gpx_import.rb", options