cexpect 0.2.0 → 0.4.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/.rubocop.yml +1 -3
- data/Gemfile +5 -5
- data/Gemfile.lock +46 -33
- data/README.md +0 -3
- data/cexpect.gemspec +7 -3
- data/lib/cexpect/version.rb +1 -1
- data/lib/cexpect.rb +10 -9
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 82f8818774396505796ae2599538cbd7be691b63040a08b0b47632b61d46034d
|
|
4
|
+
data.tar.gz: 9fe872b5fe1ca1177f61f3c821060a4cedfeb3f9ac6699c05ec672466f697249
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0d23bd1fd740490889d8fd0bd19b8c221b766eeab9c24e425605792e80c0f787686f189c51eb36934d12371b1a8ac9f0c23a8bd429d7cabd7d27d40e2808ae3
|
|
7
|
+
data.tar.gz: b668abcda69c2e833a68157a082e215d560119a88483c42201d6872906e7db78d46e47f090b5982075d641eafe2960edd1ae83b21293fd6da0bfde6194b2ddb9
|
data/.rubocop.yml
CHANGED
|
@@ -4,13 +4,11 @@ AllCops:
|
|
|
4
4
|
Exclude:
|
|
5
5
|
- 'bin/{console,setup}' # not mine
|
|
6
6
|
- 'Gemfile' # maintained through "bundle" command
|
|
7
|
+
NewCops: enable
|
|
7
8
|
|
|
8
9
|
# TODO: Clean up tests
|
|
9
10
|
RSpec/ExpectInHook:
|
|
10
11
|
Enabled: false
|
|
11
|
-
RSpec/FilePath:
|
|
12
|
-
Exclude:
|
|
13
|
-
- spec/cexpect_spec.rb
|
|
14
12
|
RSpec/MessageSpies:
|
|
15
13
|
Enabled: false
|
|
16
14
|
RSpec/NestedGroups:
|
data/Gemfile
CHANGED
|
@@ -3,8 +3,8 @@ source "https://rubygems.org"
|
|
|
3
3
|
# Specify your gem's dependencies in cexpect.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
-
gem "rake", "~>
|
|
7
|
-
gem "rspec", "~> 3.
|
|
8
|
-
|
|
9
|
-
gem "rubocop", "~>
|
|
10
|
-
gem "rubocop-rspec", "~>
|
|
6
|
+
gem "rake", "~> 13.2"
|
|
7
|
+
gem "rspec", "~> 3.13"
|
|
8
|
+
gem "rspec-support", "~> 3.13.1"
|
|
9
|
+
gem "rubocop", "~> 1.65"
|
|
10
|
+
gem "rubocop-rspec", "~> 3.0"
|
data/Gemfile.lock
CHANGED
|
@@ -1,55 +1,68 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cexpect (0.1
|
|
4
|
+
cexpect (0.4.1)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
9
|
ast (2.4.2)
|
|
10
|
-
diff-lcs (1.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
diff-lcs (1.5.1)
|
|
11
|
+
json (2.7.2)
|
|
12
|
+
language_server-protocol (3.17.0.3)
|
|
13
|
+
parallel (1.25.1)
|
|
14
|
+
parser (3.3.4.0)
|
|
14
15
|
ast (~> 2.4.1)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
rspec
|
|
23
|
-
rspec-
|
|
24
|
-
|
|
16
|
+
racc
|
|
17
|
+
racc (1.8.1)
|
|
18
|
+
rainbow (3.1.1)
|
|
19
|
+
rake (13.2.1)
|
|
20
|
+
regexp_parser (2.9.2)
|
|
21
|
+
rexml (3.3.4)
|
|
22
|
+
strscan
|
|
23
|
+
rspec (3.13.0)
|
|
24
|
+
rspec-core (~> 3.13.0)
|
|
25
|
+
rspec-expectations (~> 3.13.0)
|
|
26
|
+
rspec-mocks (~> 3.13.0)
|
|
27
|
+
rspec-core (3.13.0)
|
|
28
|
+
rspec-support (~> 3.13.0)
|
|
29
|
+
rspec-expectations (3.13.1)
|
|
25
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
26
|
-
rspec-support (~> 3.
|
|
27
|
-
rspec-mocks (3.
|
|
31
|
+
rspec-support (~> 3.13.0)
|
|
32
|
+
rspec-mocks (3.13.1)
|
|
28
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
29
|
-
rspec-support (~> 3.
|
|
30
|
-
rspec-support (3.
|
|
31
|
-
rubocop (
|
|
32
|
-
|
|
34
|
+
rspec-support (~> 3.13.0)
|
|
35
|
+
rspec-support (3.13.1)
|
|
36
|
+
rubocop (1.65.1)
|
|
37
|
+
json (~> 2.3)
|
|
38
|
+
language_server-protocol (>= 3.17.0)
|
|
33
39
|
parallel (~> 1.10)
|
|
34
|
-
parser (>=
|
|
40
|
+
parser (>= 3.3.0.2)
|
|
35
41
|
rainbow (>= 2.2.2, < 4.0)
|
|
36
|
-
|
|
42
|
+
regexp_parser (>= 2.4, < 3.0)
|
|
43
|
+
rexml (>= 3.2.5, < 4.0)
|
|
44
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
|
37
45
|
ruby-progressbar (~> 1.7)
|
|
38
|
-
unicode-display_width (>=
|
|
39
|
-
rubocop-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
47
|
+
rubocop-ast (1.31.3)
|
|
48
|
+
parser (>= 3.3.1.0)
|
|
49
|
+
rubocop-rspec (3.0.3)
|
|
50
|
+
rubocop (~> 1.61)
|
|
51
|
+
ruby-progressbar (1.13.0)
|
|
52
|
+
strscan (3.1.0)
|
|
53
|
+
unicode-display_width (2.5.0)
|
|
43
54
|
|
|
44
55
|
PLATFORMS
|
|
45
56
|
ruby
|
|
57
|
+
x86_64-darwin-23
|
|
46
58
|
|
|
47
59
|
DEPENDENCIES
|
|
48
60
|
cexpect!
|
|
49
|
-
rake (~>
|
|
50
|
-
rspec (~> 3.
|
|
51
|
-
|
|
52
|
-
rubocop
|
|
61
|
+
rake (~> 13.2)
|
|
62
|
+
rspec (~> 3.13)
|
|
63
|
+
rspec-support (~> 3.13.1)
|
|
64
|
+
rubocop (~> 1.65)
|
|
65
|
+
rubocop-rspec (~> 3.0)
|
|
53
66
|
|
|
54
67
|
BUNDLED WITH
|
|
55
|
-
2.
|
|
68
|
+
2.5.17
|
data/README.md
CHANGED
data/cexpect.gemspec
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# rubocop: disable Gemspec/RequireMFA
|
|
4
|
+
|
|
3
5
|
require_relative 'lib/cexpect/version'
|
|
4
6
|
|
|
5
7
|
Gem::Specification.new do |spec|
|
|
@@ -9,11 +11,11 @@ Gem::Specification.new do |spec|
|
|
|
9
11
|
spec.email = ['christer@janssons.org']
|
|
10
12
|
|
|
11
13
|
spec.summary = 'An improved expect method'
|
|
12
|
-
spec.description = 'An expect method with more reasonable return' \
|
|
13
|
-
'
|
|
14
|
+
spec.description = 'An expect method with more reasonable return ' \
|
|
15
|
+
'values and logging functionality'
|
|
14
16
|
spec.homepage = 'https://github.com/kondensatorn/cexpect'
|
|
15
17
|
spec.license = 'BSD-2-Clause'
|
|
16
|
-
spec.required_ruby_version = Gem::Requirement.new('>=
|
|
18
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.0.0')
|
|
17
19
|
|
|
18
20
|
spec.metadata['homepage_uri'] = spec.homepage
|
|
19
21
|
spec.metadata['source_code_uri'] = spec.homepage
|
|
@@ -30,3 +32,5 @@ Gem::Specification.new do |spec|
|
|
|
30
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
31
33
|
spec.require_paths = ['lib']
|
|
32
34
|
end
|
|
35
|
+
|
|
36
|
+
# rubocop: enable Gemspec/RequireMFA
|
data/lib/cexpect/version.rb
CHANGED
data/lib/cexpect.rb
CHANGED
|
@@ -11,13 +11,16 @@ module CExpect
|
|
|
11
11
|
extend CExpect::ModuleMethods
|
|
12
12
|
|
|
13
13
|
#
|
|
14
|
-
# A class delegating normal operations to a wrapped IO, adding
|
|
15
|
-
# expect
|
|
14
|
+
# A class delegating normal operations to a wrapped IO, adding
|
|
15
|
+
# expect methods
|
|
16
16
|
#
|
|
17
17
|
class Reader < SimpleDelegator
|
|
18
|
-
def
|
|
19
|
-
extend
|
|
20
|
-
|
|
18
|
+
def add_observer(*args)
|
|
19
|
+
extend Observable # overwrites this method with Observable#add_observer
|
|
20
|
+
# Call the new add_observer method
|
|
21
|
+
add_observer(*args)
|
|
22
|
+
|
|
23
|
+
extend LoggingReader
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
def expect(pat, timeout = nil, match_method: :re_match)
|
|
@@ -56,7 +59,7 @@ module CExpect
|
|
|
56
59
|
def getc(timeout)
|
|
57
60
|
rd = __getobj__
|
|
58
61
|
|
|
59
|
-
return nil if !
|
|
62
|
+
return nil if !rd.wait_readable(timeout) || eof?
|
|
60
63
|
|
|
61
64
|
rd.getc.chr
|
|
62
65
|
end
|
|
@@ -71,11 +74,9 @@ module CExpect
|
|
|
71
74
|
end
|
|
72
75
|
|
|
73
76
|
#
|
|
74
|
-
# Adds logging capability
|
|
77
|
+
# Adds logging capability
|
|
75
78
|
#
|
|
76
79
|
module LoggingReader
|
|
77
|
-
include Observable
|
|
78
|
-
|
|
79
80
|
def log(pat, buf)
|
|
80
81
|
return if count_observers.zero?
|
|
81
82
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cexpect
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christer Jansson
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-08-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: An expect method with more reasonable return values and logging functionality
|
|
14
14
|
email:
|
|
@@ -41,7 +41,7 @@ metadata:
|
|
|
41
41
|
homepage_uri: https://github.com/kondensatorn/cexpect
|
|
42
42
|
source_code_uri: https://github.com/kondensatorn/cexpect
|
|
43
43
|
changelog_uri: https://github.com/kondensatorn/cexpect/CHANGELOG.md
|
|
44
|
-
post_install_message:
|
|
44
|
+
post_install_message:
|
|
45
45
|
rdoc_options: []
|
|
46
46
|
require_paths:
|
|
47
47
|
- lib
|
|
@@ -49,15 +49,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
49
49
|
requirements:
|
|
50
50
|
- - ">="
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version:
|
|
52
|
+
version: 3.0.0
|
|
53
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
requirements:
|
|
55
55
|
- - ">="
|
|
56
56
|
- !ruby/object:Gem::Version
|
|
57
57
|
version: '0'
|
|
58
58
|
requirements: []
|
|
59
|
-
rubygems_version: 3.
|
|
60
|
-
signing_key:
|
|
59
|
+
rubygems_version: 3.5.15
|
|
60
|
+
signing_key:
|
|
61
61
|
specification_version: 4
|
|
62
62
|
summary: An improved expect method
|
|
63
63
|
test_files: []
|