rbbt-util 5.26.33 → 5.26.34

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rbbt +8 -2
  3. data/lib/rbbt/persist.rb +11 -13
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bb743af0b904f9dd8e788c71cb4c4ca14f3134e65645c848763ddd93d6dc219
4
- data.tar.gz: 1e197f6519936cf7a1f384d73b7da94c8adce54588f78e84f71271883a1b11e4
3
+ metadata.gz: 0c859c48e53a0a17ca7f6d45b8715dae195771a781e956a5884d252b601c7987
4
+ data.tar.gz: b94425bb7d9205fe6b1bd034d113a8a1419c10f8cc57280ab885d223040f3f86
5
5
  SHA512:
6
- metadata.gz: 90799d7fae2157c02d2601f3c3b3eefabcd70818702523851b5008f2107bd458008b9131007d973333a12bce41a02e93ddf7634057f709f8edbfe2013ee8ec55
7
- data.tar.gz: ae3655c31d114cfcb692def246116a69113702bb6048b57f5e72ea9f293414f8484ab9830427b228b9860b09d75c221705338e252184cada37908e63b2323765
6
+ metadata.gz: 443e13d560951c8d3bec118ff344b41d5aff2cb11a845d3e709f0397aed6ff59cef0798e405523d30c06c002c8c25c07ee6d8e009d52cf1f32add9661aae9c55
7
+ data.tar.gz: 1471b2f9363c7ca25783ae22e2b4076c9e29200fad3be0b4634ea7471be97e8f8c6c40f340eabcc0bb32e5e5811d562d45b9f62869b068db5fa721a7995b1d18
data/bin/rbbt CHANGED
@@ -51,7 +51,8 @@ $ rbbt <command> <subcommand> ... -a --arg1 --arg2='value' --arg3 'another-value
51
51
  --nocolor #{Log.color :yellow, "Disable colored output"}
52
52
  --nobar #{Log.color :yellow, "Disable progress report"}
53
53
  --nostream #{Log.color :yellow, "Disable persistance/job streaming"}
54
- --update_persist #{Log.color :yellow, "Update persisted TSV files if source has been updated"}
54
+ --update #{Log.color :yellow, "Update persisted files when dependencies update"}
55
+ --update_tsv #{Log.color :yellow, "Update persisted TSV files also if source has been updated"}
55
56
  --locate_file #{Log.color :yellow, "Report the location of the script instead of executing it"}
56
57
  --dump_mem* #{Log.color :yellow, "Dump strings in memory each second into file"}
57
58
  -nolock--no_lock_id #{Log.color :yellow, "Do not track lockfiles with ids (prevent stale file handlers for high-througput and high-concurrency)"}
@@ -116,7 +117,12 @@ if options[:config_keys]
116
117
  end
117
118
  end
118
119
 
119
- if options.delete(:update_persist)
120
+ if options.delete(:update)
121
+ ENV["RBBT_UPDATE"] = "true"
122
+ end
123
+
124
+ if options.delete(:update_tsv)
125
+ ENV["RBBT_UPDATE"] = "true"
120
126
  ENV["RBBT_UPDATE_TSV_PERSIST"] = "true"
121
127
  end
122
128
 
data/lib/rbbt/persist.rb CHANGED
@@ -40,21 +40,19 @@ module Persist
40
40
  def self.is_persisted?(path, persist_options = {})
41
41
  return false if not Open.exists? path
42
42
  return false if TrueClass === persist_options[:update]
43
+ return true unless ENV["RBBT_UPDATE"]
43
44
 
44
- check = persist_options[:check]
45
- if not check.nil?
46
- if Array === check
47
- newer = check.select{|file| newer? path, file}
48
- if newer.any?
49
- Log.medium "Persistence check for #{path} failed in: #{ Misc.fingerprint(newer)}"
50
- return false
51
- end
52
- else
53
- return false if newer? path, check
54
- end
45
+ case check = persist_options[:check]
46
+ when nil
47
+ true
48
+ when Array
49
+ newer = check.select{|file| newer? path, file}
50
+ return true if newer.empty?
51
+ Log.medium "Persistence check for #{path} failed in: #{ Misc.fingerprint(newer)}"
52
+ return false
53
+ else
54
+ ! newer?(path, check)
55
55
  end
56
-
57
- return true
58
56
  end
59
57
 
60
58
  def self.persistence_path(file, persist_options = {}, options = {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.26.33
4
+ version: 5.26.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez