termichunk 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/lib/termichunk/report.rb +9 -0
- data/lib/termichunk/version.rb +1 -1
- data/termichunk.gemspec +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47c94a272fd0424effa802c0c4fae6e86c21d0ee
|
4
|
+
data.tar.gz: 4c6dbcd6deb94d9cce9def3308d250150be3ad92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13a3f1aa0487eb528d026d0a15ea24c01c28a35c182a5184703b88205a45395a8044d3603d23de6bba5ae07d6974972d1b04cb713f2b3c153bec79957151b6ba
|
7
|
+
data.tar.gz: c438a0ec2be02cc3d2f395edd37d16c2b13c3aa461eb9d84c779896fa61cb19e3b3da4a65e838c883f5ed3fa83c80175301c06ac1ff5e9f602d985e606c4fd02
|
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--protected lib/**/*.rb
|
data/lib/termichunk/report.rb
CHANGED
@@ -8,6 +8,11 @@ module TermiChunk
|
|
8
8
|
|
9
9
|
attr_reader :title, :padding, :rows
|
10
10
|
|
11
|
+
# Create a new report.
|
12
|
+
# @param title [String] the title to frame the report with
|
13
|
+
# @param padding [Integer] the amount of padding to put around the text within the report
|
14
|
+
# @yield [self] if a block is provided, the new report will be yielded to it
|
15
|
+
# @return [Report]
|
11
16
|
def initialize(title:, padding: nil)
|
12
17
|
@title = title
|
13
18
|
@padding = padding || 0
|
@@ -15,6 +20,8 @@ module TermiChunk
|
|
15
20
|
yield self if block_given?
|
16
21
|
end
|
17
22
|
|
23
|
+
# Add a new entry to the report
|
24
|
+
# @param item [String, Report] the entry to add (a single-line string, a multi-line string, a sub-report)
|
18
25
|
def <<(item)
|
19
26
|
lines = item.to_s.lines
|
20
27
|
if item.is_a?(self.class) && padding.nonzero?
|
@@ -24,6 +31,8 @@ module TermiChunk
|
|
24
31
|
lines.each { |l| rows << l }
|
25
32
|
end
|
26
33
|
|
34
|
+
# Retrieve a string-representation of the report.
|
35
|
+
# @return [String]
|
27
36
|
def to_s
|
28
37
|
y = padding.times.map { Y }
|
29
38
|
[titlebar(TL), *y, body, *y, titlebar(BL)].compact.join("\n")
|
data/lib/termichunk/version.rb
CHANGED
data/termichunk.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: termichunk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin McDonald
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Organize chunks of text within terminals
|
98
112
|
email:
|
99
113
|
- kevinstuffandthings@gmail.com
|
@@ -107,6 +121,7 @@ files:
|
|
107
121
|
- ".gitignore"
|
108
122
|
- ".rspec"
|
109
123
|
- ".travis.yml"
|
124
|
+
- ".yardopts"
|
110
125
|
- CODE_OF_CONDUCT.md
|
111
126
|
- Gemfile
|
112
127
|
- LICENSE.txt
|