cexpect 0.2.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d6f51d1822901ccaef277fd26017749f6d65ed3eaea50836fa2fbe5b7e90410
4
- data.tar.gz: 9eade35e51126e2ce00f99a02f3f1052f09314ecd19b516cb51f0d7ea4438139
3
+ metadata.gz: 82f8818774396505796ae2599538cbd7be691b63040a08b0b47632b61d46034d
4
+ data.tar.gz: 9fe872b5fe1ca1177f61f3c821060a4cedfeb3f9ac6699c05ec672466f697249
5
5
  SHA512:
6
- metadata.gz: 28a4cc9e4edfa0b18fa6d57f0c43f0fefae54b8872de8fe09c56595b31bf203a0aa5a24fe8005ebc737483c5a7d5e293fdd1d95276a57faccb717e786420ddc1
7
- data.tar.gz: 180e097fe5134c7527264a9a464bb5d4c27a8317dd08aef3886a560e997a00f1836f6740987fe6ccf83e8f181be8e5509f6a0ad2849b5788f89d9ac60312c1d6
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", "~> 12.0"
7
- gem "rspec", "~> 3.0"
8
-
9
- gem "rubocop", "~> 0.82.0"
10
- gem "rubocop-rspec", "~> 1.38"
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)
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.4.4)
11
- jaro_winkler (1.5.4)
12
- parallel (1.20.1)
13
- parser (3.0.1.1)
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
- rainbow (3.0.0)
16
- rake (12.3.3)
17
- rexml (3.2.5)
18
- rspec (3.10.0)
19
- rspec-core (~> 3.10.0)
20
- rspec-expectations (~> 3.10.0)
21
- rspec-mocks (~> 3.10.0)
22
- rspec-core (3.10.1)
23
- rspec-support (~> 3.10.0)
24
- rspec-expectations (3.10.1)
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.10.0)
27
- rspec-mocks (3.10.2)
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.10.0)
30
- rspec-support (3.10.2)
31
- rubocop (0.82.0)
32
- jaro_winkler (~> 1.5.1)
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 (>= 2.7.0.1)
40
+ parser (>= 3.3.0.2)
35
41
  rainbow (>= 2.2.2, < 4.0)
36
- rexml
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 (>= 1.4.0, < 2.0)
39
- rubocop-rspec (1.41.0)
40
- rubocop (>= 0.68.1)
41
- ruby-progressbar (1.11.0)
42
- unicode-display_width (1.7.0)
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 (~> 12.0)
50
- rspec (~> 3.0)
51
- rubocop (~> 0.82.0)
52
- rubocop-rspec (~> 1.38)
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.1.4
68
+ 2.5.17
data/README.md CHANGED
@@ -69,9 +69,6 @@ rd = CExpect::Reader.new(orig_rd)
69
69
 
70
70
  wr.puts "Hello, World!\n"
71
71
  greeting = rd.fexpect("\n")
72
-
73
- # If you want logging
74
-
75
72
  ```
76
73
 
77
74
  ## Development
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
- ' values and logging functionality'
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('>= 2.3.0')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CExpect
4
- VERSION = '0.2.0'
4
+ VERSION = '0.4.1'
5
5
  end
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 an
15
- # expect method
14
+ # A class delegating normal operations to a wrapped IO, adding
15
+ # expect methods
16
16
  #
17
17
  class Reader < SimpleDelegator
18
- def initialize(io, observers = nil)
19
- extend(LoggingReader) if observers
20
- super(io)
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 !IO.select([rd], nil, nil, timeout) || eof?
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 when observers are given to constructor
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.2.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: 2021-05-09 00:00:00.000000000 Z
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: 2.3.0
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.1.6
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: []