85: def refresh
86: caesars_init
87: @@glasses.each { |glass| extend glass }
88:
89: begin
90: current_path = nil
91: @paths.each do |path|
92: current_path = path
93: puts "Loading config from #{path}" if @verbose || Caesars.debug?
94: dsl = File.read path
95:
96: eval dsl, binding, path
97: end
98:
99:
100: postprocess
101:
102: rescue Caesars::Config::ForceRefresh => ex
103: @forced_refreshes += 1
104: if @forced_refreshes > 3
105: STDERR.puts "Too many forced refreshes (#{@forced_refreshes})"
106: exit 9
107: end
108: STDERR.puts ex.message if @verbose || Caesars.debug?
109: refresh
110:
111:
112:
113:
114: rescue ArgumentError, SyntaxError => ex
115: newex = Caesars::SyntaxError.new(current_path)
116: newex.backtrace = ex.backtrace
117: raise newex
118: end
119: end