Permalink
Browse files

Use Thor::Shell::Basic on Windows.

  • Loading branch information...
josevalim committed Oct 16, 2009
1 parent 7107e04 commit 439097e92f1aafe7d009b3dbae281362ce307973
Showing with 8 additions and 3 deletions.
  1. +1 −1 lib/thor/runner.rb
  2. +7 −2 lib/thor/shell.rb
View
@@ -215,7 +215,7 @@ def initialize_thorfiles(relevant_to=nil, skip_lookup=false)
# 5. c:\ <-- no Thorfiles found!
#
def thorfiles(relevant_to=nil, skip_lookup=false)
- # Deal with deprecated thor when :namespaces: is available as constants
+ # TODO Remove this dealing with deprecated thor when :namespaces: is available as constants
save_yaml(thor_yaml) if Thor::Util.convert_constants_to_namespaces(thor_yaml)
thorfiles = []
View
@@ -2,10 +2,15 @@
class Thor
module Base
- # Returns the shell used in all Thor classes. Default to color one.
+ # Returns the shell used in all Thor classes. If you are in a Unix platform
+ # it will use a colored log, otherwise it will use a basic one without color.
#
def self.shell
- @shell ||= Thor::Shell::Color
+ @shell ||= if RUBY_PLATFORM =~ /mswin|mingw/
+ Thor::Shell::Basic
+ else
+ Thor::Shell::Color
+ end
end
# Sets the shell used in all Thor classes.

0 comments on commit 439097e

Please sign in to comment.