epitron-colorize 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +3 -1
  2. data/lib/colorize.rb +1 -1
  3. metadata +3 -2
@@ -10,6 +10,8 @@ http://github.com/epitron
10
10
 
11
11
  Ruby String class extension. It adds some methods to set color, background color and text effect on console easier. It works by inserting ANSI escape sequences into your strings.
12
12
 
13
+ Colorize also makes sure that if your program is being redirected to a file, or piped to another program, it doesn't try to colorize your text. You can rest easy, knowing that colorize is on the job.
14
+
13
15
  == SYNOPSIS:
14
16
 
15
17
  === Colorizing an entire string:
@@ -30,7 +32,7 @@ Ruby String class extension. It adds some methods to set color, background color
30
32
  puts "<blue>This is blue <red>followed by red.</red></blue>".colorize
31
33
  puts "<10>This is light green <14>with light yellow</14> in the middle.</10>".colorize
32
34
 
33
- Note: Closing the tags is optional; this also works:
35
+ Note: If you're lazy, you don't really have to close the tags. This also works:
34
36
 
35
37
  puts "<green>hi <blue>there <yellow>everyone!".colorize
36
38
 
@@ -75,6 +75,7 @@ class String
75
75
  #
76
76
  def colorize( params=nil )
77
77
 
78
+ return self.tagged_colors unless params
78
79
  return self unless STDOUT.isatty
79
80
 
80
81
  begin
@@ -83,7 +84,6 @@ class String
83
84
  raise 'You must gem install win32console to use color on Windows'
84
85
  end
85
86
 
86
- return self.tagged_colors unless params
87
87
 
88
88
  color_parameters = {}
89
89
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epitron-colorize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - fazibear
@@ -28,6 +28,7 @@ files:
28
28
  - README.rdoc
29
29
  has_rdoc: false
30
30
  homepage: http://github.com/epitron/colorize
31
+ licenses:
31
32
  post_install_message:
32
33
  rdoc_options:
33
34
  - --charset=UTF-8
@@ -48,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
49
  requirements: []
49
50
 
50
51
  rubyforge_project:
51
- rubygems_version: 1.2.0
52
+ rubygems_version: 1.3.5
52
53
  signing_key:
53
54
  specification_version: 3
54
55
  summary: Colorize your console output (via extensions to the String class).