Permalink
Browse files

Revert "Instantiate shell classes by default, so behavior is unified …

…(instance is used in tests, while class was the default shell)"

This reverts commit 0df8839.
  • Loading branch information...
1 parent 0df8839 commit d7fe6e148a5d1ad21605010e4c6ef2fa3fdaf15d @josevalim josevalim committed Oct 27, 2010
Showing with 4 additions and 5 deletions.
  1. +3 −4 lib/thor/shell.rb
  2. +1 −1 spec/shell_spec.rb
View
7 lib/thor/shell.rb
@@ -7,12 +7,11 @@ module Base
#
def self.shell
@shell ||= if ENV['THOR_SHELL'] && ENV['THOR_SHELL'].size > 0
- shell = Thor::Shell.const_get(ENV['THOR_SHELL'])
- shell.is_a?(Class) ? shell.new : shell
+ Thor::Shell.const_get(ENV['THOR_SHELL'])
elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
- Thor::Shell::Basic.new
+ Thor::Shell::Basic
else
- Thor::Shell::Color.new
+ Thor::Shell::Color
end
end
View
2 spec/shell_spec.rb
@@ -28,7 +28,7 @@ class Thor::Shell::TestShell < Thor::Shell::Basic; end
Thor::Base.shell.must == shell.class
ENV['THOR_SHELL'] = 'TestShell'
Thor::Base.shell = nil
- Thor::Base.shell.class.must == Thor::Shell::TestShell
+ Thor::Base.shell.must == Thor::Shell::TestShell
ENV['THOR_SHELL'] = ''
Thor::Base.shell = shell.class
Thor::Base.shell.must == shell.class

0 comments on commit d7fe6e1

Please sign in to comment.