cli-mastermind 1.2.3 → 1.2.4
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/lib/cli/mastermind/configuration.rb +2 -2
- data/lib/cli/mastermind/user_interface.rb +13 -0
- data/lib/cli/mastermind/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78d5896d7e30cbc525db20203826c87eaccd257b8affa8fd27581123da546cd1
|
|
4
|
+
data.tar.gz: 9c3a443101cee50328a0b2d7abed17054bf9fd6e6aac7b5480e812b5bf4a723d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0c618d6e0046a26d6ef0c7a9d507542c7e8aefc3cf10949fb58c11bbe2b488466d80d70e162b8e9e50e51ba270aeedfcfe53a54928e48a2eaf38933704a4ec7
|
|
7
|
+
data.tar.gz: 60b5602a9c4732974f0165e69b684668eb0fe3861d133f3117f88787db9b0a2a23e32482716de42ae3af6ece9be13f4a27bb42ffac1ca566d5e786e154c42ee4
|
|
@@ -30,8 +30,8 @@ module CLI
|
|
|
30
30
|
def self.add_attribute(attribute)
|
|
31
31
|
return if self.method_defined? attribute
|
|
32
32
|
|
|
33
|
-
define_method "#{attribute}=" do |new_value=nil
|
|
34
|
-
self.instance_variable_set("@#{attribute}", new_value
|
|
33
|
+
define_method "#{attribute}=" do |new_value=nil, &block|
|
|
34
|
+
self.instance_variable_set("@#{attribute}", new_value.nil? ? block : new_value) if self.instance_variable_get("@#{attribute}").nil?
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
define_method attribute do
|
|
@@ -123,6 +123,19 @@ module CLI::Mastermind::UserInterface
|
|
|
123
123
|
string.gsub(/[-_-]/, ' ').split(' ').map(&:capitalize).join(' ')
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
+
# Capture the output of the given command and print them in a cli-ui friendly way.
|
|
127
|
+
# This command is an ease of use wrapper around a common capture construct.
|
|
128
|
+
#
|
|
129
|
+
# The command given can be a single string, an array of strings, or individual
|
|
130
|
+
# arguments. The command and any kwargs given are passed to IO.popen to capture
|
|
131
|
+
# output.
|
|
132
|
+
#
|
|
133
|
+
# @see IO.popen
|
|
134
|
+
# @see Open3.popen
|
|
135
|
+
def capture_command_output(*command, **kwargs)
|
|
136
|
+
IO.popen(command.flatten, **kwargs) { |io| io.each_line { |line| puts line } }
|
|
137
|
+
end
|
|
138
|
+
|
|
126
139
|
class AsyncSpinners < CLI::UI::SpinGroup
|
|
127
140
|
attr_reader :results
|
|
128
141
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cli-mastermind
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Hall
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-12-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cli-ui
|