cmd-utils 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/Gemfile.lock +33 -27
- data/VERSION +1 -1
- data/cmd-utils.gemspec +16 -16
- data/lib/arg-utils.rb +1 -1
- data/lib/cmd-utils.rb +1 -1
- data/lib/error-utils.rb +1 -1
- data/lib/lookup.rb +1 -1
- data/lib/run-utils.rb +1 -1
- data/lib/ssh-utils.rb +1 -1
- data/lib/talk-utils.rb +1 -1
- data/test/helper.rb +14 -11
- data/test/test-run-utils.rb +4 -4
- data/test/test-talk-utils.rb +2 -2
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdbc7893f1993c334bb77d21f7469880d7bc0eac
|
4
|
+
data.tar.gz: bcccc4218048c8d765cf9572f242d222a5dd10fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a487c6cb71cad87cd04786d9b5efd35157c5fa76090169f8498e0f3c80675a0f88f012653a0c46e7d2dd21e3057c0dac0437827b8d3b14aba54330271d7feee9
|
7
|
+
data.tar.gz: 8da749d551535ce57addddacb05e14007f90b1f90a27baa12c18bb451cfcf8c41d55430d2fe1d49b2fe25ca4bc682ea180ad9399762fed9a95a223b6838c2bee
|
data/Gemfile
CHANGED
@@ -6,8 +6,8 @@ source "http://rubygems.org"
|
|
6
6
|
# Add dependencies to develop your gem here.
|
7
7
|
# Include everything needed to run rake, tests, features, etc.
|
8
8
|
group :development do
|
9
|
-
gem "minitest",
|
10
|
-
gem "rdoc",
|
11
|
-
gem "bundler",
|
12
|
-
gem "jeweler",
|
9
|
+
gem "minitest", ">= 5.10.1"
|
10
|
+
gem "rdoc", ">= 5.0.0"
|
11
|
+
gem "bundler", ">= 1.0"
|
12
|
+
gem "jeweler", ">= 2.3.2"
|
13
13
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,59 +1,65 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.
|
4
|
+
addressable (2.5.0)
|
5
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
5
6
|
builder (3.2.2)
|
6
7
|
descendants_tracker (0.0.4)
|
7
8
|
thread_safe (~> 0.3, >= 0.3.1)
|
8
9
|
faraday (0.9.2)
|
9
10
|
multipart-post (>= 1.2, < 3)
|
10
|
-
git (1.
|
11
|
-
github_api (0.
|
11
|
+
git (1.3.0)
|
12
|
+
github_api (0.11.3)
|
12
13
|
addressable (~> 2.3)
|
13
|
-
descendants_tracker (~> 0.0.
|
14
|
+
descendants_tracker (~> 0.0.1)
|
14
15
|
faraday (~> 0.8, < 0.10)
|
15
|
-
hashie (>=
|
16
|
+
hashie (>= 1.2)
|
16
17
|
multi_json (>= 1.7.5, < 2.0)
|
17
|
-
nokogiri (~> 1.6.
|
18
|
+
nokogiri (~> 1.6.0)
|
18
19
|
oauth2
|
19
|
-
hashie (3.4.
|
20
|
+
hashie (3.4.6)
|
20
21
|
highline (1.7.8)
|
21
|
-
jeweler (2.
|
22
|
+
jeweler (2.3.2)
|
22
23
|
builder
|
23
24
|
bundler (>= 1.0)
|
24
25
|
git (>= 1.2.5)
|
25
|
-
github_api
|
26
|
+
github_api (~> 0.11.0)
|
26
27
|
highline (>= 1.6.15)
|
27
28
|
nokogiri (>= 1.5.10)
|
29
|
+
psych (~> 2.2)
|
28
30
|
rake
|
29
31
|
rdoc
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
semver2
|
33
|
+
jwt (1.5.6)
|
34
|
+
mini_portile2 (2.1.0)
|
35
|
+
minitest (5.10.1)
|
36
|
+
multi_json (1.12.1)
|
37
|
+
multi_xml (0.6.0)
|
35
38
|
multipart-post (2.0.0)
|
36
|
-
nokogiri (1.6.
|
37
|
-
|
38
|
-
oauth2 (1.
|
39
|
-
faraday (>= 0.8, < 0.
|
39
|
+
nokogiri (1.6.8.1)
|
40
|
+
mini_portile2 (~> 2.1.0)
|
41
|
+
oauth2 (1.3.0)
|
42
|
+
faraday (>= 0.8, < 0.11)
|
40
43
|
jwt (~> 1.0)
|
41
44
|
multi_json (~> 1.3)
|
42
45
|
multi_xml (~> 0.5)
|
43
|
-
rack (
|
44
|
-
|
45
|
-
|
46
|
-
|
46
|
+
rack (>= 1.2, < 3)
|
47
|
+
psych (2.2.2)
|
48
|
+
public_suffix (2.0.5)
|
49
|
+
rack (2.0.1)
|
50
|
+
rake (12.0.0)
|
51
|
+
rdoc (5.0.0)
|
52
|
+
semver2 (3.4.2)
|
47
53
|
thread_safe (0.3.5)
|
48
54
|
|
49
55
|
PLATFORMS
|
50
56
|
ruby
|
51
57
|
|
52
58
|
DEPENDENCIES
|
53
|
-
bundler (
|
54
|
-
jeweler (
|
55
|
-
minitest (
|
56
|
-
rdoc (
|
59
|
+
bundler (>= 1.0)
|
60
|
+
jeweler (>= 2.3.2)
|
61
|
+
minitest (>= 5.10.1)
|
62
|
+
rdoc (>= 5.0.0)
|
57
63
|
|
58
64
|
BUNDLED WITH
|
59
|
-
1.
|
65
|
+
1.13.7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.3
|
data/cmd-utils.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: cmd-utils 1.3.
|
5
|
+
# stub: cmd-utils 1.3.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "cmd-utils"
|
9
|
-
s.version = "1.3.
|
9
|
+
s.version = "1.3.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Alan K. Stebbens"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2017-01-11"
|
15
15
|
s.description = "Several ruby libraries for building command-line utilities."
|
16
16
|
s.email = "aks@stebbens.org"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -41,28 +41,28 @@ Gem::Specification.new do |s|
|
|
41
41
|
]
|
42
42
|
s.homepage = "http://bitbucket.org/aks_/cmd-utils"
|
43
43
|
s.licenses = ["MIT"]
|
44
|
-
s.rubygems_version = "2.
|
44
|
+
s.rubygems_version = "2.5.1"
|
45
45
|
s.summary = "Utilities for building CLIs"
|
46
46
|
|
47
47
|
if s.respond_to? :specification_version then
|
48
48
|
s.specification_version = 4
|
49
49
|
|
50
50
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
51
|
-
s.add_development_dependency(%q<minitest>, ["
|
52
|
-
s.add_development_dependency(%q<rdoc>, ["
|
53
|
-
s.add_development_dependency(%q<bundler>, ["
|
54
|
-
s.add_development_dependency(%q<jeweler>, ["
|
51
|
+
s.add_development_dependency(%q<minitest>, [">= 5.10.1"])
|
52
|
+
s.add_development_dependency(%q<rdoc>, [">= 5.0.0"])
|
53
|
+
s.add_development_dependency(%q<bundler>, [">= 1.0"])
|
54
|
+
s.add_development_dependency(%q<jeweler>, [">= 2.3.2"])
|
55
55
|
else
|
56
|
-
s.add_dependency(%q<minitest>, ["
|
57
|
-
s.add_dependency(%q<rdoc>, ["
|
58
|
-
s.add_dependency(%q<bundler>, ["
|
59
|
-
s.add_dependency(%q<jeweler>, ["
|
56
|
+
s.add_dependency(%q<minitest>, [">= 5.10.1"])
|
57
|
+
s.add_dependency(%q<rdoc>, [">= 5.0.0"])
|
58
|
+
s.add_dependency(%q<bundler>, [">= 1.0"])
|
59
|
+
s.add_dependency(%q<jeweler>, [">= 2.3.2"])
|
60
60
|
end
|
61
61
|
else
|
62
|
-
s.add_dependency(%q<minitest>, ["
|
63
|
-
s.add_dependency(%q<rdoc>, ["
|
64
|
-
s.add_dependency(%q<bundler>, ["
|
65
|
-
s.add_dependency(%q<jeweler>, ["
|
62
|
+
s.add_dependency(%q<minitest>, [">= 5.10.1"])
|
63
|
+
s.add_dependency(%q<rdoc>, [">= 5.0.0"])
|
64
|
+
s.add_dependency(%q<bundler>, [">= 1.0"])
|
65
|
+
s.add_dependency(%q<jeweler>, [">= 2.3.2"])
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
data/lib/arg-utils.rb
CHANGED
data/lib/cmd-utils.rb
CHANGED
data/lib/error-utils.rb
CHANGED
data/lib/lookup.rb
CHANGED
data/lib/run-utils.rb
CHANGED
data/lib/ssh-utils.rb
CHANGED
data/lib/talk-utils.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -19,9 +19,12 @@ module IO_Assert
|
|
19
19
|
def io_assert ioname, name, actual, expected
|
20
20
|
if expected
|
21
21
|
case expected
|
22
|
-
when TrueClass
|
23
|
-
|
24
|
-
when
|
22
|
+
when TrueClass
|
23
|
+
refute_empty(actual, "#{name} $#{ioname} should not be empty")
|
24
|
+
when FalseClass
|
25
|
+
then assert_empty(actual, "#{name} $#{ioname} should be empty")
|
26
|
+
when String, Regexp
|
27
|
+
then assert_match(expected, actual, "#{name} $#{ioname}: expected '#{expected.inspect}', got: '#{actual}'")
|
25
28
|
end
|
26
29
|
end
|
27
30
|
true
|
@@ -32,26 +35,26 @@ module Gen_Test
|
|
32
35
|
include IO_Assert
|
33
36
|
|
34
37
|
#def gen_test name, norun, verbose, quiet, debug, output
|
35
|
-
def gen_test name, flags,
|
38
|
+
def gen_test name, flags, expected_err
|
36
39
|
$norun = flags.include?('n')
|
37
40
|
$verbose = flags.include?('v')
|
38
41
|
$quiet = flags.include?('q')
|
39
42
|
$debug = flags.include?('d')
|
40
|
-
|
41
|
-
assert_empty(
|
42
|
-
io_assert :stderr, name,
|
43
|
+
actual_out, actual_err = capture_io { yield }
|
44
|
+
assert_empty(actual_out, "#{name} $stdout should be empty")
|
45
|
+
io_assert :stderr, name, actual_err, expected_err
|
43
46
|
end
|
44
47
|
end
|
45
48
|
|
46
49
|
module Run_Test
|
47
50
|
include IO_Assert
|
48
|
-
def run_test name, flags,
|
51
|
+
def run_test name, flags, expected_out=nil, expected_err=nil
|
49
52
|
$norun = flags.include?('n')
|
50
53
|
$verbose = flags.include?('v')
|
51
54
|
$quiet = flags.include?('q')
|
52
55
|
$debug = flags.include?('d')
|
53
56
|
begin
|
54
|
-
|
57
|
+
actual_out, actual_err = capture_subprocess_io do
|
55
58
|
begin
|
56
59
|
yield
|
57
60
|
rescue
|
@@ -59,8 +62,8 @@ module Run_Test
|
|
59
62
|
end
|
60
63
|
rescue
|
61
64
|
end
|
62
|
-
io_assert :stdout, name,
|
63
|
-
io_assert :stderr, name,
|
65
|
+
io_assert :stdout, name, actual_out, expected_out
|
66
|
+
io_assert :stderr, name, actual_err, expected_err
|
64
67
|
true
|
65
68
|
end
|
66
69
|
end
|
data/test/test-run-utils.rb
CHANGED
@@ -23,9 +23,9 @@ class TestRunUtils < Minitest::Test
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_run_errmsg
|
26
|
-
run_test("run 11", 'n', false, "(norun) ( exit 1)\n")
|
27
|
-
run_test("run 12", 'v', false,
|
28
|
-
run_test("run 13", 'v', false, ">> ( exit 0)\n")
|
29
|
-
run_test("run 14", ' ', false, false)
|
26
|
+
run_test("run 11", 'n', false, "(norun) ( exit 1)\n") { cmd_run "( exit 1)", 'error 11' }
|
27
|
+
run_test("run 12", 'v', false, />> \( exit 1\).*\nerror 12\n/m) { cmd_run "( exit 1)", 'error 12' }
|
28
|
+
run_test("run 13", 'v', false, ">> ( exit 0)\n") { cmd_run "( exit 0)", 'no error 13' }
|
29
|
+
run_test("run 14", ' ', false, false) { cmd_run "( exit 0)", 'no error 13' }
|
30
30
|
end
|
31
31
|
end
|
data/test/test-talk-utils.rb
CHANGED
@@ -239,8 +239,8 @@ class TestTalkUtils < Minitest::Test
|
|
239
239
|
def test_dtalkf_content
|
240
240
|
gen_test('dtalkf_content', ' d', "-hello-") { dtalkf "-%s-", "hello" }
|
241
241
|
gen_test('dtalkf_content', ' d', "-hello-") { dtalkf("-%s-") { "hello" } }
|
242
|
-
gen_test('dtalkf_default_content', ' d', "
|
243
|
-
gen_test('dtalkf_default_content', ' d', "
|
242
|
+
gen_test('dtalkf_default_content', ' d', "hello") { dtalkf "hello" }
|
243
|
+
gen_test('dtalkf_default_content', ' d', "hello") { dtalkf { "hello" } }
|
244
244
|
|
245
245
|
gen_test('dtalkf_content', ' ', false) { dtalkf "-%s-", "hello" }
|
246
246
|
gen_test('dtalkf_content', ' ', false) { dtalkf("-%s-") { "hello" } }
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmd-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan K. Stebbens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.10.1
|
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
|
-
version:
|
26
|
+
version: 5.10.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 5.0.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
|
-
version:
|
40
|
+
version: 5.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: jeweler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.3.2
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.3.2
|
69
69
|
description: Several ruby libraries for building command-line utilities.
|
70
70
|
email: aks@stebbens.org
|
71
71
|
executables: []
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.5.1
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Utilities for building CLIs
|