rbbt-util 5.44.1 → 6.0.4

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 (175) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/bin/rbbt +67 -90
  4. data/bin/rbbt_exec.rb +2 -2
  5. data/etc/app.d/base.rb +2 -2
  6. data/etc/app.d/semaphores.rb +3 -3
  7. data/lib/rbbt/annotations/annotated_array.rb +207 -207
  8. data/lib/rbbt/annotations/refactor.rb +27 -0
  9. data/lib/rbbt/annotations/util.rb +282 -282
  10. data/lib/rbbt/annotations.rb +343 -320
  11. data/lib/rbbt/association/database.rb +200 -225
  12. data/lib/rbbt/association/index.rb +294 -291
  13. data/lib/rbbt/association/item.rb +227 -227
  14. data/lib/rbbt/association/open.rb +35 -34
  15. data/lib/rbbt/association/util.rb +0 -169
  16. data/lib/rbbt/association.rb +2 -4
  17. data/lib/rbbt/entity/identifiers.rb +119 -118
  18. data/lib/rbbt/entity/refactor.rb +12 -0
  19. data/lib/rbbt/entity.rb +319 -315
  20. data/lib/rbbt/hpc/batch.rb +72 -53
  21. data/lib/rbbt/hpc/lsf.rb +2 -2
  22. data/lib/rbbt/hpc/orchestrate/batches.rb +2 -2
  23. data/lib/rbbt/hpc/orchestrate/chains.rb +25 -5
  24. data/lib/rbbt/hpc/orchestrate/rules.rb +2 -2
  25. data/lib/rbbt/hpc/orchestrate.rb +19 -13
  26. data/lib/rbbt/hpc/slurm.rb +18 -18
  27. data/lib/rbbt/knowledge_base/entity.rb +13 -5
  28. data/lib/rbbt/knowledge_base/query.rb +2 -2
  29. data/lib/rbbt/knowledge_base/registry.rb +32 -31
  30. data/lib/rbbt/knowledge_base/traverse.rb +1 -1
  31. data/lib/rbbt/knowledge_base.rb +1 -1
  32. data/lib/rbbt/monitor.rb +36 -25
  33. data/lib/rbbt/persist/refactor.rb +166 -0
  34. data/lib/rbbt/persist/tsv/tokyocabinet.rb +105 -105
  35. data/lib/rbbt/persist/tsv.rb +187 -185
  36. data/lib/rbbt/persist.rb +556 -551
  37. data/lib/rbbt/refactor.rb +20 -0
  38. data/lib/rbbt/resource/path/refactor.rb +178 -0
  39. data/lib/rbbt/resource/path.rb +317 -497
  40. data/lib/rbbt/resource/util.rb +0 -48
  41. data/lib/rbbt/resource.rb +3 -390
  42. data/lib/rbbt/tsv/accessor.rb +2 -838
  43. data/lib/rbbt/tsv/attach.rb +303 -299
  44. data/lib/rbbt/tsv/change_id.rb +244 -245
  45. data/lib/rbbt/tsv/csv.rb +87 -85
  46. data/lib/rbbt/tsv/dumper.rb +2 -100
  47. data/lib/rbbt/tsv/excel.rb +26 -24
  48. data/lib/rbbt/tsv/field_index.rb +4 -1
  49. data/lib/rbbt/tsv/filter.rb +3 -2
  50. data/lib/rbbt/tsv/index.rb +2 -284
  51. data/lib/rbbt/tsv/manipulate.rb +750 -747
  52. data/lib/rbbt/tsv/marshal.rb +3 -3
  53. data/lib/rbbt/tsv/matrix.rb +2 -2
  54. data/lib/rbbt/tsv/parallel/through.rb +2 -1
  55. data/lib/rbbt/tsv/parallel/traverse.rb +783 -781
  56. data/lib/rbbt/tsv/parser.rb +678 -678
  57. data/lib/rbbt/tsv/refactor.rb +195 -0
  58. data/lib/rbbt/tsv/stream.rb +253 -251
  59. data/lib/rbbt/tsv/util.rb +420 -420
  60. data/lib/rbbt/tsv.rb +210 -208
  61. data/lib/rbbt/util/R/eval.rb +4 -4
  62. data/lib/rbbt/util/R/plot.rb +62 -166
  63. data/lib/rbbt/util/R.rb +21 -18
  64. data/lib/rbbt/util/cmd.rb +2 -318
  65. data/lib/rbbt/util/color.rb +269 -269
  66. data/lib/rbbt/util/colorize.rb +89 -89
  67. data/lib/rbbt/util/concurrency/processes/refactor.rb +22 -0
  68. data/lib/rbbt/util/concurrency/processes/worker.rb +2 -2
  69. data/lib/rbbt/util/concurrency/processes.rb +389 -386
  70. data/lib/rbbt/util/config.rb +169 -167
  71. data/lib/rbbt/util/filecache.rb +1 -1
  72. data/lib/rbbt/util/iruby.rb +20 -0
  73. data/lib/rbbt/util/log/progress/report.rb +241 -241
  74. data/lib/rbbt/util/log/progress/util.rb +99 -99
  75. data/lib/rbbt/util/log/progress.rb +102 -102
  76. data/lib/rbbt/util/log/refactor.rb +49 -0
  77. data/lib/rbbt/util/log.rb +486 -532
  78. data/lib/rbbt/util/migrate.rb +2 -2
  79. data/lib/rbbt/util/misc/concurrent_stream.rb +248 -246
  80. data/lib/rbbt/util/misc/development.rb +12 -11
  81. data/lib/rbbt/util/misc/exceptions.rb +117 -112
  82. data/lib/rbbt/util/misc/format.rb +2 -230
  83. data/lib/rbbt/util/misc/indiferent_hash.rb +2 -107
  84. data/lib/rbbt/util/misc/inspect.rb +2 -476
  85. data/lib/rbbt/util/misc/lock.rb +109 -106
  86. data/lib/rbbt/util/misc/omics.rb +9 -1
  87. data/lib/rbbt/util/misc/pipes.rb +765 -793
  88. data/lib/rbbt/util/misc/refactor.rb +20 -0
  89. data/lib/rbbt/util/misc/ssw.rb +27 -17
  90. data/lib/rbbt/util/misc/system.rb +92 -105
  91. data/lib/rbbt/util/misc.rb +39 -20
  92. data/lib/rbbt/util/named_array/refactor.rb +4 -0
  93. data/lib/rbbt/util/named_array.rb +3 -220
  94. data/lib/rbbt/util/open/refactor.rb +7 -0
  95. data/lib/rbbt/util/open.rb +3 -857
  96. data/lib/rbbt/util/procpath.rb +6 -6
  97. data/lib/rbbt/util/python/paths.rb +27 -0
  98. data/lib/rbbt/util/python/run.rb +115 -0
  99. data/lib/rbbt/util/python/script.rb +110 -0
  100. data/lib/rbbt/util/python/util.rb +3 -3
  101. data/lib/rbbt/util/python.rb +22 -81
  102. data/lib/rbbt/util/semaphore.rb +152 -148
  103. data/lib/rbbt/util/simpleopt.rb +9 -8
  104. data/lib/rbbt/util/ssh/refactor.rb +19 -0
  105. data/lib/rbbt/util/ssh.rb +122 -118
  106. data/lib/rbbt/util/tar.rb +117 -115
  107. data/lib/rbbt/util/tmpfile.rb +69 -67
  108. data/lib/rbbt/util/version.rb +2 -0
  109. data/lib/rbbt/workflow/refactor/entity.rb +11 -0
  110. data/lib/rbbt/workflow/refactor/export.rb +66 -0
  111. data/lib/rbbt/workflow/refactor/inputs.rb +24 -0
  112. data/lib/rbbt/workflow/refactor/recursive.rb +64 -0
  113. data/lib/rbbt/workflow/refactor/task_info.rb +66 -0
  114. data/lib/rbbt/workflow/refactor.rb +150 -0
  115. data/lib/rbbt/workflow/remote_workflow/driver/rest.rb +1 -2
  116. data/lib/rbbt/workflow/remote_workflow/driver/ssh.rb +55 -32
  117. data/lib/rbbt/workflow/remote_workflow/remote_step/rest.rb +3 -1
  118. data/lib/rbbt/workflow/remote_workflow/remote_step/ssh.rb +14 -5
  119. data/lib/rbbt/workflow/remote_workflow/remote_step.rb +19 -7
  120. data/lib/rbbt/workflow/remote_workflow.rb +6 -1
  121. data/lib/rbbt/workflow/step/run.rb +766 -766
  122. data/lib/rbbt/workflow/step/save_load_inputs.rb +254 -254
  123. data/lib/rbbt/workflow/step.rb +2 -362
  124. data/lib/rbbt/workflow/task.rb +118 -118
  125. data/lib/rbbt/workflow/usage.rb +289 -287
  126. data/lib/rbbt/workflow/util/archive.rb +6 -5
  127. data/lib/rbbt/workflow/util/data.rb +1 -1
  128. data/lib/rbbt/workflow/util/orchestrator.rb +249 -246
  129. data/lib/rbbt/workflow/util/trace.rb +79 -44
  130. data/lib/rbbt/workflow.rb +4 -882
  131. data/lib/rbbt-util.rb +21 -13
  132. data/lib/rbbt.rb +16 -3
  133. data/python/rbbt/__init__.py +96 -4
  134. data/python/rbbt/workflow/remote.py +104 -0
  135. data/python/rbbt/workflow.py +64 -0
  136. data/python/test.py +10 -0
  137. data/share/Rlib/plot.R +37 -37
  138. data/share/Rlib/svg.R +22 -5
  139. data/share/install/software/lib/install_helpers +1 -1
  140. data/share/rbbt_commands/hpc/list +2 -3
  141. data/share/rbbt_commands/hpc/orchestrate +4 -4
  142. data/share/rbbt_commands/hpc/tail +2 -0
  143. data/share/rbbt_commands/hpc/task +10 -7
  144. data/share/rbbt_commands/lsf/list +2 -3
  145. data/share/rbbt_commands/lsf/orchestrate +4 -4
  146. data/share/rbbt_commands/lsf/tail +2 -0
  147. data/share/rbbt_commands/lsf/task +10 -7
  148. data/share/rbbt_commands/migrate +1 -1
  149. data/share/rbbt_commands/pbs/list +2 -3
  150. data/share/rbbt_commands/pbs/orchestrate +4 -4
  151. data/share/rbbt_commands/pbs/tail +2 -0
  152. data/share/rbbt_commands/pbs/task +10 -7
  153. data/share/rbbt_commands/resource/produce +8 -1
  154. data/share/rbbt_commands/slurm/list +2 -3
  155. data/share/rbbt_commands/slurm/orchestrate +4 -4
  156. data/share/rbbt_commands/slurm/tail +2 -0
  157. data/share/rbbt_commands/slurm/task +10 -7
  158. data/share/rbbt_commands/system/clean +5 -5
  159. data/share/rbbt_commands/system/status +5 -5
  160. data/share/rbbt_commands/tsv/get +2 -3
  161. data/share/rbbt_commands/tsv/info +10 -13
  162. data/share/rbbt_commands/tsv/keys +18 -14
  163. data/share/rbbt_commands/tsv/slice +2 -2
  164. data/share/rbbt_commands/tsv/transpose +6 -2
  165. data/share/rbbt_commands/workflow/info +20 -24
  166. data/share/rbbt_commands/workflow/list +1 -1
  167. data/share/rbbt_commands/workflow/prov +20 -13
  168. data/share/rbbt_commands/workflow/retry +43 -0
  169. data/share/rbbt_commands/workflow/server +12 -2
  170. data/share/rbbt_commands/workflow/task +80 -73
  171. data/share/rbbt_commands/workflow/write_info +26 -9
  172. data/share/software/opt/ssw/ssw.c +861 -0
  173. data/share/software/opt/ssw/ssw.h +130 -0
  174. data/share/workflow_config.ru +3 -3
  175. metadata +45 -6
