lib/plezi/handlers/http_router.rb in plezi-0.10.8 vs lib/plezi/handlers/http_router.rb in plezi-0.10.9
- old
+ new
@@ -36,11 +36,11 @@
@hosts = {}
@active_host = nil
@sass_cache = Sass::CacheStores::Memory.new if defined?(::Sass)
end
- # adds a host to the router (or activates an existing host to add new routes). accepts a host name and any parameters not related to the service (see `Plezi.add_service`)
+ # adds a host to the router (or activates an existing host to add new routes). accepts a host name and any parameters not related to the actual connection (ssl etc') (see {Plezi.listen})
def add_host host_name, params = {}
host_name = (host_name ? host_name.to_s.downcase : :default)
@active_host = get_host(host_name) || ( @hosts[host_name] = Host.new(params) )
add_alias host_name, *params[:alias] if params[:alias]
@active_host
@@ -140,10 +140,10 @@
return false unless Plezi.file_exists?(coffee)
# review mtime and render coffee if necessary
if defined?(::CoffeeScript) && Plezi.cache_needs_update?(coffee)
# render coffee to cache
Plezi.cache_data coffee, nil
- Plezi.save_file target_file, CoffeeScript.compile(IO.read coffee), params[:save_assets]
+ Plezi.save_file target_file, CoffeeScript.compile(IO.binread coffee), params[:save_assets]
end
# try to send the cached js file which started the request.
return Base::HTTPSender.send_file request, response, target_file
end
false