run_tasks 2.0.10 → 2.1.0
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/src/bootstrap.rb +3 -1
- data/src/run/helper/question_helper.rb +26 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7e70e3d810695cb07c97a531311bae1ee7d8a78
|
4
|
+
data.tar.gz: 263c45ce78aef65d05cc2c5036f6862d1b1c4558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97893a7e2faf8f9d8cc3a0851c37efcac9fc8f12f6a57324d40c0b5af1a4fc77e38939e0c5bffdc3003497727e99230e08e9ff3d4acd8189a0d98796cec25729
|
7
|
+
data.tar.gz: 0f417ff1bb2c43fd099d73084f9f7b32f8a77207e84da78466c2ca60a859be4437ad73d9a6047ac6bee5f28761c21ffe5826bfb31a96c7b9e34f862ba19ae1b3
|
data/src/bootstrap.rb
CHANGED
@@ -31,7 +31,9 @@ end
|
|
31
31
|
task :rspec do |path|
|
32
32
|
command = "bundle exec rspec"
|
33
33
|
|
34
|
-
if path
|
34
|
+
if !path
|
35
|
+
run command
|
36
|
+
elsif path.include?(":")
|
35
37
|
run "#{command} #{path}"
|
36
38
|
else
|
37
39
|
run "#{command} #{expand(File.directory?(path) ? "#{path}/**/*" : path)}"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "tty-prompt"
|
2
|
+
|
3
|
+
module Run
|
4
|
+
module Helper
|
5
|
+
class QuestionHelper
|
6
|
+
# @param question [String]
|
7
|
+
# @param regex [Regexp, Nil]
|
8
|
+
def initialize(question, regex = nil)
|
9
|
+
raise ArgumentError.new("'question' must be a String") if !question.is_a?(String)
|
10
|
+
|
11
|
+
@question = question
|
12
|
+
@regex = regex
|
13
|
+
end
|
14
|
+
|
15
|
+
# @return [any]
|
16
|
+
def run
|
17
|
+
TTY::Prompt.new.ask(@question) do |config|
|
18
|
+
config.required true
|
19
|
+
if @regex
|
20
|
+
config.validate @regex
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: run_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aurélien Delogu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- src/run/helper/expand_helper.rb
|
54
54
|
- src/run/helper/menu_helper.rb
|
55
55
|
- src/run/helper/pause_helper.rb
|
56
|
+
- src/run/helper/question_helper.rb
|
56
57
|
- src/run/helper/wait_for_interruption_helper.rb
|
57
58
|
- src/run/task/block_task.rb
|
58
59
|
- src/run/task/system_task.rb
|