bogo-ui 0.1.12 → 0.1.14

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: 650bc3c8c61d5901787e8737885fb7f57c5ded35
4
- data.tar.gz: f1791163b58d402d0356307f160bdbb61bc63e54
3
+ metadata.gz: db4ba17136b179669ba0ac07bff07cf569667b51
4
+ data.tar.gz: 7d2fd7a60434c398272357ba16847e5e4e3cff2b
5
5
  SHA512:
6
- metadata.gz: 09e5910d725ce924f309a47ac148ecd3b36255f5b51bd110f97b6e8fbe834e40f24a8232c702bd3f66675c246eb7cce1edfc6d0efebf31134502c936863fb956
7
- data.tar.gz: c1a791d80a3f73b4929dcc244ed0531e799bf616040859d3451a6d2f719b285d11b950aada203cfb0aca05e0df37b750a3ef37fac775d67d2ab1f5d534f5c05f
6
+ metadata.gz: 8c1c8ec872b0071f6610beac36533889af8462a407fd2180ce4a2bf24cc5098c5466831190c96581bf35e20ef5ed9be6abd8c541f2418de87573e55cc154a4d2
7
+ data.tar.gz: a83e926c1a57d7bf7cbcb12dad12a5466081585259f283a9834e7ecfc69b4577cca46c153a87e62c6d9abbc7f5f9a2a4e4ba081de8418d37ad696e8bd2382c2d
data/CHANGELOG.md CHANGED
@@ -1,27 +1,30 @@
1
- ## v0.1.12
1
+ # v0.1.14
2
+ * Update how previously printed table content is tracked
3
+
4
+ # v0.1.12
2
5
  * Allow `Ui#auto_confirm` and `Ui#auto_default` to be modified
3
6
 
4
- ## v0.1.10
7
+ # v0.1.10
5
8
  * Update `Ui#ask_question` to properly handle non-string values
6
9
 
7
- ## v0.1.8
10
+ # v0.1.8
8
11
  * Add `Ui#debug` output method
9
12
  * Add `Ui#verbose` output method
10
13
 
11
- ## v0.1.6
14
+ # v0.1.6
12
15
  * Include `Ui#fatal` output method
13
16
  * Add helper into `Ui` directly for building new tables
14
17
  * Provide optional validation for answers provided to `Ui#question`
15
18
  * Add `Ui#confirm` method
16
19
  * Allow optional support for auto confirm and auto default
17
20
 
18
- ## v0.1.4
21
+ # v0.1.4
19
22
  * Add compat alias `#ask_question` -> `#ask`
20
23
  * Allow passing instance to `Ui::Table` to proxy method calls
21
24
 
22
- ## v0.1.2
25
+ # v0.1.2
23
26
  * Fix table generation
24
27
  * Add test coverage
25
28
 
26
- ## v0.1.0
29
+ # v0.1.0
27
30
  * Initial release
data/lib/bogo-ui/table.rb CHANGED
@@ -26,7 +26,7 @@ module Bogo
26
26
  @ui = ui
27
27
  @base = block
28
28
  @content = []
29
- @printed_lines = 0
29
+ @printed_lines = []
30
30
  end
31
31
 
32
32
  # If proxy instance is provided, forward if possible
@@ -83,8 +83,15 @@ module Bogo
83
83
  @table.output
84
84
  @table.buffer.rewind
85
85
  output = @table.buffer.read.split("\n")
86
- output.slice!(0, @printed_lines)
87
- @printed_lines += output.size
86
+ output = output.find_all do |line|
87
+ !@printed_lines.include?(
88
+ Digest::SHA256.hexdigest(line.gsub(/\s/, ''))
89
+ )
90
+ end
91
+ @printed_lines.concat(
92
+ output.map{|l| Digest::SHA256.hexdigest(l.gsub(/\s/, '')) }
93
+ )
94
+ puts @printed_lines
88
95
  ui.puts output.join("\n") unless output.empty?
89
96
  self
90
97
  end
@@ -1,6 +1,6 @@
1
1
  module Bogo
2
2
  class Ui
3
3
  # Current library version
4
- VERSION = Gem::Version.new('0.1.12')
4
+ VERSION = Gem::Version.new('0.1.14')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogo-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-01 00:00:00.000000000 Z
11
+ date: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.2.2
90
+ rubygems_version: 2.4.8
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: UI Helper libraries