pretty_console_output 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -0
- data/README.md +3 -2
- data/Rakefile +8 -1
- data/lib/pretty_console_output.rb +16 -14
- data/lib/pretty_console_output/version.rb +1 -1
- data/pretty_console_output.gemspec +2 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6caf95c7e7dac49fb88fc28b8eca83b28437d114
|
4
|
+
data.tar.gz: 92e0bf96c504dfa4bfafc8fc43e31b46d986a162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 598e57947a725b5ee1c8e7df93adb36a0bdb707002f50b126106008121bf99a277519836a5b1d0a5dffc4103f79357e09809ec452c17c0b67b1f994b6acd4948
|
7
|
+
data.tar.gz: 528057687cb99acb50b12985eefebe96d5ffeb04d2f87b126cb56faed1c661de4725f21e6df0db18aec75f273d7601f2aa14df710c736a4ef8451a669d820a6a
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -2,6 +2,7 @@ Pretty Console Output ( for Ruby 2 / Rails )
|
|
2
2
|
=================================================
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/pretty_console_output.svg)](https://badge.fury.io/rb/pretty_console_output)
|
5
|
+
[![Build Status](https://travis-ci.org/guanting112/pretty_console_output.svg?branch=master)](https://travis-ci.org/guanting112/pretty_console_output)
|
5
6
|
[![Code Climate](https://codeclimate.com/github/guanting112/pretty_console_output/badges/gpa.svg)](https://codeclimate.com/github/guanting112/pretty_console_output)
|
6
7
|
|
7
8
|
Installation
|
@@ -22,6 +23,8 @@ gem 'pretty_console_output'
|
|
22
23
|
Usage
|
23
24
|
--------
|
24
25
|
|
26
|
+
![usage_output](http://i.imgur.com/NmZh9CR.png)
|
27
|
+
|
25
28
|
```ruby
|
26
29
|
require 'pretty_console_output'
|
27
30
|
|
@@ -40,8 +43,6 @@ console.tag "All Done"
|
|
40
43
|
console.done "OK: " + Time.now.to_s
|
41
44
|
```
|
42
45
|
|
43
|
-
![usage_output](http://i.imgur.com/pgzrEjV.png)
|
44
|
-
|
45
46
|
|
46
47
|
LICENSE
|
47
48
|
--------
|
data/Rakefile
CHANGED
@@ -8,41 +8,43 @@ module PrettyConsoleOutput
|
|
8
8
|
options[:theme] = {} if options[:theme].nil?
|
9
9
|
options[:stdout] = $stdout if options[:stdout].nil?
|
10
10
|
|
11
|
-
@color
|
12
|
-
@theme
|
11
|
+
@color = Color.new(options[:stdout])
|
12
|
+
@theme = Theme.new(options[:theme])
|
13
|
+
@stdout = options[:stdout]
|
13
14
|
end
|
14
15
|
|
15
16
|
def puts(obj)
|
16
|
-
|
17
|
+
@stdout.puts obj
|
17
18
|
end
|
18
19
|
|
19
20
|
def info(obj)
|
20
|
-
|
21
|
-
string = @color.colorize(obj.to_s, @theme.info_color)
|
21
|
+
string = obj.to_s
|
22
22
|
|
23
|
-
puts "#{
|
23
|
+
puts @color.colorize(" ☞ #{string}", @theme.info_color)
|
24
24
|
end
|
25
25
|
|
26
26
|
def log(obj)
|
27
|
-
|
27
|
+
string = obj.to_s
|
28
|
+
|
29
|
+
puts @color.colorize(" #{string}", @theme.log_color)
|
28
30
|
end
|
29
31
|
|
30
32
|
def data(obj)
|
31
|
-
|
33
|
+
string = obj.to_s
|
34
|
+
|
35
|
+
puts @color.colorize(" #{string}".gsub(/\n/, "\n "), @theme.log_color)
|
32
36
|
end
|
33
37
|
|
34
38
|
def error(obj)
|
35
|
-
|
36
|
-
string = @color.colorize(obj.to_s, @theme.error_color)
|
39
|
+
string = obj.to_s
|
37
40
|
|
38
|
-
puts "#{
|
41
|
+
puts @color.colorize(" ✘ #{string}", @theme.error_color)
|
39
42
|
end
|
40
43
|
|
41
44
|
def done(obj)
|
42
|
-
|
43
|
-
string = @color.colorize(obj.to_s, @theme.done_color)
|
45
|
+
string = obj.to_s
|
44
46
|
|
45
|
-
puts "#{
|
47
|
+
puts @color.colorize(" ✓ #{string}", @theme.done_color)
|
46
48
|
end
|
47
49
|
|
48
50
|
def tag(obj)
|
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
|
-
spec.add_development_dependency "bundler", "~> 1.
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
35
35
|
spec.add_development_dependency "rake", "~> 10.0"
|
36
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
36
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_console_output
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guanting Chen
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
41
55
|
description: Pretty Console Output ( for Ruby 2 / Rails )
|
42
56
|
email:
|
43
57
|
- 'cgt886@gmail.com '
|
@@ -46,6 +60,7 @@ extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
62
|
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
49
64
|
- Gemfile
|
50
65
|
- LICENSE.txt
|
51
66
|
- README.md
|