public
Description: Ruby on Rails plugin to provide notification when you need to run migrations
Homepage: http://blog.hasmanythrough.com/2008/3/2/migration-concordance
Clone URL: git://github.com/joshsusser/migration_concordance.git
silence colors in TextMate output
joshsusser (author)
Sat Apr 05 11:23:05 -0700 2008
commit  8ae4eb7e7cdadab3112e411969d2821cf2befc24
tree    3f9730f16290a5f8a7a973b09d007af099df03bd
parent  d84d85439b2fc43960c7dd757dd5d89c113ce7fa
...
2
3
4
5
 
6
7
 
8
9
10
11
12
13
 
 
 
 
14
15
16
17
 
 
 
18
19
20
...
24
25
26
27
 
28
29
 
30
31
32
33
34
 
35
36
 
37
38
39
...
2
3
4
 
5
6
 
7
8
9
 
 
 
 
10
11
12
13
14
 
 
 
15
16
17
18
19
20
...
24
25
26
 
27
28
 
29
30
31
32
33
 
34
35
 
36
37
38
39
0
@@ -2,19 +2,19 @@ require 'digest/md5'
0
 
0
 begin
0
   require 'redgreen'
0
- use_color = true
0
+ mc_use_color = true
0
 rescue LoadError
0
- use_color = false
0
+ mc_use_color = false
0
 end
0
 
0
-if use_color
0
- def red(str); Color.red(str); end
0
- def green(str); Color.green(str); end
0
- def yellow(str); Color.yellow(str); end
0
+if mc_use_color && !ENV['TM_MODE']
0
+ def mc_red(str); Color.red(str); end
0
+ def mc_green(str); Color.green(str); end
0
+ def mc_yellow(str); Color.yellow(str); end
0
 else
0
- def red(str); str; end
0
- def green(str); str; end
0
- def yellow(str); str; end
0
+ def mc_red(str); str; end
0
+ def mc_green(str); str; end
0
+ def mc_yellow(str); str; end
0
 end
0
 
0
 module ActiveRecord
0
@@ -24,16 +24,16 @@ module ActiveRecord
0
       def check_concordance
0
         case differs = self.current_differs_from_snapshot(File.join(RAILS_ROOT,'db','migrate'))
0
         when false
0
- green("***** DB schema is in sync with migrations.")
0
+ mc_green("***** DB schema is in sync with migrations.")
0
         when 0
0
- yellow("***** DB schema state unknown. No migration snapshot to compare.")
0
+ mc_yellow("***** DB schema state unknown. No migration snapshot to compare.")
0
         else
0
           changed = differs.split("_").first.to_i
0
           current = current_version rescue 0
0
           if changed < current
0
- red("***** DB schema needs to be re-migrated from: #{differs}")
0
+ mc_red("***** DB schema needs to be re-migrated from: #{differs}")
0
           else
0
- red("***** DB schema has new migrations - run 'rake db:migrate'")
0
+ mc_red("***** DB schema has new migrations - run 'rake db:migrate'")
0
           end
0
         end
0
       end

Comments

    No one has commented yet.