retest 1.11.0 → 1.12.0

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: 1e115f99996becceaa5a11f81f938afa18571c8bdcb3e3fe5e500bb4d2eaa647
4
- data.tar.gz: 003bfb6679ddcfc531666fe397121170926248792503834f14e79566022da274
3
+ metadata.gz: 4abc5ba23e0eb0898fcf7858d8427371023ff44243cf1df5b0ca7dda24eaa1ac
4
+ data.tar.gz: 0d9fdf6b3db016da549af61ec4ad68716d21ec7a636f767a5459cbe94e51f9c4
5
5
  SHA512:
6
- metadata.gz: 7c71cb0291862bdd2cdda6ca37a7d199b6ad95c48812ff099e26ceef5505bb138cd01ea230fcbf7627c051de1760393850f129c59066f4ca45db21310114bf66
7
- data.tar.gz: eac9a20b762eea7d8706d4754f2894659c8aafb4f3930d99d8d5b730fe1e47ae4341538bf1616569e3d01f9a8555b3b1ec5c33be60c4db699d13d639947de285
6
+ metadata.gz: 9792fd804aa16d444dc7dbc4df93e4f392ed357ee5d4a885a0626df919ced06aee336704a6d35b75a118642f09ad18929a132d3e5fa2416bb3353cbcdf084510
7
+ data.tar.gz: e66b40a449245c4a7975502558d44b68b3093b5650d55a063f6db6bdca17022e327ff32a9ae3b3cc1c23a2ff18dc731585936f4a9122f41de64f90d7d8058524
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- retest (1.11.0)
4
+ retest (1.12.0)
5
5
  listen (~> 3.2)
6
6
  string-similarity (~> 2.1)
7
7
  tty-option (~> 0.1)
@@ -10,7 +10,7 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  byebug (11.1.3)
13
- ffi (1.15.5)
13
+ ffi (1.16.3)
14
14
  listen (3.8.0)
15
15
  rb-fsevent (~> 0.10, >= 0.10.3)
16
16
  rb-inotify (~> 0.9, >= 0.9.10)
data/README.md CHANGED
@@ -119,7 +119,7 @@ $ retest 'bundle exec rails test <test>'
119
119
 
120
120
  ## Ruby Support
121
121
 
122
- Retest supports ruby 2.4 and above.
122
+ Retest supports ruby 2.5 and above.
123
123
 
124
124
  ## Roadmap
125
125
 
data/bin/debug CHANGED
@@ -3,4 +3,8 @@
3
3
  require "bundler/setup"
4
4
  require "byebug"
5
5
 
6
- eval(File.read("exe/retest"))
6
+ begin
7
+ eval(File.read("exe/retest"))
8
+ rescue LocalJumpError
9
+ # Silence early returns in the eval block
10
+ end
data/exe/retest CHANGED
@@ -13,13 +13,20 @@ if options.help?
13
13
  return
14
14
  end
15
15
 
16
- repository = Retest::Repository.new(files: Retest::VersionControl.files)
16
+ if options.version?
17
+ $stdout.puts Retest::VERSION
18
+ return
19
+ end
20
+
21
+ prompt = Retest::Prompt.new
22
+ repository = Retest::Repository.new(files: Retest::VersionControl.files, prompt: prompt)
17
23
  command = Retest::Command.for_options(options)
18
24
  runner = Retest::Runners.runner_for(command.to_s)
19
25
  sounds = Retest::Sounds.for(options)
20
26
 
21
27
  sounds.play(:start)
22
28
  runner.add_observer(sounds)
29
+ prompt.add_observer(sounds)
23
30
 
