raykit 0.0.294 → 0.0.295

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: 8b6177f443db46c28789f068488eec50e046c17b61e41d63e35218d0befe6d61
4
- data.tar.gz: a2d839f3b92530ba561e86540663e94667f6bf8b1ba45cd28e75ce7d75adfddc
3
+ metadata.gz: 995c8014a111cf1b66db5fdbec5ece6997ba156e2494840d3e79f336d2b69430
4
+ data.tar.gz: 6f425afbc22622251bda0aa7efed493fa20fe3d3c8297f9de99d7ad5823cf517
5
5
  SHA512:
6
- metadata.gz: 63fd59d747e3ad97e34cacd98f3db5075dcbf3b86d295fab8c35f384aeef2879131586df881d02061535dee439e31f9cf54b0835c89382b23e9259c48514d1cf
7
- data.tar.gz: 437ccb3ec223d0594c96bbce69bf4e923f725386c3a3552a452edf2d9ba7d957ab361769c86bb69ca3a9a45cd093081b8bef6e987fc5a0daeffc0b6c62b3fc1e
6
+ metadata.gz: 2f70199504895475dbe9024db7e5b70286bd57fc752cb49f0df73c2403ba083411811a83c6c2c576971437c0d0116f0abbf8682596329b68f3738f85d7cad3cf
7
+ data.tar.gz: f7dc1c62f53a40e9232b44be550f2b6faad8a245d3ab4f843afb4cc84ec06ea659e6d4d70d19f329a82146cda38601a133dee81637d58c3458f95d9bfe52e08a
@@ -20,6 +20,8 @@ module Raykit
20
20
  attr_accessor :elapsed
21
21
  attr_accessor :command,:output,:error,:exitstatus
22
22
  attr_accessor :user,:machine
23
+ attr_accessor :logging_enabled
24
+ attr_accessor :success_log_level
23
25
 
24
26
  def init_defaults
25
27
  @timeout=0
@@ -29,11 +31,13 @@ module Raykit
29
31
  @exitstatus = 0
30
32
  @user = Environment.user
31
33
  @machine=Environment.machine
34
+ @logging_enabled = true
32
35
  end
33
36
 
34
- def initialize(command,timeout=0)
37
+ def initialize(command,timeout=0,success_log_level=nil,logging_enabled=true)
35
38
  @@commands=Array.new
36
39
  init_defaults
40
+ @logging_enabled=logging_enabled
37
41
  @command=command
38
42
  @timeout=timeout
39
43
  if(@command.length > 0)
@@ -73,14 +77,27 @@ module Raykit
73
77
  Process.kill("TERM", pid)
74
78
  end
75
79
  @exitstatus=5
80
+ @error="timed out"
76
81
  else
77
82
  @exitstatus=thread.value.exitstatus
78
83
  end
79
84
  }
80
85
  end
81
86
  @elapsed = timer.elapsed
82
- log
83
- to_log_event.to_seq if @exitstatus != 0
87
+ if @logging_enabled
88
+ log
89
+ if @exitstatus != 0
90
+ to_log_event.to_seq
91
+ else
92
+ if !@success_log_level.nil?
93
+ e = to_log_event
94
+ e.level = "Verbose" if @success_log_level = Logging::Verbose
95
+ e.level = "Debug" if @success_log_level = Logging::Debug
96
+ e.level = "Information" if @success_log_level = Logging::Information
97
+ e.to_seq
98
+ end
99
+ end
100
+ end
84
101
  end
85
102
 
86
103
  def to_log_event
@@ -89,7 +89,7 @@ module Raykit
89
89
  end
90
90
 
91
91
  def get_tag_commit_id(name)
92
- cmd = Raykit::Command.new("git rev-parse \"#{name}\"")
92
+ cmd = Raykit::Command.new("git rev-parse \"#{name}\"",0,nil,false)
93
93
  if !cmd.output.include?('fatal') && !cmd.error.include?('fatal')
94
94
  cmd.output.strip()
95
95
  else
@@ -282,11 +282,11 @@ module Raykit
282
282
  self
283
283
  end
284
284
 
285
- def run(command,quit_on_failure=true)
285
+ def run(command,quit_on_failure=true,success_log_level=nil)
286
286
  if(command.kind_of?(Array))
287
287
  command.each{|subcommand| run(subcommand,quit_on_failure)}
288
288
  else
289
- cmd = Command.new(command)
289
+ cmd = Command.new(command,0,success_log_level)
290
290
  cmd.summary
291
291
  cmd.save
292
292
  elapsed_str = Timer.get_elapsed_str(cmd.elapsed,0)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.294
4
+ version: 0.0.295
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow