Permalink
Browse files

Serve public CSS/JS files from the gem rather than the app's public d…

…irectory.
  • Loading branch information...
1 parent d6e85e2 commit d4dd94b311611ff2fc3eaa635b1e9a4c7968101d @jcoglan jcoglan committed Nov 9, 2009
View
@@ -0,0 +1,3 @@
+[submodule "vendor/rack-gem-assets"]
+ path = vendor/rack-gem-assets
+ url = git://github.com/simonmenke/rack-gem-assets.git
View
@@ -13,6 +13,9 @@ lib/helium/logger.rb
lib/helium/trie.rb
lib/helium/web.rb
lib/helium/web_helpers.rb
+lib/helium/public/prettify.css
+lib/helium/public/prettify.js
+lib/helium/public/style.css
lib/helium/views/deploy.erb
lib/helium/views/edit.erb
lib/helium/views/index.erb
@@ -27,9 +30,6 @@ templates/project/test/index.html.erb
templates/web/config.ru
templates/web/deploy.yml
templates/web/custom.js
-templates/web/public/prettify.css
-templates/web/public/prettify.js
-templates/web/public/style.css
test/test_helium.rb
test/deploy.yml
test/index.html
View
@@ -71,8 +71,6 @@ using the <tt>he install</tt> command with the name of the directory to create:
This will give you the following files:
helium-app/
- public/
- style.css etc.
config.ru
custom.js
deploy.yml
View
@@ -12,7 +12,7 @@
module Helium
- VERSION = '0.1.0'
+ VERSION = '0.1.1'
ROOT = File.expand_path(File.dirname(__FILE__))
TEMPLATES = File.join(ROOT, '..', 'templates')
@@ -0,0 +1,14 @@
+/* Pretty printing styles. Used with prettify.js. */
+
+.str{color:#d14}
+.kwd{color:#000;font-weight:bold}
+.com{color:#998;font-style:italic}
+.typ{color:#458}
+.lit{color:#099}
+.pun{color:#666}
+.pln{color:#000}
+.tag{color:#000080}
+.atn{color:#008080}
+.atv{color:#008080}
+.dec{color:#000;font-weight:bold}
+
File renamed without changes.
File renamed without changes.
View
@@ -7,7 +7,7 @@ module Helium
class Web < Sinatra::Base
- ROOT_DIR = File.dirname(__FILE__)
+ ROOT_DIR = File.expand_path(File.dirname(__FILE__))
require File.join(ROOT_DIR, '..', 'helium')
require File.join(ROOT_DIR, 'web_helpers')
@@ -114,6 +114,11 @@ class Web < Sinatra::Base
erb :edit
end
+ ## Catch requests for public files and serve them from the gem
+ get '/*' do
+ send_file(File.join(ROOT_DIR, 'public', env['PATH_INFO']))
+ end
+
end
end
@@ -1,6 +0,0 @@
-/* Defaults */
-.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun{color:#660}.pln{color:#000}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec{color:#606}@media print{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun{color:#440}.pln{color:#000}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}
-
-/* Overrides */
-.str{color:#d14}.kwd{color:#000;font-weight:bold}.com{color:#998;font-style:italic}.typ{color:#458}.lit{color:#099}.pun{color:#666}.pln{color:#000}.tag{color:#000080}.atn{color:#008080}.atv{color:#008080}.dec{color:#000;font-weight:bold}
-

0 comments on commit d4dd94b

Please sign in to comment.