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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ad131750d4441fca0c07991e20172f31c4e8913
4
- data.tar.gz: a8483fbdd3bb0ac4e1b4d1ee82831b012cf7ae6c
3
+ metadata.gz: 47c94a272fd0424effa802c0c4fae6e86c21d0ee
4
+ data.tar.gz: 4c6dbcd6deb94d9cce9def3308d250150be3ad92
5
5
  SHA512:
6
- metadata.gz: 9b169c877a4180c690d16dc661d710cf8362b4abecbbb9db47da9ccd4c24d83c64ddae769e97435e07f1811865b11ce5055bfe6d9bbfe36dc3e1cae71115b3bb
7
- data.tar.gz: 59b24ace38179967425d6e0415b3741b102f342bcea9ed4f54315e3d4e7b515c974348293f145f69bd7b8607f6da1e5b746f8d90afc5f239db8b8f2b382f2513
6
+ metadata.gz: 13a3f1aa0487eb528d026d0a15ea24c01c28a35c182a5184703b88205a45395a8044d3603d23de6bba5ae07d6974972d1b04cb713f2b3c153bec79957151b6ba
7
+ data.tar.gz: c438a0ec2be02cc3d2f395edd37d16c2b13c3aa461eb9d84c779896fa61cb19e3b3da4a65e838c883f5ed3fa83c80175301c06ac1ff5e9f602d985e606c4fd02
@@ -0,0 +1 @@
1
+ --protected lib/**/*.rb
@@ -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")
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module TermiChunk
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "rack-test"
26
26
  spec.add_development_dependency "rake"
27
27
  spec.add_development_dependency "rspec"
28
+ spec.add_development_dependency "yard"
28
29
  end
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.1
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