Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added a railtie, shifted the mime types out

  • Loading branch information...
commit 944c65997295a41f70ce7eba532b3c8d761a95b4 1 parent 8c1870f
@justinfrench authored
View
7 lib/publicious.rb
@@ -1,6 +1,7 @@
-Mime::Type.register "image/jpeg", :jpg
-Mime::Type.register "image/gif", :gif
-Mime::Type.register "image/png", :png
+if defined?(Rails)
+ require 'publicious/railtie'
+ require 'publicious/mime_types'
+end
class Publicious
FILE_METHODS = %w(GET HEAD).freeze
View
3  lib/publicious/mime_types.rb
@@ -0,0 +1,3 @@
+Mime::Type.register "image/jpeg", :jpg
+Mime::Type.register "image/gif", :gif
+Mime::Type.register "image/png", :png
View
3  lib/publicious/railtie.rb
@@ -0,0 +1,3 @@
+class PubliciousRailtie < Rails::Railtie
+ config.app.middelware.insert_before(Rack::Lock, Publicious) if config.respond_to?(:app)
+end
Please sign in to comment.
Something went wrong with that request. Please try again.