public
Description: Run tasks and shell commands across multiple subdirectories.
Homepage:
Clone URL: git://github.com/maxim/doer.git
Fix small bug with interpolations. Remove unnecessary Proc from sample.
maxim (author)
Mon Dec 22 21:07:00 -0800 2008
commit  398cc1142b19a911b53b428d6ed9d72dddea2fbe
tree    28cdf4b970f9fe5356b485f3530209e51e370241
parent  caaacf3fcd312b5b00072347cbc7c75f07ecd220
0
do
...
5
6
7
8
9
10
11
12
13
14
...
24
25
26
 
 
 
 
 
27
28
29
...
36
37
38
39
 
40
41
42
...
5
6
7
 
 
 
 
8
9
10
...
20
21
22
23
24
25
26
27
28
29
30
...
37
38
39
 
40
41
42
43
0
@@ -5,10 +5,6 @@ load 'dofile'
0
 
0
 class Doer
0
   class << self
0
-    def cd_here(who, cmd)
0
-      "cd #{HERE}/#{who} && #{cmd}"
0
-    end
0
-  
0
     def run(who, what, args)
0
       command = find_cmd(who, what)
0
       templates, replacements = normalize_cmd(who, command)
0
@@ -24,6 +20,11 @@ class Doer
0
       exit
0
     end
0
     
0
+    private
0
+    def cd_here(who, cmd)
0
+      "cd #{HERE}/#{who} && #{cmd}"
0
+    end
0
+    
0
     def normalize_cmd(project, command)
0
       commands = []
0
       replacements = []
0
@@ -36,7 +37,7 @@ class Doer
0
           replacements += ref_replacements
0
           
0
         elsif token.class == Array
0
-          replacements << token
0
+          replacements += token
0
         
0
         elsif token.class == String
0
           commands << token
...
43
44
45
46
47
48
 
49
50
51
...
43
44
45
 
 
 
46
47
48
49
0
@@ -43,9 +43,7 @@ PROJECTS = {
0
       :start    => "thin -s1 -C thin/development_config.yml --rackup thin/config.ru start",
0
       :stop     => "thin -s1 -C thin/development_config.yml --rackup thin/config.ru stop",
0
       :cleanup  => :stop,
0
-      :status   => Proc.new{
0
-        check_running('localhost:8081', 'Apache Server').call
0
-        check_running('localhost:4567', 'Sinatra Service').call
0
+      :status   => [check_running('localhost:8081', 'Apache Server'), check_running('localhost:4567', 'Sinatra Service')]
0
       }
0
     },
0
     :assets => {

Comments