command_line_reporter 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/examples/capture.rb +32 -0
- data/lib/command_line_reporter.rb +4 -1
- data/lib/version.rb +1 -1
- metadata +4 -3
data/examples/capture.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'command_line_reporter'
|
2
|
+
|
3
|
+
class Example
|
4
|
+
include CommandLineReporter
|
5
|
+
|
6
|
+
def run
|
7
|
+
suppress_output
|
8
|
+
|
9
|
+
table :border => true do
|
10
|
+
row :color => 'red' do
|
11
|
+
column 'MY NAME IS REALLY LONG AND WILL WRAP AND HOPE', :width => 20, :align => 'center', :color => 'blue'
|
12
|
+
column 'ADDRESS', :width => 30, :padding => 5
|
13
|
+
column 'CITY', :width => 15
|
14
|
+
end
|
15
|
+
row :color => 'green', :bold => true do
|
16
|
+
column 'caeser'
|
17
|
+
column '1 Appian Way'
|
18
|
+
column 'Rome'
|
19
|
+
end
|
20
|
+
row do
|
21
|
+
column 'Richard Feynman'
|
22
|
+
column '1 Golden Gate'
|
23
|
+
column 'Quantum Field'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
return capture_output
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# All the content is now in the report variable
|
32
|
+
report = Example.new.run
|
@@ -59,7 +59,10 @@ module CommandLineReporter
|
|
59
59
|
def horizontal_rule(options = {})
|
60
60
|
validate_options(options, :char, :width, :color, :bold)
|
61
61
|
|
62
|
-
|
62
|
+
# Got unicode?
|
63
|
+
use_char = "\u2501" == 'u2501' ? '-' : "\u2501"
|
64
|
+
|
65
|
+
char = options[:char].is_a?(String) ? options[:char] : use_char
|
63
66
|
width = options[:width] || DEFAULTS[:width]
|
64
67
|
|
65
68
|
aligned(char * width, :width => width, :color => options[:color], :bold => options[:bold])
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: command_line_reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.2.
|
5
|
+
version: 3.2.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Wes
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2012-02-
|
14
|
+
date: 2012-02-27 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -44,6 +44,7 @@ extensions: []
|
|
44
44
|
extra_rdoc_files: []
|
45
45
|
|
46
46
|
files:
|
47
|
+
- examples/capture.rb
|
47
48
|
- examples/nested.rb
|
48
49
|
- examples/progress.rb
|
49
50
|
- examples/quiet.rb
|
@@ -82,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
83
|
requirements:
|
83
84
|
- - ">="
|
84
85
|
- !ruby/object:Gem::Version
|
85
|
-
hash: -
|
86
|
+
hash: -637477018686189691
|
86
87
|
segments:
|
87
88
|
- 0
|
88
89
|
version: "0"
|