Skip to content

Commit c18e8d4

Browse files
committed
Disables color support on windows env where ruby < 2.0
I've gotten a report that color support on windows && ruby 2.0 just works. So let's try and only disable it in window && ruby 1.9 refs: zmoazeni#48, zmoazeni#44
1 parent d5ba00f commit c18e8d4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## (Unreleased)
22

33
* 0 and 0px are now reconciled as redundancies
4+
* Disables color support by default for windows & ruby < 2.0
45

56
## 1.1.0 - 4/12/2013 ##
67

lib/csscss/cli.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class CLI
33
def initialize(argv)
44
@argv = argv
55
@verbose = false
6-
@color = true
6+
@color = !windows_1_9
77
@minimum = 3
88
@compass = false
99
@ignored_properties = []
@@ -80,7 +80,7 @@ def parse(argv)
8080
@verbose = v
8181
end
8282

83-
opts.on("--[no-]color", "Colorize output (default is true)") do |c|
83+
opts.on("--[no-]color", "Colorize output (default is #{@color})") do |c|
8484
@color = c
8585
end
8686

@@ -155,6 +155,10 @@ def enable_compass(config = nil)
155155
abort "Must install compass gem before enabling its extensions"
156156
end
157157

158+
def windows_1_9
159+
RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ && RUBY_VERSION =~ /^1\.9/
160+
end
161+
158162
class << self
159163
def run(argv)
160164
new(argv).run

0 commit comments

Comments
 (0)