miga-base 1.2.3.0 → 1.2.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94374ec5cc66632861a18159a8adf69591ce9d3d5249de5baacd636d7519bb9e
4
- data.tar.gz: '0395e8ac95c1770b2ee859a4bc59d0ba806f1298cc271f4ff0b64a4c7363897d'
3
+ metadata.gz: 5a2b155a7dd169adddb5bc6c1470c252adb2357521e5df1cb37634a80031a123
4
+ data.tar.gz: dc99e9614989ea17bf173c8d1fc8c1f0dd5692030079d54197099471f8f17041
5
5
  SHA512:
6
- metadata.gz: 69667e9595a04b972865911b5c2e4204f879d8c8f7fee6cd68e5c4e7a84662d9c9d4018a4f533cbbb33eada796fc26faa4797b3c0c016d4ef34fc8c1d13138e2
7
- data.tar.gz: 86aae6d82404516d2cbd8812eef539e00690fdf47ccecf7205bd4e4f301dc11f415f630111a40f22459a448579b4251698906e7e0380eb1631a1fae05915e183
6
+ metadata.gz: e4d1271135ba5c66a712f6ba7f19e14b351b367342d0a6f8e268ede58f7d85cc5bc2c4830040cdfa0e9bb742075ef61de4bf0cd086e075e9318ba4cd62eba4e2
7
+ data.tar.gz: 95d6881e9c0df6f5d2dbbef6f0ae144ac922a1e1a3b355785f78376cef1ed1e8b783ea08bf24674b6e17ca5543d90cc4555b11f11c261baa574398ddace9bb97
@@ -5,7 +5,7 @@ require 'miga/cli/action'
5
5
 
6
6
  class MiGA::Cli::Action::Run < MiGA::Cli::Action
7
7
  def parse_cli
8
- cli.defaults = { try_load: false, thr: 1, env: false }
8
+ cli.defaults = { try_load: false, thr: 1, env: false, check_first: false }
9
9
  cli.parse do |opt|
10
10
  cli.opt_object(opt, [:project, :dataset_opt, :result_opt])
11
11
  opt.on(
@@ -25,6 +25,10 @@ class MiGA::Cli::Action::Run < MiGA::Cli::Action
25
25
  '-e', '--environment',
26
26
  'Load PROJECT, DATASET, and CORES from the environment'
27
27
  ) { |v| cli[:env] = v }
28
+ opt.on(
29
+ '--check-first',
30
+ 'Check if the result exists, and run only if it does not'
31
+ ) { |v| cli[:check_first] = v }
28
32
  end
29
33
  end
30
34
 
@@ -51,6 +55,15 @@ class MiGA::Cli::Action::Run < MiGA::Cli::Action
51
55
  # Load project
52
56
  p = cli.load_project
53
57
 
58
+ # Check if result already exists
59
+ if cli[:check_first]
60
+ obj = cli[:dataset] ? p.dataset(cli[:dataset]) : p
61
+ if obj.result(cli[:result])
62
+ cli.say 'Result already exists'
63
+ return
64
+ end
65
+ end
66
+
54
67
  # Prepare command
55
68
  miga = MiGA.root_path
56
69
  opts = {}
@@ -29,7 +29,7 @@ module MiGA::Common::WithDaemonClass
29
29
  return nil if c.nil? || c.empty?
30
30
 
31
31
  Time.parse(c)
32
- rescue Errno::ENOENT
32
+ rescue Errno::ENOENT, ArgumentError
33
33
  return nil
34
34
  end
35
35
  end
data/lib/miga/version.rb CHANGED
@@ -12,7 +12,7 @@ module MiGA
12
12
  # - String indicating release status:
13
13
  # - rc* release candidate, not released as gem
14
14
  # - [0-9]+ stable release, released as gem
15
- VERSION = [1.2, 3, 0].freeze
15
+ VERSION = [1.2, 4, 0].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -20,7 +20,7 @@ module MiGA
20
20
 
21
21
  ##
22
22
  # Date of the current gem relese.
23
- VERSION_DATE = Date.new(2022, 2, 17)
23
+ VERSION_DATE = Date.new(2022, 2, 25)
24
24
 
25
25
  ##
26
26
  # References of MiGA
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3.0
4
+ version: 1.2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-17 00:00:00.000000000 Z
11
+ date: 2022-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons