Permalink
Browse files

Whitespace

  • Loading branch information...
1 parent 5af61b1 commit 92d73ca3f7c732417acd29658357179d00baf41d @quirkey quirkey committed Feb 9, 2011
@@ -22,19 +22,19 @@ def run(options = {})
:config => pusher.config
}.merge(options[:vars] || {})
Soca.logger.debug "CoffeeScript vars: #{vars.inspect}"
-
+
files.each do |file|
Soca.logger.debug "Running #{file} through CoffeeScript."
basename = File.basename(file)
dir = File.dirname(file)
parts = basename.split(/\./)
new_file = (parts.length > 2 ? parts[0..-2].join('.') : parts[0]) + ".js"
-
+
File.open(File.join(dir, new_file), 'w') do |f|
f << ::CoffeeScript.compile(File.read(file), vars)
end
Soca.logger.debug "Wrote to #{new_file}"
-
+
end
end
@@ -1,4 +1,3 @@
-
# see http://tinyurl.com/6ab5svl views in coucdb < 1.1.x does not allow require of modules therfor we need to use macors
module Soca
module Plugins
@@ -8,19 +7,19 @@ class Macro < Soca::Plugin
def run(options = {})
@pusher.document['views'].each do |view,code|
- ['map','reduce'].each{|part| macro_expand_on(part,code) if code[part]}
+ ['map','reduce'].each{|part| macro_expand_on(part,code) if code[part]}
end
end
def macro_expand_on(part,code)
code[part] = code[part].split("\n").inject(" ") do |res,line|
- if line =~ /\/\/ !code (.*)/
+ if line =~ /\/\/ !code (.*)/
res += "\n#{File.read($1)}\n"
else
res += "#{line}\n"
end
end
- end
+ end
end
end
end
@@ -1,5 +1,5 @@
/**
- * this file contains the json representation for rewrite rules
+ * this file contains the json representation for rewrite rules
**/
[
{ // rewriting / to index.html
@@ -12,4 +12,4 @@
"from":"/*",
"to":"/*"
}
-]
+]
@@ -50,7 +50,7 @@ class TestSocaPusher < Test::Unit::TestCase
assert_match(/function/, @app_file['views']['recent']['map'])
assert @app_file['_attachments']['css/app.css']
end
-
+
should "include rewrites.js as json" do
assert @app_file['rewrites']
assert @app_file['rewrites'][0]['from']
@@ -1,3 +1,3 @@
body {
font-family: Arial;
-}
+}
@@ -8,4 +8,4 @@
<h1>Test App</h1>
<script src="js/bundled.js" type="text/javascript" charset="utf-8"></script>
</body>
-</html>
+</html>
@@ -1,5 +1,5 @@
(function($) {
-
+
// closure
-
-})(jQuery);
+
+})(jQuery);
Oops, something went wrong. Retry.

0 comments on commit 92d73ca

Please sign in to comment.