cliutils 2.1.4 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +3 -2
- data/Gemfile +7 -0
- data/HISTORY.md +7 -0
- data/README.md +3 -1
- data/Rakefile +8 -1
- data/cliutils.gemspec +1 -0
- data/lib/cliutils/configuration.rb +1 -1
- data/lib/cliutils/constants.rb +1 -1
- data/lib/cliutils/ext/hash_extensions.rb +16 -12
- data/lib/cliutils/messaging.rb +2 -116
- data/lib/cliutils/messenger.rb +109 -0
- data/lib/cliutils/prefs/pref.rb +10 -10
- data/lib/cliutils/prefs/pref_actions/open_url_action.rb +1 -1
- data/lib/cliutils/prefs/pref_validators/filepath_exists_validator.rb +2 -0
- data/lib/cliutils/prefs/pref_validators/url_validator.rb +1 -1
- data/lib/cliutils/prefs.rb +1 -1
- data/lib/cliutils/pretty_io.rb +0 -10
- data/lib/cliutils.rb +1 -1
- data/spec/action/open_url_action_spec.rb +20 -0
- data/spec/action/pref_action_spec.rb +11 -0
- data/spec/behavior/capitalize_behavior_spec.rb +11 -0
- data/spec/behavior/expand_filepath_behavior_spec.rb +11 -0
- data/spec/behavior/lowercase_behavior_spec.rb +11 -0
- data/spec/behavior/pref_behavior_spec.rb +11 -0
- data/spec/behavior/prefix_behavior_spec.rb +12 -0
- data/spec/behavior/suffix_behavior_spec.rb +12 -0
- data/spec/behavior/titlecase_behavior_spec.rb +10 -0
- data/spec/behavior/uppercase_behavior_spec.rb +11 -0
- data/spec/configuration_spec.rb +37 -0
- data/spec/configurator_spec.rb +104 -0
- data/spec/ext/hash_extensions_spec.rb +54 -0
- data/spec/ext/logger_extensions_spec.rb +20 -0
- data/spec/ext/string_extensions_spec.rb +26 -0
- data/spec/messaging_spec.rb +91 -0
- data/spec/pref_spec.rb +144 -0
- data/spec/prefs_spec.rb +150 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/validator/alphabetic_validator_spec.rb +20 -0
- data/spec/validator/alphanumeric_validator_spec.rb +20 -0
- data/spec/validator/date_validator_spec.rb +20 -0
- data/spec/validator/datetime_validator_spec.rb +20 -0
- data/spec/validator/filepath_exists_validator_spec.rb +20 -0
- data/spec/validator/non_nil_validator_spec.rb +24 -0
- data/spec/validator/number_validator_spec.rb +20 -0
- data/spec/validator/pref_validator_spec.rb +11 -0
- data/spec/validator/time_validator_spec.rb +20 -0
- data/spec/validator/url_validator_spec.rb +20 -0
- data/{test/test_files → support}/configuration.yaml +1 -1
- data/support/prefstest.yaml +27 -0
- data/{test/test_files → support}/test_action.rb +0 -0
- data/support/test_action_empty.rb +7 -0
- data/{test/test_files → support}/test_behavior.rb +2 -2
- data/support/test_behavior_empty.rb +6 -0
- data/{test/test_files → support}/test_validator.rb +0 -2
- data/support/test_validator_empty.rb +7 -0
- data/test/pref_test.rb +0 -1
- data/test/prefs_test.rb +64 -1
- data/test/test_helper.rb +2 -2
- metadata +91 -67
- data/lib/cliutils/logger_delegator.rb +0 -49
- data/test/action_tests/open_url_action_test.rb +0 -12
- data/test/behavior_tests/capitalize_behavior_test.rb +0 -11
- data/test/behavior_tests/expand_filepath_behavior_test.rb +0 -11
- data/test/behavior_tests/lowercase_behavior_test.rb +0 -11
- data/test/behavior_tests/prefix_behavior_test.rb +0 -12
- data/test/behavior_tests/suffix_behavior_test.rb +0 -12
- data/test/behavior_tests/titlecase_behavior_test.rb +0 -11
- data/test/behavior_tests/uppercase_behavior_test.rb +0 -11
- data/test/configuration_test.rb +0 -49
- data/test/configurator_test.rb +0 -63
- data/test/hash_extensions_test.rb +0 -51
- data/test/logger_extensions_test.rb +0 -17
- data/test/messaging_test.rb +0 -53
- data/test/string_extesions_test.rb +0 -28
- data/test/test_files/prefstest.yaml +0 -38
- data/test/validator_tests/alphabetic_validator_test.rb +0 -22
- data/test/validator_tests/alphanumeric_validator_test.rb +0 -22
- data/test/validator_tests/date_validator_test.rb +0 -22
- data/test/validator_tests/datetime_validator_test.rb +0 -22
- data/test/validator_tests/filepath_exists_validator_test.rb +0 -22
- data/test/validator_tests/non_nil_validator_test.rb +0 -30
- data/test/validator_tests/number_validator_test.rb +0 -22
- data/test/validator_tests/time_validator_test.rb +0 -22
- data/test/validator_tests/url_validator_test.rb +0 -22
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require 'cliutils/prefs/pref_validators/date_validator'
|
5
|
+
|
6
|
+
describe CLIUtils::DateValidator do
|
7
|
+
it 'confirms that its input is a date' do
|
8
|
+
v = CLIUtils::DateValidator.new
|
9
|
+
v.validate('2014-02-01')
|
10
|
+
expect(v.is_valid).to be_true
|
11
|
+
expect(v.message).to eq('Response is not a date: 2014-02-01')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'confirms that its input is not a date' do
|
15
|
+
v = CLIUtils::DateValidator.new
|
16
|
+
v.validate('!@&^')
|
17
|
+
expect(v.is_valid).to_not be_true
|
18
|
+
expect(v.message).to eq('Response is not a date: !@&^')
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require 'cliutils/prefs/pref_validators/datetime_validator'
|
5
|
+
|
6
|
+
describe CLIUtils::DatetimeValidator do
|
7
|
+
it 'confirms that its input is a datetime' do
|
8
|
+
v = CLIUtils::DatetimeValidator.new
|
9
|
+
v.validate('2014-02-01 12:34 PM')
|
10
|
+
expect(v.is_valid).to be_true
|
11
|
+
expect(v.message).to eq('Response is not a datetime: 2014-02-01 12:34 PM')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'confirms that its input is not a datetime' do
|
15
|
+
v = CLIUtils::DatetimeValidator.new
|
16
|
+
v.validate('!@&^')
|
17
|
+
expect(v.is_valid).to_not be_true
|
18
|
+
expect(v.message).to eq('Response is not a datetime: !@&^')
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require 'cliutils/prefs/pref_validators/filepath_exists_validator'
|
5
|
+
|
6
|
+
describe CLIUtils::FilepathExistsValidator do
|
7
|
+
it 'confirms that its input is an existing filepath' do
|
8
|
+
v = CLIUtils::FilepathExistsValidator.new
|
9
|
+
v.validate('/tmp')
|
10
|
+
expect(v.is_valid).to be_true
|
11
|
+
expect(v.message).to eq('Path does not exist locally: /tmp')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'confirms that its input is not an existing filepath' do
|
15
|
+
v = CLIUtils::FilepathExistsValidator.new
|
16
|
+
v.validate('!@&^')
|
17
|
+
expect(v.is_valid).to_not be_true
|
18
|
+
expect(v.message).to eq('Path does not exist locally: !@&^')
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require 'cliutils/prefs/pref_validators/non_nil_validator'
|
5
|
+
|
6
|
+
describe CLIUtils::NonNilValidator do
|
7
|
+
it 'confirms that its input is non-nil' do
|
8
|
+
v = CLIUtils::NonNilValidator.new
|
9
|
+
v.validate('bachya')
|
10
|
+
expect(v.is_valid).to be_true
|
11
|
+
expect(v.message).to eq('Nil text not allowed')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'confirms that its input is not non-nil' do
|
15
|
+
v = CLIUtils::NonNilValidator.new
|
16
|
+
v.validate('')
|
17
|
+
expect(v.is_valid).to_not be_true
|
18
|
+
expect(v.message).to eq('Nil text not allowed')
|
19
|
+
|
20
|
+
v.validate(nil)
|
21
|
+
expect(v.is_valid).to_not be_true
|
22
|
+
expect(v.message).to eq('Nil text not allowed')
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require 'cliutils/prefs/pref_validators/number_validator'
|
5
|
+
|
6
|
+
describe CLIUtils::NumberValidator do
|
7
|
+
it 'confirms that its input is a number' do
|
8
|
+
v = CLIUtils::NumberValidator.new
|
9
|
+
v.validate('12345.678')
|
10
|
+
expect(v.is_valid).to be_true
|
11
|
+
expect(v.message).to eq('Response is not a number: 12345.678')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'confirms that its input is not a number' do
|
15
|
+
v = CLIUtils::NumberValidator.new
|
16
|
+
v.validate('bachya')
|
17
|
+
expect(v.is_valid).to_not be_true
|
18
|
+
expect(v.message).to eq('Response is not a number: bachya')
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'support/test_validator_empty')
|
5
|
+
|
6
|
+
describe CLIUtils::TestValidatorEmpty do
|
7
|
+
it 'raises an exception if `validate` is not implemented' do
|
8
|
+
m = '`validate` method not implemented on caller: CLIUtils::TestValidatorEmpty'
|
9
|
+
expect { CLIUtils::TestValidatorEmpty.new.validate('') }.to raise_error(RuntimeError, m)
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require 'cliutils/prefs/pref_validators/time_validator'
|
5
|
+
|
6
|
+
describe CLIUtils::TimeValidator do
|
7
|
+
it 'confirms that its input is a time' do
|
8
|
+
v = CLIUtils::TimeValidator.new
|
9
|
+
v.validate('12:43 AM')
|
10
|
+
expect(v.is_valid).to be_true
|
11
|
+
expect(v.message).to eq('Response is not a time: 12:43 AM')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'confirms that its input is not a time' do
|
15
|
+
v = CLIUtils::TimeValidator.new
|
16
|
+
v.validate('!@&^')
|
17
|
+
expect(v.is_valid).to_not be_true
|
18
|
+
expect(v.message).to eq('Response is not a time: !@&^')
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'cliutils/messaging'
|
3
|
+
require 'cliutils/prefs/pref_validators/pref_validator'
|
4
|
+
require 'cliutils/prefs/pref_validators/url_validator'
|
5
|
+
|
6
|
+
describe CLIUtils::UrlValidator do
|
7
|
+
it 'confirms that its input is a URL' do
|
8
|
+
v = CLIUtils::UrlValidator.new
|
9
|
+
v.validate('http://www.google.com')
|
10
|
+
expect(v.is_valid).to be_true
|
11
|
+
expect(v.message).to eq('Response is not a URL: http://www.google.com')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'confirms that its input is not a URL' do
|
15
|
+
v = CLIUtils::UrlValidator.new
|
16
|
+
v.validate('!@&^')
|
17
|
+
expect(v.is_valid).to_not be_true
|
18
|
+
expect(v.message).to eq('Response is not a URL: !@&^')
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
prompts:
|
2
|
+
- prompt_text: Batman or Superman?
|
3
|
+
default: Batman
|
4
|
+
config_key: superhero
|
5
|
+
config_section: personal_info
|
6
|
+
- prompt_text: Do you feel smart for preferring Batman?
|
7
|
+
default: Y
|
8
|
+
config_key: batman_answer
|
9
|
+
config_section: personal_info
|
10
|
+
prereqs:
|
11
|
+
- config_key: superhero
|
12
|
+
config_value: Batman
|
13
|
+
- prompt_text: Why do you prefer Superman?!
|
14
|
+
default: No clue
|
15
|
+
config_key: superman_answer
|
16
|
+
config_section: personal_info
|
17
|
+
prereqs:
|
18
|
+
- config_key: superhero
|
19
|
+
config_value: Superman
|
20
|
+
- prompt_text: Why don't you have a clue?
|
21
|
+
config_key: no_clue
|
22
|
+
config_section: personal_info
|
23
|
+
prereqs:
|
24
|
+
- config_key: superhero
|
25
|
+
config_value: Superman
|
26
|
+
- config_key: superman_answer
|
27
|
+
config_value: No clue
|
File without changes
|
data/test/pref_test.rb
CHANGED
@@ -7,7 +7,6 @@ require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/prefs/pref_actions
|
|
7
7
|
require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/prefs/pref_behaviors/pref_behavior')
|
8
8
|
require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/prefs/pref_validators/pref_validator')
|
9
9
|
|
10
|
-
# Tests for the Prefs class
|
11
10
|
class TestPref < Test::Unit::TestCase
|
12
11
|
def setup
|
13
12
|
@prefs_hash = {
|
data/test/prefs_test.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'test_helper'
|
2
|
+
require 'tempfile'
|
2
3
|
require 'yaml'
|
3
4
|
|
4
5
|
require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/ext/hash_extensions')
|
5
6
|
require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/prefs')
|
6
7
|
require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/prefs/pref')
|
7
8
|
|
8
|
-
# Tests for the Prefs class
|
9
9
|
class TestPrefs < Test::Unit::TestCase
|
10
10
|
def setup
|
11
11
|
@prefs_arr = [
|
@@ -56,6 +56,11 @@ class TestPrefs < Test::Unit::TestCase
|
|
56
56
|
assert_equal(prefs[:prompts].map { |p| CLIUtils::Pref.new(p) }, p.prompts)
|
57
57
|
end
|
58
58
|
|
59
|
+
def test_bad_file_creation
|
60
|
+
exception = assert_raise(RuntimeError) { p = CLIUtils::Prefs.new('asd') }
|
61
|
+
assert_equal('Invalid configuration file: asd', exception.message)
|
62
|
+
end
|
63
|
+
|
59
64
|
def test_array_creation
|
60
65
|
p = CLIUtils::Prefs.new(@prefs_arr)
|
61
66
|
prefs = @prefs_hash.deep_symbolize_keys
|
@@ -68,6 +73,11 @@ class TestPrefs < Test::Unit::TestCase
|
|
68
73
|
assert_equal(prefs[:prompts].map { |p| CLIUtils::Pref.new(p) }, p.prompts)
|
69
74
|
end
|
70
75
|
|
76
|
+
def test_invalid_type_creation
|
77
|
+
exception = assert_raise(RuntimeError) { p = CLIUtils::Prefs.new(123) }
|
78
|
+
assert_equal('Invalid configuration data', exception.message)
|
79
|
+
end
|
80
|
+
|
71
81
|
def test_register
|
72
82
|
CLIUtils::Prefs.register_action(File.join(File.dirname(__FILE__), 'test_files/test_action.rb'))
|
73
83
|
assert_equal(CLIUtils::Prefs.registered_actions.key?(:Test), true)
|
@@ -85,6 +95,19 @@ class TestPrefs < Test::Unit::TestCase
|
|
85
95
|
assert_equal(CLIUtils::Prefs.registered_validators[:Test][:path], File.join(File.dirname(__FILE__), 'test_files/test_validator.rb'))
|
86
96
|
end
|
87
97
|
|
98
|
+
def test_bad_registration
|
99
|
+
m = 'Registration failed because of unknown filepath: bachya.rb'
|
100
|
+
|
101
|
+
exception = assert_raise(RuntimeError) { CLIUtils::Prefs.register_action('bachya.rb') }
|
102
|
+
assert_equal(m, exception.message)
|
103
|
+
|
104
|
+
exception = assert_raise(RuntimeError) { CLIUtils::Prefs.register_behavior('bachya.rb') }
|
105
|
+
assert_equal(m, exception.message)
|
106
|
+
|
107
|
+
exception = assert_raise(RuntimeError) { CLIUtils::Prefs.register_validator('bachya.rb') }
|
108
|
+
assert_equal(m, exception.message)
|
109
|
+
end
|
110
|
+
|
88
111
|
def test_deregister
|
89
112
|
CLIUtils::Prefs.register_action(File.join(File.dirname(__FILE__), 'test_files/test_action.rb'))
|
90
113
|
CLIUtils::Prefs.deregister_action(:Test)
|
@@ -98,4 +121,44 @@ class TestPrefs < Test::Unit::TestCase
|
|
98
121
|
CLIUtils::Prefs.deregister_validator(:Test)
|
99
122
|
assert_equal(CLIUtils::Prefs.registered_validators.key?(:Test), false)
|
100
123
|
end
|
124
|
+
|
125
|
+
def test_ask
|
126
|
+
p = CLIUtils::Prefs.new(@prefs_filepath)
|
127
|
+
stdin = Tempfile.new("test_readline_stdin")
|
128
|
+
stdout = Tempfile.new("test_readline_stdout")
|
129
|
+
begin
|
130
|
+
stdin.write("\n")
|
131
|
+
stdin.close
|
132
|
+
stdout.close
|
133
|
+
line = replace_stdio(stdin.path, stdout.path) {
|
134
|
+
p.ask
|
135
|
+
}
|
136
|
+
ensure
|
137
|
+
stdin.close(true)
|
138
|
+
stdout.close(true)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
private
|
143
|
+
|
144
|
+
def replace_stdio(stdin_path, stdout_path)
|
145
|
+
open(stdin_path, "r"){|stdin|
|
146
|
+
open(stdout_path, "w"){|stdout|
|
147
|
+
orig_stdin = STDIN.dup
|
148
|
+
orig_stdout = STDOUT.dup
|
149
|
+
STDIN.reopen(stdin)
|
150
|
+
STDOUT.reopen(stdout)
|
151
|
+
begin
|
152
|
+
Readline.input = STDIN
|
153
|
+
Readline.output = STDOUT
|
154
|
+
yield
|
155
|
+
ensure
|
156
|
+
STDIN.reopen(orig_stdin)
|
157
|
+
STDOUT.reopen(orig_stdout)
|
158
|
+
orig_stdin.close
|
159
|
+
orig_stdout.close
|
160
|
+
end
|
161
|
+
}
|
162
|
+
}
|
163
|
+
end
|
101
164
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cliutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Bach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04
|
11
|
+
date: 2014-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.14.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.14.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: yard
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,8 +88,8 @@ executables: []
|
|
74
88
|
extensions: []
|
75
89
|
extra_rdoc_files: []
|
76
90
|
files:
|
77
|
-
- .gitignore
|
78
|
-
- .travis.yml
|
91
|
+
- ".gitignore"
|
92
|
+
- ".travis.yml"
|
79
93
|
- Gemfile
|
80
94
|
- HISTORY.md
|
81
95
|
- LICENSE.txt
|
@@ -89,8 +103,8 @@ files:
|
|
89
103
|
- lib/cliutils/ext/hash_extensions.rb
|
90
104
|
- lib/cliutils/ext/logger_extensions.rb
|
91
105
|
- lib/cliutils/ext/string_extensions.rb
|
92
|
-
- lib/cliutils/logger_delegator.rb
|
93
106
|
- lib/cliutils/messaging.rb
|
107
|
+
- lib/cliutils/messenger.rb
|
94
108
|
- lib/cliutils/prefs.rb
|
95
109
|
- lib/cliutils/prefs/pref.rb
|
96
110
|
- lib/cliutils/prefs/pref_actions/open_url_action.rb
|
@@ -130,37 +144,46 @@ files:
|
|
130
144
|
- res/readme-images/prettyio-red-text.png
|
131
145
|
- res/readme-images/prompting.png
|
132
146
|
- res/readme-images/wrapping.png
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
147
|
+
- spec/action/open_url_action_spec.rb
|
148
|
+
- spec/action/pref_action_spec.rb
|
149
|
+
- spec/behavior/capitalize_behavior_spec.rb
|
150
|
+
- spec/behavior/expand_filepath_behavior_spec.rb
|
151
|
+
- spec/behavior/lowercase_behavior_spec.rb
|
152
|
+
- spec/behavior/pref_behavior_spec.rb
|
153
|
+
- spec/behavior/prefix_behavior_spec.rb
|
154
|
+
- spec/behavior/suffix_behavior_spec.rb
|
155
|
+
- spec/behavior/titlecase_behavior_spec.rb
|
156
|
+
- spec/behavior/uppercase_behavior_spec.rb
|
157
|
+
- spec/configuration_spec.rb
|
158
|
+
- spec/configurator_spec.rb
|
159
|
+
- spec/ext/hash_extensions_spec.rb
|
160
|
+
- spec/ext/logger_extensions_spec.rb
|
161
|
+
- spec/ext/string_extensions_spec.rb
|
162
|
+
- spec/messaging_spec.rb
|
163
|
+
- spec/pref_spec.rb
|
164
|
+
- spec/prefs_spec.rb
|
165
|
+
- spec/spec_helper.rb
|
166
|
+
- spec/validator/alphabetic_validator_spec.rb
|
167
|
+
- spec/validator/alphanumeric_validator_spec.rb
|
168
|
+
- spec/validator/date_validator_spec.rb
|
169
|
+
- spec/validator/datetime_validator_spec.rb
|
170
|
+
- spec/validator/filepath_exists_validator_spec.rb
|
171
|
+
- spec/validator/non_nil_validator_spec.rb
|
172
|
+
- spec/validator/number_validator_spec.rb
|
173
|
+
- spec/validator/pref_validator_spec.rb
|
174
|
+
- spec/validator/time_validator_spec.rb
|
175
|
+
- spec/validator/url_validator_spec.rb
|
176
|
+
- support/configuration.yaml
|
177
|
+
- support/prefstest.yaml
|
178
|
+
- support/test_action.rb
|
179
|
+
- support/test_action_empty.rb
|
180
|
+
- support/test_behavior.rb
|
181
|
+
- support/test_behavior_empty.rb
|
182
|
+
- support/test_validator.rb
|
183
|
+
- support/test_validator_empty.rb
|
146
184
|
- test/pref_test.rb
|
147
185
|
- test/prefs_test.rb
|
148
|
-
- test/string_extesions_test.rb
|
149
|
-
- test/test_files/configuration.yaml
|
150
|
-
- test/test_files/prefstest.yaml
|
151
|
-
- test/test_files/test_action.rb
|
152
|
-
- test/test_files/test_behavior.rb
|
153
|
-
- test/test_files/test_validator.rb
|
154
186
|
- test/test_helper.rb
|
155
|
-
- test/validator_tests/alphabetic_validator_test.rb
|
156
|
-
- test/validator_tests/alphanumeric_validator_test.rb
|
157
|
-
- test/validator_tests/date_validator_test.rb
|
158
|
-
- test/validator_tests/datetime_validator_test.rb
|
159
|
-
- test/validator_tests/filepath_exists_validator_test.rb
|
160
|
-
- test/validator_tests/non_nil_validator_test.rb
|
161
|
-
- test/validator_tests/number_validator_test.rb
|
162
|
-
- test/validator_tests/time_validator_test.rb
|
163
|
-
- test/validator_tests/url_validator_test.rb
|
164
187
|
homepage: https://github.com/bachya/cliutils
|
165
188
|
licenses:
|
166
189
|
- MIT
|
@@ -171,12 +194,12 @@ require_paths:
|
|
171
194
|
- lib
|
172
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
173
196
|
requirements:
|
174
|
-
- -
|
197
|
+
- - ">="
|
175
198
|
- !ruby/object:Gem::Version
|
176
199
|
version: '0'
|
177
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
201
|
requirements:
|
179
|
-
- -
|
202
|
+
- - ">="
|
180
203
|
- !ruby/object:Gem::Version
|
181
204
|
version: '0'
|
182
205
|
requirements: []
|
@@ -186,35 +209,36 @@ signing_key:
|
|
186
209
|
specification_version: 4
|
187
210
|
summary: Sugary goodness for Ruby CLI apps.
|
188
211
|
test_files:
|
189
|
-
-
|
190
|
-
-
|
191
|
-
-
|
192
|
-
-
|
193
|
-
-
|
194
|
-
-
|
195
|
-
-
|
196
|
-
-
|
197
|
-
-
|
198
|
-
-
|
199
|
-
-
|
200
|
-
-
|
201
|
-
-
|
212
|
+
- spec/action/open_url_action_spec.rb
|
213
|
+
- spec/action/pref_action_spec.rb
|
214
|
+
- spec/behavior/capitalize_behavior_spec.rb
|
215
|
+
- spec/behavior/expand_filepath_behavior_spec.rb
|
216
|
+
- spec/behavior/lowercase_behavior_spec.rb
|
217
|
+
- spec/behavior/pref_behavior_spec.rb
|
218
|
+
- spec/behavior/prefix_behavior_spec.rb
|
219
|
+
- spec/behavior/suffix_behavior_spec.rb
|
220
|
+
- spec/behavior/titlecase_behavior_spec.rb
|
221
|
+
- spec/behavior/uppercase_behavior_spec.rb
|
222
|
+
- spec/configuration_spec.rb
|
223
|
+
- spec/configurator_spec.rb
|
224
|
+
- spec/ext/hash_extensions_spec.rb
|
225
|
+
- spec/ext/logger_extensions_spec.rb
|
226
|
+
- spec/ext/string_extensions_spec.rb
|
227
|
+
- spec/messaging_spec.rb
|
228
|
+
- spec/pref_spec.rb
|
229
|
+
- spec/prefs_spec.rb
|
230
|
+
- spec/spec_helper.rb
|
231
|
+
- spec/validator/alphabetic_validator_spec.rb
|
232
|
+
- spec/validator/alphanumeric_validator_spec.rb
|
233
|
+
- spec/validator/date_validator_spec.rb
|
234
|
+
- spec/validator/datetime_validator_spec.rb
|
235
|
+
- spec/validator/filepath_exists_validator_spec.rb
|
236
|
+
- spec/validator/non_nil_validator_spec.rb
|
237
|
+
- spec/validator/number_validator_spec.rb
|
238
|
+
- spec/validator/pref_validator_spec.rb
|
239
|
+
- spec/validator/time_validator_spec.rb
|
240
|
+
- spec/validator/url_validator_spec.rb
|
202
241
|
- test/pref_test.rb
|
203
242
|
- test/prefs_test.rb
|
204
|
-
- test/string_extesions_test.rb
|
205
|
-
- test/test_files/configuration.yaml
|
206
|
-
- test/test_files/prefstest.yaml
|
207
|
-
- test/test_files/test_action.rb
|
208
|
-
- test/test_files/test_behavior.rb
|
209
|
-
- test/test_files/test_validator.rb
|
210
243
|
- test/test_helper.rb
|
211
|
-
- test/validator_tests/alphabetic_validator_test.rb
|
212
|
-
- test/validator_tests/alphanumeric_validator_test.rb
|
213
|
-
- test/validator_tests/date_validator_test.rb
|
214
|
-
- test/validator_tests/datetime_validator_test.rb
|
215
|
-
- test/validator_tests/filepath_exists_validator_test.rb
|
216
|
-
- test/validator_tests/non_nil_validator_test.rb
|
217
|
-
- test/validator_tests/number_validator_test.rb
|
218
|
-
- test/validator_tests/time_validator_test.rb
|
219
|
-
- test/validator_tests/url_validator_test.rb
|
220
244
|
has_rdoc:
|