cliutils 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/HISTORY.md +4 -0
- data/lib/cliutils/configuration.rb +9 -0
- data/lib/cliutils/configurator.rb +7 -1
- data/lib/cliutils/logger-delegator.rb +2 -0
- data/lib/cliutils/prefs.rb +11 -1
- data/lib/cliutils/pretty-io.rb +5 -0
- data/lib/cliutils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8839468d53bb07c10d7e1d3bbda3fce0d65d9f4c
|
4
|
+
data.tar.gz: 7bea2c8039d87cbb73660649f42350501a84efe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67a30a0cc57dbc88a773262a2ac543424b1ff1dd7952bf7ecf7419e2c93a74fce2cb8d6a1b8aa45bfb1b11f801f336bf0c646d5b871e31cb0dc71730cca4cf61
|
7
|
+
data.tar.gz: c10b1b10d0f32a72a389a513727c3c9e1c3da504fd3981a1896dfce648d0b3d036e6c46cc86e8216204663523dca8dfbae93e8ed5db94219c05e62af2c997e38
|
data/Gemfile.lock
CHANGED
data/HISTORY.md
CHANGED
@@ -5,6 +5,15 @@ module CLIUtils
|
|
5
5
|
# Manages any configuration values and the flat YAML file
|
6
6
|
# into which they get stored.
|
7
7
|
module Configuration
|
8
|
+
# Allows easy access to Logger levels.
|
9
|
+
LOG_LEVELS = {
|
10
|
+
'DEBUG' => Logger::DEBUG,
|
11
|
+
'INFO' => Logger::INFO,
|
12
|
+
'WARN' => Logger::WARN,
|
13
|
+
'ERROR' => Logger::ERROR,
|
14
|
+
'FATAL' => Logger::FATAL,
|
15
|
+
}
|
16
|
+
|
8
17
|
# Hook that triggers when this module is included.
|
9
18
|
# @param [Object] k The includer object
|
10
19
|
# @return [void]
|
@@ -5,7 +5,13 @@ module CLIUtils
|
|
5
5
|
# Manages any configuration values and the flat YAML file
|
6
6
|
# into which they get stored.
|
7
7
|
class Configurator
|
8
|
-
|
8
|
+
# Stores the path to the configuration file.
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :config_path
|
11
|
+
|
12
|
+
# Stores the configuration data itself.
|
13
|
+
# @return [Hash]
|
14
|
+
attr_reader :data
|
9
15
|
|
10
16
|
# Initializes configuration from a flat file.
|
11
17
|
# @param [String] path The filepath to the config YAML
|
data/lib/cliutils/prefs.rb
CHANGED
@@ -5,7 +5,17 @@ module CLIUtils
|
|
5
5
|
# those to a user via a prompt, and collect the results.
|
6
6
|
class Prefs
|
7
7
|
include PrettyIO
|
8
|
-
|
8
|
+
# Stores answers to prompt questions.
|
9
|
+
# @return [Hash]
|
10
|
+
attr_reader :answers
|
11
|
+
|
12
|
+
# Stores the filepath (if it exists) to the prefs file.
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :config_path
|
15
|
+
|
16
|
+
# Stores answers to prompt questions.
|
17
|
+
# @return [Hash]
|
18
|
+
attr_reader :prompts
|
9
19
|
|
10
20
|
# Reads prompt data from and stores it.
|
11
21
|
# @param [<String, Hash, Array>] data Filepath to YAML, Hash, or Array
|
data/lib/cliutils/pretty-io.rb
CHANGED
@@ -12,7 +12,12 @@ module CLIUtils
|
|
12
12
|
module PrettyIO
|
13
13
|
|
14
14
|
class << self
|
15
|
+
# Determines whether wrapping should be enabled.
|
16
|
+
# @return [Boolean]
|
15
17
|
attr_accessor :wrap
|
18
|
+
|
19
|
+
# Determines when strings should begin to wrap
|
20
|
+
# @return [Integer]
|
16
21
|
attr_accessor :wrap_char_limit
|
17
22
|
end
|
18
23
|
|
data/lib/cliutils/version.rb
CHANGED