24
31
  program = Retest::Program.new(
25
32
  repository: repository,
@@ -0,0 +1,29 @@
1
+ # lib/config/listen.rb:4: warning: method redefined; discarding old _fail
2
+ # ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/listen-3.8.0/lib/listen/record/symlink_detector.rb:35: warning: previous definition of _fail was here
3
+
4
+ # Runs a block of code without warnings.
5
+ def silence_warnings(&block)
6
+ warn_level = $VERBOSE
7
+ $VERBOSE = nil
8
+ result = block.call
9
+ $VERBOSE = warn_level
10
+ result
11
+ end
12
+
13
+ silence_warnings do
14
+
15
+ # TODO: Update monkey patch when decision is made about
16
+ # https://github.com/guard/listen/issues/572
17
+
18
+ module Listen
19
+ class Record
20
+ class SymlinkDetector
21
+ def _fail(symlinked, real_path)
22
+ Listen.logger.warn(format(SYMLINK_LOOP_ERROR, symlinked, real_path))
23
+ raise Error, "Don't watch locally-symlinked directory twice"
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ end
@@ -85,6 +85,12 @@ module Retest
85
85
  desc "Print usage"
86
86
  end
87
87
 
88
+ flag :version do
89
+ short "-v"
90
+ long "--version"
91
+ desc "Print retest version"
92
+ end
93
+
88
94
  option :polling do
89
95
  long '--polling'
90
96
  desc <<~DESC.strip
@@ -133,6 +139,10 @@ module Retest
133
139
  params[:help]
134
140
  end
135
141
 
142
+ def version?
143
+ params[:version]
144
+ end
145
+
136
146
  def full_suite?
137
147
  params[:all]
138
148
  end
data/lib/retest/prompt.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  module Retest
2
2
  class Prompt
3
+ include Observable
4
+
3
5
  def self.ask_which_test_to_use(path, files)
4
6
  new.ask_which_test_to_use(path, files)
5
7
  end
@@ -15,6 +17,9 @@ module Retest
15
17
  end
16
18
 
17
19
  def ask_which_test_to_use(path, files)
20
+ changed
21
+ notify_observers(:question)
22
+
18
23
  output.puts(<<~QUESTION)
19
24
  We found few tests matching: #{path}
20
25
 
data/lib/retest/sounds.rb CHANGED
@@ -26,6 +26,8 @@ module Retest
26
26
  ['afplay', '/System/Library/Sounds/Funk.aiff']
27
27
  when :start
28
28
  ['afplay', '/System/Library/Sounds/Blow.aiff']
29
+ when :question
30
+ ['afplay', '/System/Library/Sounds/Glass.aiff']
29
31
  else
30
32
  raise ArgumentError.new("No sounds were found for type: #{sound}.")
31
33
  end
@@ -40,15 +42,18 @@ end
40
42
  # List of Mac Audio Files:
41
43
  # afplay /System/Library/Sounds/Basso.aiff
42
44
  # afplay /System/Library/Sounds/Bottle.aiff
43
- # afplay /System/Library/Sounds/Funk.aiff
44
45
  # afplay /System/Library/Sounds/Hero.aiff
45
46
  # afplay /System/Library/Sounds/Ping.aiff
46
47
  # afplay /System/Library/Sounds/Purr.aiff
47
48
  # afplay /System/Library/Sounds/Submarine.aiff
48
- # afplay /System/Library/Sounds/Blow.aiff
49
49
  # afplay /System/Library/Sounds/Frog.aiff
50
- # afplay /System/Library/Sounds/Glass.aiff
51
50
  # afplay /System/Library/Sounds/Morse.aiff
52
51
  # afplay /System/Library/Sounds/Pop.aiff
53
- # afplay /System/Library/Sounds/Sosumi.aiff
54
52
  # afplay /System/Library/Sounds/Tink.aiff
53
+
54
+ # USED
55
+
56
+ # fail: afplay /System/Library/Sounds/Sosumi.aiff
57
+ # pass: afplay /System/Library/Sounds/Funk.aiff
58
+ # start: afplay /System/Library/Sounds/Blow.aiff
59
+ # question: afplay /System/Library/Sounds/Glass.aiff
@@ -1,3 +1,3 @@
1
1
  module Retest
2
- VERSION = "1.11.0"
2
+ VERSION = "1.12.0"
3
3
  end
data/lib/retest.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'listen'
2
+ require 'config/listen'
3
+
2
4
  require 'string/similarity'
3
5
  require 'observer'
4
6
 
data/retest.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.summary = "A simple command line tool to watch file change and run its matching spec."
10
10
  spec.homepage = "https://github.com/AlexB52/retest"
11
11
  spec.license = "MIT"
12
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
13
13
 
14
14
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Barret
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-04 00:00:00.000000000 Z
11
+ date: 2023-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: string-similarity
@@ -81,6 +81,7 @@ files:
81
81
  - bin/test/ruby-app
82
82
  - bin/test/ruby-bare
83
83
  - exe/retest
84
+ - lib/config/listen.rb
84
85
  - lib/retest.rb
85
86
  - lib/retest/command.rb
86
87
  - lib/retest/command/rails.rb
@@ -121,14 +122,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
122
  requirements:
122
123
  - - ">="
123
124
  - !ruby/object:Gem::Version
124
- version: 2.3.0
125
+ version: 2.5.0
125
126
  required_rubygems_version: !ruby/object:Gem::Requirement
126
127
  requirements:
127
128
  - - ">="
128
129
  - !ruby/object:Gem::Version
129
130
  version: '0'
130
131
  requirements: []
131
- rubygems_version: 3.4.6
132
+ rubygems_version: 3.4.21
132
133
  signing_key:
133
134
  specification_version: 4
134
135
  summary: A simple command line tool to watch file change and run its matching spec.