@@ -1,99 +1,99 @@
1
- module Log
2
- class ProgressBar
3
- BAR_MUTEX = Mutex.new
4
- BARS = []
5
- REMOVE = []
6
- SILENCED = []
7
-
8
- def self.add_offset(value = 1)
9
- value = 1 if TrueClass === value
10
- @@offset = offset + value.to_i
11
- @@offset = 0 if @@offset < 0
12
- @@offset
13
- end
14
-
15
- def self.remove_offset(value = 1)
16
- value = 1 if TrueClass === value
17
- @@offset = offset - value.to_i
18
- @@offset = 0 if @@offset < 0
19
- @@offset
20
- end
21
-
22
-
23
- def self.offset
24
- @@offset ||= 0
25
- @@offset = 0 if @@offset < 0
26
- @@offset
27
- end
28
-
29
- def self.new_bar(max, options = {})
30
- cleanup_bars
31
- BAR_MUTEX.synchronize do
32
- Log::LAST.replace "new_bar" if Log::LAST == "progress"
33
- options = Misc.add_defaults options, :depth => BARS.length + Log::ProgressBar.offset
34
- BARS << (bar = ProgressBar.new(max, options))
35
- bar
36
- end
37
- end
38
-
39
- def self.cleanup_bars
40
- BAR_MUTEX.synchronize do
41
- REMOVE.each do |bar|
42
- index = BARS.index bar
43
- if index
44
- BARS.delete_at index
45
- BARS.each_with_index do |bar,i|
46
- bar.depth = i
47
- end
48
- end
49
- index = SILENCED.index bar
50
- if index
51
- SILENCED.delete_at index
52
- SILENCED.each_with_index do |bar,i|
53
- bar.depth = i
54
- end
55
- end
56
- end
57
- REMOVE.clear
58
- BARS.length
59
- end
60
- end
61
-
62
- def self.remove_bar(bar, error = false)
63
- BAR_MUTEX.synchronize do
64
- return if REMOVE.include? bar
65
- end
66
- if error
67
- bar.error if bar.respond_to? :error
68
- else
69
- bar.done if bar.respond_to? :done
70
- end
71
- BAR_MUTEX.synchronize do
72
- REMOVE << bar
73
- end
74
- Log::LAST.replace "remove_bar" if Log::LAST == "progress"
75
- end
76
-
77
- def remove(error = false)
78
- Log::ProgressBar.remove_bar self, error
79
- end
80
-
81
- def self.with_bar(max, options = {})
82
- bar = new_bar(max, options)
83
- res = nil
84
- begin
85
- error = false
86
- keep = false
87
- yield bar
88
- rescue KeepBar
89
- keep = true
90
- rescue
91
- error = true
92
- raise $!
93
- ensure
94
- remove_bar(bar, error) if bar
95
- end
96
- end
97
- end
98
- end
99
-
1
+ #module Log
2
+ # class ProgressBar
3
+ # BAR_MUTEX = Mutex.new
4
+ # BARS = []
5
+ # REMOVE = []
6
+ # SILENCED = []
7
+ #
8
+ # def self.add_offset(value = 1)
9
+ # value = 1 if TrueClass === value
10
+ # @@offset = offset + value.to_i
11
+ # @@offset = 0 if @@offset < 0
12
+ # @@offset
13
+ # end
14
+ #
15
+ # def self.remove_offset(value = 1)
16
+ # value = 1 if TrueClass === value
17
+ # @@offset = offset - value.to_i
18
+ # @@offset = 0 if @@offset < 0
19
+ # @@offset
20
+ # end
21
+ #
22
+ #
23
+ # def self.offset
24
+ # @@offset ||= 0
25
+ # @@offset = 0 if @@offset < 0
26
+ # @@offset
27
+ # end
28
+ #
29
+ # def self.new_bar(max, options = {})
30
+ # cleanup_bars
31
+ # BAR_MUTEX.synchronize do
32
+ # Log::LAST.replace "new_bar" if Log::LAST == "progress"
33
+ # options = Misc.add_defaults options, :depth => BARS.length + Log::ProgressBar.offset
34
+ # BARS << (bar = ProgressBar.new(max, options))
35
+ # bar
36
+ # end
37
+ # end
38
+ #
39
+ # def self.cleanup_bars
40
+ # BAR_MUTEX.synchronize do
41
+ # REMOVE.each do |bar|
42
+ # index = BARS.index bar
43
+ # if index
44
+ # BARS.delete_at index
45
+ # BARS.each_with_index do |bar,i|
46
+ # bar.depth = i
47
+ # end
48
+ # end
49
+ # index = SILENCED.index bar
50
+ # if index
51
+ # SILENCED.delete_at index
52
+ # SILENCED.each_with_index do |bar,i|
53
+ # bar.depth = i
54
+ # end
55
+ # end
56
+ # end
57
+ # REMOVE.clear
58
+ # BARS.length
59
+ # end
60
+ # end
61
+ #
62
+ # def self.remove_bar(bar, error = false)
63
+ # BAR_MUTEX.synchronize do
64
+ # return if REMOVE.include? bar
65
+ # end
66
+ # if error
67
+ # bar.error if bar.respond_to? :error
68
+ # else
69
+ # bar.done if bar.respond_to? :done
70
+ # end
71
+ # BAR_MUTEX.synchronize do
72
+ # REMOVE << bar
73
+ # end
74
+ # Log::LAST.replace "remove_bar" if Log::LAST == "progress"
75
+ # end
76
+ #
77
+ # def remove(error = false)
78
+ # Log::ProgressBar.remove_bar self, error
79
+ # end
80
+ #
81
+ # def self.with_bar(max, options = {})
82
+ # bar = new_bar(max, options)
83
+ # res = nil
84
+ # begin
85
+ # error = false
86
+ # keep = false
87
+ # yield bar
88
+ # rescue KeepBar
89
+ # keep = true
90
+ # rescue
91
+ # error = true
92
+ # raise $!
93
+ # ensure
94
+ # remove_bar(bar, error) if bar
95
+ # end
96
+ # end
97
+ # end
98
+ #end
99
+ #
@@ -1,102 +1,102 @@
1
- require 'rbbt/util/log'
2
- require 'rbbt/util/log/progress/util'
3
- require 'rbbt/util/log/progress/report'
4
- module Log
5
-
6
- def self.no_bar=(value)
7
- @@no_bar = value
8
- end
9
-
10
- def self.no_bar
11
- @@no_bar = false unless defined?(@@no_bar)
12
- (@@no_bar || ENV["RBBT_NO_PROGRESS"]).to_s == "true"
13
- end
14
-
15
- class ProgressBar
16
-
17
- class << self
18
- attr_accessor :default_file
19
- end
20
-
21
- attr_accessor :max, :ticks, :frequency, :depth, :desc, :file, :bytes, :process, :callback
22
-
23
- def initialize(max = nil, options = {})
24
- options = Misc.add_defaults options, :depth => 0, :num_reports => 100, :io => STDERR, :severity => Log.severity, :frequency => 2
25
- depth, num_reports, desc, io, severity, file, bytes, frequency, process, callback = Misc.process_options options, :depth, :num_reports, :desc, :io, :severity, :file, :bytes, :frequency, :process, :callback
26
-
27
- @max = max
28
- @ticks = 0
29
- @frequency = frequency
30
- @last_time = nil
31
- @last_count = nil
32
- @last_percent = nil
33
- @depth = depth
34
- @desc = desc.nil? ? "" : desc.gsub(/\n/,' ')
35
- @file = file
36
- @bytes = bytes
37
- @process = process
38
- @callback = callback
39
- end
40
-
41
- def percent
42
- return 0 if @ticks == 0
43
- return 100 if @max == 0
44
- (@ticks * 100) / @max
45
- end
46
-
47
- def file
48
- @file || ProgressBar.default_file
49
- end
50
-
51
- def init
52
- @ticks, @bytes = 0
53
- @last_time = @last_count = @last_percent = nil
54
- @history, @mean_max, @max_history = nil
55
- @start = @last_time = Time.now
56
- @last_count = 0
57
- report
58
- end
59
-
60
- def tick(step = 1)
61
- return if Log.no_bar
62
- @ticks += step
63
-
64
- time = Time.now
65
- if @last_time.nil?
66
- @last_time = time
67
- @last_count = @ticks
68
- @start = time
69
- return
70
- end
71
-
72
- diff = time - @last_time
73
- report and return if diff >= @frequency
74
- return unless max and max > 0
75
-
76
- percent = self.percent
77
- if @last_percent.nil?
78
- @last_percent = percent
79
- return
80
- end
81
- report and return if percent > @last_percent and diff > 0.3
82
- end
83
-
84
- def pos(pos)
85
- step = pos - (@ticks || 0)
86
- tick(step)
87
- end
88
-
89
- def process(elem)
90
- case res = @process.call(elem)
91
- when FalseClass
92
- nil
93
- when TrueClass
94
- tick
95
- when Integer
96
- pos(res)
97
- when Float
98
- pos(res * max)
99
- end
100
- end
101
- end
102
- end
1
+ #require 'rbbt/util/log'
2
+ #require 'rbbt/util/log/progress/util'
3
+ #require 'rbbt/util/log/progress/report'
4
+ #module Log
5
+ #
6
+ # def self.no_bar=(value)
7
+ # @@no_bar = value
8
+ # end
9
+ #
10
+ # def self.no_bar
11
+ # @@no_bar = false unless defined?(@@no_bar)
12
+ # @@no_bar || ENV["RBBT_NO_PROGRESS"] == "true"
13
+ # end
14
+ #
15
+ # class ProgressBar
16
+ #
17
+ # class << self
18
+ # attr_accessor :default_file
19
+ # end
20
+ #
21
+ # attr_accessor :max, :ticks, :frequency, :depth, :desc, :file, :bytes, :process, :callback
22
+ #
23
+ # def initialize(max = nil, options = {})
24
+ # options = Misc.add_defaults options, :depth => 0, :num_reports => 100, :io => STDERR, :severity => Log.severity, :frequency => 2
25
+ # depth, num_reports, desc, io, severity, file, bytes, frequency, process, callback = Misc.process_options options, :depth, :num_reports, :desc, :io, :severity, :file, :bytes, :frequency, :process, :callback
26
+ #
27
+ # @max = max
28
+ # @ticks = 0
29
+ # @frequency = frequency
30
+ # @last_time = nil
31
+ # @last_count = nil
32
+ # @last_percent = nil
33
+ # @depth = depth
34
+ # @desc = desc.nil? ? "" : desc.gsub(/\n/,' ')
35
+ # @file = file
36
+ # @bytes = bytes
37
+ # @process = process
38
+ # @callback = callback
39
+ # end
40
+ #
41
+ # def percent
42
+ # return 0 if @ticks == 0
43
+ # return 100 if @max == 0
44
+ # (@ticks * 100) / @max
45
+ # end
46
+ #
47
+ # def file
48
+ # @file || ProgressBar.default_file
49
+ # end
50
+ #
51
+ # def init
52
+ # @ticks, @bytes = 0
53
+ # @last_time = @last_count = @last_percent = nil
54
+ # @history, @mean_max, @max_history = nil
55
+ # @start = @last_time = Time.now
56
+ # @last_count = 0
57
+ # report
58
+ # end
59
+ #
60
+ # def tick(step = 1)
61
+ # return if Log.no_bar
62
+ # @ticks += step
63
+ #
64
+ # time = Time.now
65
+ # if @last_time.nil?
66
+ # @last_time = time
67
+ # @last_count = @ticks
68
+ # @start = time
69
+ # return
70
+ # end
71
+ #
72
+ # diff = time - @last_time
73
+ # report and return if diff >= @frequency
74
+ # return unless max and max > 0
75
+ #
76
+ # percent = self.percent
77
+ # if @last_percent.nil?
78
+ # @last_percent = percent
79
+ # return
80
+ # end
81
+ # report and return if percent > @last_percent and diff > 0.3
82
+ # end
83
+ #
84
+ # def pos(pos)
85
+ # step = pos - (@ticks || 0)
86
+ # tick(step)
87
+ # end
88
+ #
89
+ # def process(elem)
90
+ # case res = @process.call(elem)
91
+ # when FalseClass
92
+ # nil
93
+ # when TrueClass
94
+ # tick
95
+ # when Integer
96
+ # pos(res)
97
+ # when Float
98
+ # pos(res * max)
99
+ # end
100
+ # end
101
+ # end
102
+ #end
@@ -0,0 +1,49 @@
1
+ module Log
2
+
3
+ def self._ignore_stderr
4
+ begin
5
+ File.open('/dev/null', 'w') do |f|
6
+ backup_stderr = STDERR.dup
7
+ STDERR.reopen(f)
8
+ begin
9
+ yield
10
+ ensure
11
+ STDERR.reopen backup_stderr
12
+ backup_stderr.close
13
+ end
14
+ end
15
+ rescue Errno::ENOENT
16
+ yield
17
+ end
18
+ end
19
+
20
+
21
+ def self.ignore_stderr(&block)
22
+ _ignore_stderr &block
23
+ end
24
+
25
+ def self._ignore_stdout
26
+ begin
27
+ File.open('/dev/null', 'w') do |f|
28
+ backup_stdout = STDOUT.dup
29
+ STDOUT.reopen(f)
30
+ begin
31
+ yield
32
+ ensure
33
+ STDOUT.reopen backup_stdout
34
+ backup_stdout.close
35
+ end
36
+ end
37
+ rescue Errno::ENOENT
38
+ yield
39
+ end
40
+ end
41
+
42
+
43
+ def self.ignore_stdout(&block)
44
+ _ignore_stdout &block
45
+ end
46
+
47
+ end
48
+
49
+ Rbbt.relay_module_method Misc, :fingerprint, Log, :fingerprint