lib/siteleaf/server.rb in siteleaf-0.8.1 vs lib/siteleaf/server.rb in siteleaf-0.8.3

- old
+ new

@@ -1,7 +1,8 @@ module Siteleaf class Server + attr_accessor :site_id def initialize(attributes = {}) self.site_id = attributes[:site_id] end @@ -23,11 +24,11 @@ end end templates.push("default.html") templates.each do |t| - return File.read(t) if File.exists?(t) + return File.read(t) if File.exist?(t) end return nil end @@ -35,10 +36,10 @@ site = Siteleaf::Site.new({:id => self.site_id}) url = env['PATH_INFO'] path = url.gsub(/\/\z|\A\//, '') #strip beginning and trailing slashes - if !File.directory?(path) and File.exists?(path) + if !File.directory?(path) and File.exist?(path) Rack::File.new(Dir.pwd).call(env) else template_data = nil is_asset = /(^assets|\.)/.match(path) \ No newline at end of file