cli-mastermind 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78d5896d7e30cbc525db20203826c87eaccd257b8affa8fd27581123da546cd1
4
- data.tar.gz: 9c3a443101cee50328a0b2d7abed17054bf9fd6e6aac7b5480e812b5bf4a723d
3
+ metadata.gz: 3b0de9e93e04cee67c931bcb124cbcefd75c68c27a2f7d8e44eba083dd4f9fbf
4
+ data.tar.gz: 559924cdd1e35d6498b6ccb23def42fdd2d0a669b9fedae234d62e5837161e95
5
5
  SHA512:
6
- metadata.gz: a0c618d6e0046a26d6ef0c7a9d507542c7e8aefc3cf10949fb58c11bbe2b488466d80d70e162b8e9e50e51ba270aeedfcfe53a54928e48a2eaf38933704a4ec7
7
- data.tar.gz: 60b5602a9c4732974f0165e69b684668eb0fe3861d133f3117f88787db9b0a2a23e32482716de42ae3af6ece9be13f4a27bb42ffac1ca566d5e786e154c42ee4
6
+ metadata.gz: 434badb48e238d256391e1667284ab24a1d67ffb7c79a4a38625b015a84b325daec31c8626cd5163abb215d49cab82dd874346100a2b811928534ef077b5bbc9
7
+ data.tar.gz: 1019f97fd8602609a1bedd3eb1ac578fe56da1c2376200fd0d04aeec366571f9b919ffc2a167618c435b3f5b20c541c241bf2484823c3a577dcad60080aee07d
@@ -130,10 +130,15 @@ module CLI::Mastermind::UserInterface
130
130
  # arguments. The command and any kwargs given are passed to IO.popen to capture
131
131
  # output.
132
132
  #
133
+ # Optionally, a block may be passed to modify the output of the line prior to
134
+ # printing.
135
+ #
133
136
  # @see IO.popen
134
137
  # @see Open3.popen
135
- def capture_command_output(*command, **kwargs)
136
- IO.popen(command.flatten, **kwargs) { |io| io.each_line { |line| puts line } }
138
+ def capture_command_output(*command, **kwargs, &block)
139
+ # Default block returns what's passed in
140
+ block ||= -> line { line }
141
+ IO.popen(command.flatten, **kwargs) { |io| io.each_line { |line| print block.call(line) } }
137
142
  end
138
143
 
139
144
  class AsyncSpinners < CLI::UI::SpinGroup
@@ -8,7 +8,7 @@ module CLI
8
8
  module VERSION
9
9
  RELEASE = 1
10
10
  MAJOR = 2
11
- MINOR = 4
11
+ MINOR = 5
12
12
  PATCH = nil
13
13
 
14
14
  STRING = [RELEASE, MAJOR, MINOR, PATCH].compact.join('.').freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cli-mastermind
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hall