lib/rack-fontserve.rb in rack-fontserve-0.1.2 vs lib/rack-fontserve.rb in rack-fontserve-0.1.3
- old
+ new
@@ -14,10 +14,11 @@
'svg' => 'image/svg+xml',
'css' => 'text/css;charset=utf-8'}
set :max_age, 365 * 24 * 60 * 60
set :views, ::File.join(::File.dirname(__FILE__), 'rack-fontserve/views')
+ set :demo, true
not_found do
[404, '']
end
@@ -43,10 +44,11 @@
def format?(f)
@font.formats.include?(f.to_s)
end
end
- get '/demo' do
+ get '/' do
+ not_found unless Rack::Fontserve.demo
erb :demo
end
# Render the generated or custom css for given font with caching
get '/:font_name.css' do