jamescook-pow 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jamescook-pow}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Cook"]
12
- s.date = %q{2009-11-20}
13
- s.description = %q{Ruby 'puts' with shell colors.}
12
+ s.date = %q{2009-11-22}
13
+ s.description = %q{'puts' with shell colors.}
14
14
  s.email = %q{jamecook@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README"
data/lib/pow.rb CHANGED
@@ -53,7 +53,7 @@ module Pow
53
53
  class Puts
54
54
  attr_accessor :writer
55
55
  def initialize(*args)
56
- options = args[0].is_a?(String) ? {:text => args[0]}.merge(args[1] || {}) : (args[0] || {})
56
+ options = args[0].is_a?(Hash) ? args[0] : {:text => args[0].to_s}.merge(args[1] || {})
57
57
  CODES.keys.each do |key|
58
58
  # Color
59
59
  self.class.send(:define_method, key.to_sym) { |*args| Puts.new({:color => key.to_sym, :text => args[0], :misc => args[1]}).out! }
data/rakefile.rb CHANGED
@@ -3,9 +3,9 @@ begin
3
3
  require 'jeweler'
4
4
  Jeweler::Tasks.new do |gemspec|
5
5
  gemspec.name = "jamescook-pow"
6
- gemspec.version = "0.1.2"
6
+ gemspec.version = "0.1.3"
7
7
  gemspec.summary = "puts with colors"
8
- gemspec.description = "Ruby 'puts' with shell colors."
8
+ gemspec.description = "'puts' with shell colors."
9
9
  gemspec.email = "jamecook@gmail.com"
10
10
  gemspec.homepage = "http://github.com/jamescook/pow"
11
11
  gemspec.authors = ["James Cook"]
data/test/pow_test.rb CHANGED
@@ -15,6 +15,12 @@ class PowTest < Test::Unit::TestCase
15
15
  assert_equal "\e[37mTEST\e[0m\n", @writer.gets # White text
16
16
  end
17
17
 
18
+ def test_puts_with_non_string
19
+ @puts.new(:text => 1, :writer => @writer).out!
20
+ @writer.rewind
21
+ assert_equal "\e[37m1\e[0m\n", @writer.gets # White text
22
+ end
23
+
18
24
  def test_puts_with_red
19
25
  @puts.new(:text => "TEST", :color => :red, :writer => @writer).out!
20
26
  @writer.rewind
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jamescook-pow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Cook
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-20 00:00:00 -06:00
12
+ date: 2009-11-22 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: Ruby 'puts' with shell colors.
16
+ description: "'puts' with shell colors."
17
17
  email: jamecook@gmail.com
18
18
  executables: []
19
19