raykit 0.0.287 → 0.0.291
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 +4 -4
- data/lib/raykit/command.rb +40 -0
- data/lib/raykit/environment.rb +3 -0
- data/lib/raykit/logevent.rb +54 -0
- data/lib/raykit/vstest.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 475d2c341577676c9a039c02a38fdfde4c18eb638c864165ac3b9d9112887266
|
4
|
+
data.tar.gz: f1b911ee4a511444bfdb18b712707f35574395e328f5146d7e7948b9a8d021ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80e4920fe00c9ce59d11e7150c462afcb071f912052bdb7e820eccfd5d158cbb7457a5788273d0de8390b0cc85c13cf3b121d118fbd2a0a48dd76573e757057a
|
7
|
+
data.tar.gz: bdc321368e6522528a8767f1fca78cb827502acec1741b7953f91dba93eb9ad148dff8bdd5efbdf9287614beb32fa999b27210014e3e0d8f654eb12f6083618d
|
data/lib/raykit/command.rb
CHANGED
@@ -80,9 +80,49 @@ module Raykit
|
|
80
80
|
end
|
81
81
|
@elapsed = timer.elapsed
|
82
82
|
log
|
83
|
+
to_log_event.to_seq
|
83
84
|
end
|
84
85
|
|
86
|
+
def to_log_event
|
87
|
+
secrets=Secrets.new()
|
88
|
+
msg =secrets.hide(@command)
|
89
|
+
level="Verbose"
|
90
|
+
level="Warning" if @exitstatus != 0
|
91
|
+
Raykit::LogEvent.new(level,msg,{
|
92
|
+
"SourceContext"=>"Raykit::Command",
|
93
|
+
"Timeout"=>@timeout,
|
94
|
+
"Directory"=>@directory,
|
95
|
+
"Output"=>@output,
|
96
|
+
"Error"=>@error,
|
97
|
+
"ExitStatus"=>@exitstatus,
|
98
|
+
"Elapsed"=>elapsed_str
|
99
|
+
})
|
100
|
+
end
|
101
|
+
#@timeout=0
|
102
|
+
#@directory = Dir.pwd
|
103
|
+
#@output = ''
|
104
|
+
#@error = ''
|
105
|
+
#@exitstatus = 0
|
106
|
+
|
85
107
|
def log
|
108
|
+
# --- Rolling File JSON -----
|
109
|
+
log = Logger.new("#{Raykit::Environment::log_dir}/Raykit.Commands.txt",'daily')
|
110
|
+
log.formatter = proc do |severity,datetime,progname,msg|
|
111
|
+
"#{msg}\n"
|
112
|
+
end
|
113
|
+
secrets=Secrets.new()
|
114
|
+
msg =secrets.hide(@command)#"?"# self.summary(false)
|
115
|
+
level="Verbose"
|
116
|
+
level="Warning" if @exitstatus != 0
|
117
|
+
event = Raykit::LogEvent.new(level,msg,{
|
118
|
+
"Timeout"=>@timeout,
|
119
|
+
"Directory"=>@directory,
|
120
|
+
"Output"=>@output,
|
121
|
+
"Error"=>@error,
|
122
|
+
"ExitStatus"=>@exitstatus,
|
123
|
+
"Elapsed"=>elapsed_str})
|
124
|
+
log.info event.to_json
|
125
|
+
# ---------------------------
|
86
126
|
begin
|
87
127
|
json=JSON.generate(to_hash)
|
88
128
|
log_filename = Environment.get_dev_dir('log') + '/Raykit.Command/' + SecureRandom.uuid + '.json'
|
data/lib/raykit/environment.rb
CHANGED
@@ -25,6 +25,9 @@ module Raykit
|
|
25
25
|
normalize_path(ENV['HOME'])
|
26
26
|
end
|
27
27
|
|
28
|
+
def self.log_dir
|
29
|
+
return get_dev_dir('log')
|
30
|
+
end
|
28
31
|
# Get, and create if it does not exist, a specific development directory
|
29
32
|
def self.get_dev_dir(name)
|
30
33
|
dir = Pathname.new("#{Environment::root_dir}/#{name}")
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'json'
|
2
|
+
module Raykit
|
3
|
+
# :verbose, :debug, :information, :error, :fatal
|
4
|
+
class LogEvent < Hash
|
5
|
+
def initialize(level,messageTemplate,properties)
|
6
|
+
self["Timestamp"] = DateTime.now.iso8601
|
7
|
+
self["Level"] = level
|
8
|
+
self["Message"] = messageTemplate
|
9
|
+
self["MessageTemplate"] = messageTemplate
|
10
|
+
#properties["SourceContext"] = "Raykit" if !properties.has_key?('SourceContext')
|
11
|
+
properties["MachineName"] = Raykit::Environment::machine if !properties.has_key?('MachineName')
|
12
|
+
properties["UserName"] = Raykit::Environment::user if !properties.has_key?('UserName')
|
13
|
+
self["Properties"] = properties
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_seq
|
17
|
+
#ENV.each{|ek,ev|
|
18
|
+
# puts "#{ek} #{ev}"
|
19
|
+
#}
|
20
|
+
if !ENV['SEQ_SERVER'].nil?# != nil# && ENV['SEQ_SERVER'].is_set?
|
21
|
+
cmd_str="seqcli log -m \"#{self['Message']}\" -l #{self['Level']} -s #{ENV['SEQ_SERVER']}"
|
22
|
+
self["Properties"].each{|k,v|
|
23
|
+
cmd_str=cmd_str + " -p \"#{k}=#{v}\""
|
24
|
+
}
|
25
|
+
puts `#{cmd_str}`
|
26
|
+
# puts cmd_str
|
27
|
+
#puts `#{cmd_str}`
|
28
|
+
#cmd=Raykit::Command.new(cmd_str)
|
29
|
+
#cmd.run
|
30
|
+
#puts cmd.summary
|
31
|
+
#puts cmd.details
|
32
|
+
#else
|
33
|
+
#puts 'SEQ_SERVER env var not found'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
#{
|
41
|
+
# "Timestamp": "2021-10-06T06:09:25.5275817-06:00",
|
42
|
+
# "Level": "Information",
|
43
|
+
# "MessageTemplate": "MachineName {machine}",
|
44
|
+
# "Properties": {
|
45
|
+
# "machine": "BLUEFIN",
|
46
|
+
# "SourceContext": "cslogging.Program",
|
47
|
+
# "ThreadId": 1,
|
48
|
+
# "ProcessId": 16764,
|
49
|
+
# "ProcessName": "cs-logging",
|
50
|
+
# "MachineName": "\"BLUEFIN\"",
|
51
|
+
# "UserName": "\"loupa\"",
|
52
|
+
# "OS": "Windows_NT"
|
53
|
+
# }
|
54
|
+
#}
|
data/lib/raykit/vstest.rb
CHANGED
@@ -2,8 +2,9 @@ module Raykit
|
|
2
2
|
class VsTest
|
3
3
|
def self.vstest_path
|
4
4
|
['2019/Community/Common7/IDE/CommonExtensions/Microsoft',
|
5
|
+
'2019/Professional/Common7/IDE/Extensions/TestPlatform',
|
5
6
|
'2019/Community/Common7/IDE/Extensions',
|
6
|
-
'2019
|
7
|
+
'2019/Community/Common7/IDE/Extensions/TestPlatform',
|
7
8
|
'2022/Preview/Common7/IDE/Extensions/TestPlatform'].each{|relative_path|
|
8
9
|
['C:/Program Files (x86)/Microsoft Visual Studio/',
|
9
10
|
'C:/Program Files/Microsoft Visual Studio/'].each{|root_path|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raykit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.291
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/raykit/git/repositories.rb
|
89
89
|
- lib/raykit/git/repository.rb
|
90
90
|
- lib/raykit/log.rb
|
91
|
+
- lib/raykit/logevent.rb
|
91
92
|
- lib/raykit/logging.rb
|
92
93
|
- lib/raykit/msbuild.rb
|
93
94
|
- lib/raykit/nugetpackage.rb
|