Permalink
Browse files

starting to implement macro plugin for views

  • Loading branch information...
1 parent 585a876 commit 40144b4fd6afe6609ac5f7bb51539cf6f94ed1fe narkisr committed with quirkey Jan 29, 2011
Showing with 36 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +16 −0 lib/soca/plugins/macro.rb
  3. +16 −0 test/test_plugins.rb
  4. +2 −1 test/testapp/db/views/recent/map.js
  5. +1 −0 test/testapp/hooks/before_push.rb
View
@@ -12,6 +12,7 @@ tmtags
## VIM
*.swp
+*.swo
## PROJECT::GENERAL
coverage
View
@@ -0,0 +1,16 @@
+
+# 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
+ class Macro < Soca::Plugin
+
+ name 'macro'
+
+ def run(options = {})
+ @pusher.document['views'].each do |view,code|
+ puts code
+ end
+ end
+ end
+ end
+end
View
@@ -0,0 +1,16 @@
+require 'helper'
+
+class TestSocaPusher < Test::Unit::TestCase
+
+ context "macro plugin" do
+ setup do
+ @push = Soca::Pusher.new(@test_app_dir)
+ end
+
+ should "sanity" do
+ @push.push!
+ end
+
+
+ end
+end
@@ -1,5 +1,6 @@
function(doc) {
+ // !code js/vendor/sammy-0.5.4.js
if (doc.created_at) {
emit(doc.created_at, doc);
}
-}
+}
@@ -0,0 +1 @@
+plugin 'macro'

0 comments on commit 40144b4

Please sign in to comment.