Skip to content
Browse files

Merge branch 'inline_assets' of git@github.com:plus2/whereuat into in…

…line_assets
  • Loading branch information...
2 parents 3934148 + a167b39 commit cc294f066ee065583ef6bb28344a56149288e7b9 benvolio committed Aug 14, 2010
Showing with 31 additions and 11 deletions.
  1. +15 −0 Rakefile
  2. +6 −6 dev/stylesheets/whereuat.css.mustache
  3. +10 −5 lib/whereuat/assets/context.rb
View
15 Rakefile
@@ -64,3 +64,18 @@ else
abort "Please run rake dev as 'rake dev'"
end
end
+
+task :bundled_env do
+ require 'rubygems'
+ require 'bundler'
+ Bundler.setup
+
+ $LOAD_PATH << File.expand_path('../lib',__FILE__)
+ require 'whereuat'
+end
+
+namespace :assets do
+ task :rebuild => :bundled_env do
+ Whereuat::Assets.rebuild!
+ end
+end
View
12 dev/stylesheets/whereuat.css.mustache
@@ -31,7 +31,7 @@
height: 125px;
font-size: 0.001em;
text-indent: -2000em;
- background: #212121 url({{bg_url}}) no-repeat -4px -10px;
+ background: #212121 url({{bg_uri}}) no-repeat -4px -10px;
-moz-border-radius-bottomright: 10px;
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-topright: 10px;
@@ -100,7 +100,7 @@
display:block;
width: 25px;
height: 28px;
- background: url({{bg_url}}) no-repeat -9px -204px;
+ background: url({{bg_uri}}) no-repeat -9px -204px;
font-size: 0.001em;
text-indent: -20000em;
}
@@ -116,7 +116,7 @@
display:block;
width: 25px;
height: 30px;
- background: url({{bg_url}}) no-repeat -9px -136px;
+ background: url({{bg_uri}}) no-repeat -9px -136px;
font-size: 0.001em;
text-indent: -20000em;
}
@@ -132,7 +132,7 @@
display:block;
width: 25px;
height: 30px;
- background: url({{bg_url}}) no-repeat -9px -301px;
+ background: url({{bg_uri}}) no-repeat -9px -301px;
font-size: 0.001em;
text-indent: -20000em;
}
@@ -148,7 +148,7 @@
display:block;
width: 60px;
height: 25px;
- background: url({{bg_url}}) no-repeat -1px -275px;
+ background: url({{bg_uri}}) no-repeat -1px -275px;
font-size: 0.001em;
text-indent: -20000em;
border:none;
@@ -163,5 +163,5 @@
left: 13px;
top: 54px;
- background: url({{spinner_url}}) no-repeat;
+ background: url({{spinner_uri}}) no-repeat;
}
View
15 lib/whereuat/assets/context.rb
@@ -1,14 +1,19 @@
module Whereuat
module Assets
class Context
- def bg_url
- Image.new(images_root+'uat-bg.png')
- end
- def spinner_url
- Image.new(images_root+'spinner.gif')
+ # bg becomes bg_uri. bg_uri yields a data uri of the image.
+ ImageMap = {
+ :bg => 'uat-bg.png',
+ :spinner => 'spinner.gif'
+ }
+
+ ImageMap.each do |k,v|
+ define_method("#{k}_uri") { Image.new( images_root + v ) }
end
+ protected
+
def images_root
@images_root ||= Whereuat.dev_root+'images'
end

0 comments on commit cc294f0

Please sign in to comment.
Something went wrong with that request. Please try again.