cliutils 2.1.0 → 2.1.1
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/HISTORY.md +4 -0
- data/README.md +9 -0
- data/lib/cliutils/constants.rb +1 -1
- data/lib/cliutils/prefs/pref.rb +1 -1
- data/test/test_files/test_action.rb +11 -0
- data/test/test_files/test_behavior.rb +11 -0
- data/test/test_files/test_validator.rb +15 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68db9f1432d7c3406a8e3e0d8da2b36ebb3f9ca2
|
4
|
+
data.tar.gz: 6f94550ad158c2fe248ce3a96d55c79b10205858
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f4cdd934a27ce5806633a2d6a4949e7f6d60a6f1bf60563952cc602035cee1609443a445844b1923b882163795dfab6ce306503ea8ada5d7b11654b048697b9
|
7
|
+
data.tar.gz: f00af86450a6e7d39bb695c926ddb7005b23f28ebe90ff3983f619b0eaed384bc699b449a85675bab7cc4e561ec4ce88824ace3b90ce37a80e81f40b1f49a1ae
|
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -31,6 +31,15 @@ CLIUtils offers:
|
|
31
31
|
* [Wiki](https://github.com/bachya/cliutils/wiki "CLIUtils Wiki")
|
32
32
|
* [YARD documentation](http://rubydoc.info/github/bachya/cliutils/master/frames "YARD Documentation")
|
33
33
|
|
34
|
+
# Compatibility
|
35
|
+
|
36
|
+
CLIUtils is certified against the following:
|
37
|
+
|
38
|
+
* Ruby 2.1.0
|
39
|
+
* Ruby 2.0.0
|
40
|
+
* Ruby 1.9.3
|
41
|
+
* jruby-19mode
|
42
|
+
|
34
43
|
# Installation
|
35
44
|
|
36
45
|
Add this line to your application's Gemfile:
|
data/lib/cliutils/constants.rb
CHANGED
data/lib/cliutils/prefs/pref.rb
CHANGED
@@ -300,7 +300,7 @@ module CLIUtils
|
|
300
300
|
# the user with a message and skip over it.
|
301
301
|
begin
|
302
302
|
require File.expand_path(asset_path)
|
303
|
-
Object.const_get(
|
303
|
+
Object.const_get('CLIUtils').const_get(asset_name).new
|
304
304
|
rescue LoadError => e
|
305
305
|
messenger.warn("Skipping undefined Pref #{ @@asset_labels[type][:class_suffix] }: #{ path_or_name }")
|
306
306
|
nil
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module CLIUtils
|
2
|
+
# A Behavior to prefix a Pref answer with a string
|
3
|
+
class TestBehavior < PrefBehavior
|
4
|
+
# Evaluates the behavior against the text.
|
5
|
+
# @param [Object] text The "text" to evaluate
|
6
|
+
# @return [String]
|
7
|
+
def evaluate(text)
|
8
|
+
"test_behavior: #{ text }"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
3
|
+
module CLIUtils
|
4
|
+
# A Validator to verify whether a Pref answer
|
5
|
+
# is a valid URL.
|
6
|
+
class TestValidator < PrefValidator
|
7
|
+
# Runs the Validator against the answer.
|
8
|
+
# @param [Object] text The "text" to evaluate
|
9
|
+
# @return [String]
|
10
|
+
def validate(text)
|
11
|
+
@is_valid = text.to_s == "bachya"
|
12
|
+
@message = "String did not equal 'bachya': #{ text }"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cliutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
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-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,6 +138,9 @@ files:
|
|
138
138
|
- test/prefs_test.rb
|
139
139
|
- test/string_extesions_test.rb
|
140
140
|
- test/test_files/prefstest.yaml
|
141
|
+
- test/test_files/test_action.rb
|
142
|
+
- test/test_files/test_behavior.rb
|
143
|
+
- test/test_files/test_validator.rb
|
141
144
|
- test/test_helper.rb
|
142
145
|
homepage: https://github.com/bachya/cliutils
|
143
146
|
licenses:
|
@@ -172,5 +175,8 @@ test_files:
|
|
172
175
|
- test/prefs_test.rb
|
173
176
|
- test/string_extesions_test.rb
|
174
177
|
- test/test_files/prefstest.yaml
|
178
|
+
- test/test_files/test_action.rb
|
179
|
+
- test/test_files/test_behavior.rb
|
180
|
+
- test/test_files/test_validator.rb
|
175
181
|
- test/test_helper.rb
|
176
182
|
has_rdoc:
|