run_tasks 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/src/run.rb +11 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f8a01e9cf83e14af770fdf07028b7eeef28e5a2
4
- data.tar.gz: 6298e13d2b841b1e66f3c095538fd99ea486346c
3
+ metadata.gz: 0ca212e97bece85ae70c8db267e09c31d0c135bd
4
+ data.tar.gz: 36636b9b276ccd8d4246cd748e09c5900223065d
5
5
  SHA512:
6
- metadata.gz: 840a4dea8f6978e7a4b48d48afe7148707a127a8d619698ffc7ffe11854996422b1aefe1c52be023728e9f8faf4e2fd61f0034b9821a03c43cecef7d20dec637
7
- data.tar.gz: 0d3d3b5d42de907bf85acd67f14698231756af2c08c5c767aa6bd762aa2085cf83b770bdbc60f58ad8e9790710a4e9f167d8837c63ecd8f10b8fa6add574ff27
6
+ metadata.gz: 97133b4706e5fd853ae1686ebc1079d28c016bf3f18ed1831051a4fc3d61b3277cc970f4112b59686fb45319b48d4be8d06c727525bfd2ec4cb67f64899d2010
7
+ data.tar.gz: a5f05889f869b1356e79dd577f1ed7fb390ac9bce118a017eef2f80a5a0e3dc42b444de3b61df2e66af4c52126380e4a7ca6987b3cb8ec3f3a391380722b1ed1
data/src/run.rb CHANGED
@@ -55,7 +55,11 @@ end
55
55
  # @param options [Hash] Optional options sent to the task.
56
56
  def run(task_name_or_command, *arguments, **options)
57
57
  if task_name_or_command.is_a?(Symbol)
58
- @tasks[task_name_or_command][:block].call *arguments, **options
58
+ if options.empty?
59
+ @tasks[task_name_or_command][:block].call *arguments
60
+ else
61
+ @tasks[task_name_or_command][:block].call *arguments, **options
62
+ end
59
63
  return
60
64
  end
61
65
 
@@ -76,6 +80,12 @@ def run(task_name_or_command, *arguments, **options)
76
80
  puts
77
81
  end
78
82
 
83
+ def are_you_sure?(text = "Are you sure?")
84
+ puts "#{text.yellow.bold} [yN]"
85
+ answer = STDIN.gets.chomp.downcase.chars.first
86
+ exit 9 unless answer == "y"
87
+ end
88
+
79
89
  # @param uri [String]
80
90
  def require_remote(uri)
81
91
  cache_path = "/tmp/run_cache_#{Digest::MD5.hexdigest(uri)}"
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: 1.4.1
4
+ version: 1.5.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: 2023-02-22 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: aurelien.delogu@gmail.com