raykit 0.0.386 → 0.0.389
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/raykit/command.rb +17 -1
- data/lib/raykit/git/repository.rb +14 -0
- data/lib/raykit/log.rb +2 -0
- data/lib/raykit/markdown.rb +23 -0
- data/lib/raykit/project.rb +29 -3
- data/lib/raykit.rb +2 -0
- 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: 495874b4f65044b7da3ef46229a5329a2969814fd0ddb991ae949740b3ced40c
|
4
|
+
data.tar.gz: 4e7c5caf03157ae055c9c3778ef7e4e46484f84b5f9b11ccd05b64319daa42ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b9f4d01d7a20cc9307e7374bdb2fb0cad4efe51e448958e652c7f56fbd31efe735fa1d33e491625559ec4fa4417de7de4e52f75ea77505316ddc1745a447958
|
7
|
+
data.tar.gz: d0b05e5451a9dbb34b55678f4f01aad1753a91ab33318b3b5eeb836503cc99c15f4974b1321517201c3d446cebedb7f29d6f2aa7d310ef8e96e371d082b6a0d9
|
data/README.md
CHANGED
data/lib/raykit/command.rb
CHANGED
@@ -77,6 +77,12 @@ module Raykit
|
|
77
77
|
rescue IO::WaitReadable
|
78
78
|
rescue EOFError
|
79
79
|
@exitstatus = thread.value.exitstatus
|
80
|
+
until stdout.eof?
|
81
|
+
@output << stdout.read_nonblock(BUFFER_SIZE)
|
82
|
+
end
|
83
|
+
until stderr.eof?
|
84
|
+
@error << stderr.read_nonblock(BUFFER_SIZE)
|
85
|
+
end
|
80
86
|
break
|
81
87
|
end
|
82
88
|
end
|
@@ -205,7 +211,7 @@ module Raykit
|
|
205
211
|
end
|
206
212
|
|
207
213
|
def details
|
208
|
-
puts "exit_code: " + @exitstatus.to_s
|
214
|
+
puts " exit_code: " + @exitstatus.to_s
|
209
215
|
if @output.length > 0
|
210
216
|
@output.lines.each do |line|
|
211
217
|
puts " " + line
|
@@ -218,6 +224,16 @@ module Raykit
|
|
218
224
|
end
|
219
225
|
end
|
220
226
|
|
227
|
+
def to_markdown
|
228
|
+
checkmark = "\u2713"
|
229
|
+
error = "\u0058"
|
230
|
+
symbol = checkmark.encode("utf-8")
|
231
|
+
symbol = error.encode("utf-8") if @exitstatus != 0
|
232
|
+
cmd = "#{SECRETS.hide(@command)}"
|
233
|
+
md = "#{symbol} #{SECRETS.hide(@command)} (#{elapsed_str})"
|
234
|
+
md
|
235
|
+
end
|
236
|
+
|
221
237
|
def save
|
222
238
|
filename = "#{Environment.get_dev_dir("log")}/Commands/#{SecureRandom.uuid}"
|
223
239
|
log_dir = File.dirname(filename)
|
@@ -134,6 +134,20 @@ module Raykit
|
|
134
134
|
run(cmd)
|
135
135
|
end
|
136
136
|
end
|
137
|
+
|
138
|
+
def self.make(url, commit_id, command)
|
139
|
+
repo = Raykit::Git::Repository.new(url)
|
140
|
+
make_dir = repo.get_dev_dir("make") + "/" + commit_id
|
141
|
+
FileUtils.mkdir_p(repo.get_dev_dir("make")) if !Dir.exists?(repo.get_dev_dir("make"))
|
142
|
+
run("git clone #{url} #{make_dir}") if (!Dir.exists?(make_dir))
|
143
|
+
cmd = 0
|
144
|
+
Dir.chdir(make_dir) do
|
145
|
+
run("git checkout #{commit_id}")
|
146
|
+
cmd = run(command)
|
147
|
+
end
|
148
|
+
FileUtils.rm_rf(make_dir) if (cmd.exitstatus == 0)
|
149
|
+
cmd
|
150
|
+
end
|
137
151
|
end
|
138
152
|
end
|
139
153
|
end
|
data/lib/raykit/log.rb
CHANGED
@@ -42,10 +42,12 @@ module Raykit
|
|
42
42
|
|
43
43
|
def self.start_task(task_name)
|
44
44
|
puts Rainbow(": #{task_name}").blue.bright
|
45
|
+
MARKDOWN.puts(": #{task_name}")
|
45
46
|
end
|
46
47
|
|
47
48
|
def self.show_value(name, value)
|
48
49
|
puts " " + Rainbow(name).cyan + " " + Rainbow("#{value}").white.bold
|
50
|
+
MARKDOWN.puts("#{name} #{value}")
|
49
51
|
end
|
50
52
|
end
|
51
53
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Raykit
|
2
|
+
class Markdown
|
3
|
+
attr_accessor :text
|
4
|
+
|
5
|
+
def initialize()
|
6
|
+
@text = ""
|
7
|
+
end
|
8
|
+
|
9
|
+
def puts(line)
|
10
|
+
@text = @text + "\n" + line
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s()
|
14
|
+
@text
|
15
|
+
end
|
16
|
+
|
17
|
+
def save_as(filename)
|
18
|
+
File.write("rake.md", @text)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
MARKDOWN = Raykit::Markdown.new
|
data/lib/raykit/project.rb
CHANGED
@@ -14,6 +14,8 @@ module Raykit
|
|
14
14
|
@repository
|
15
15
|
@git_directory
|
16
16
|
@timeout
|
17
|
+
@values
|
18
|
+
@commands
|
17
19
|
|
18
20
|
# @log
|
19
21
|
# @commit_message_filename
|
@@ -53,6 +55,8 @@ module Raykit
|
|
53
55
|
end
|
54
56
|
end
|
55
57
|
@repository = Raykit::Git::Repository.new(@remote)
|
58
|
+
@values = Hash::new()
|
59
|
+
@commands = Array::new()
|
56
60
|
end
|
57
61
|
|
58
62
|
def get_dev_dir(subdir)
|
@@ -75,6 +79,10 @@ module Raykit
|
|
75
79
|
@git_directory.branch
|
76
80
|
end
|
77
81
|
|
82
|
+
def values
|
83
|
+
@values
|
84
|
+
end
|
85
|
+
|
78
86
|
# latest local commit
|
79
87
|
def latest_commit
|
80
88
|
return "" if detached?
|
@@ -211,9 +219,28 @@ module Raykit
|
|
211
219
|
self
|
212
220
|
end
|
213
221
|
|
222
|
+
def to_markdown()
|
223
|
+
md = "# #{@name}"
|
224
|
+
md += get_markdown_nvp("Name", "Value", " ")
|
225
|
+
md += get_markdown_nvp("-", "-", "-")
|
226
|
+
md += get_markdown_nvp("Version", "#{@version}", " ")
|
227
|
+
md += get_markdown_nvp("Machine", "#{Raykit::Environment::machine}", " ")
|
228
|
+
md += get_markdown_nvp("User", "#{Raykit::Environment::user}", " ")
|
229
|
+
@values.each do |key, value|
|
230
|
+
md += get_markdown_nvp(key, value, " ")
|
231
|
+
end
|
232
|
+
@commands.each do |cmd|
|
233
|
+
md = md + "\n" + cmd.to_markdown
|
234
|
+
end
|
235
|
+
md
|
236
|
+
end
|
237
|
+
|
238
|
+
def get_markdown_nvp(key, value, pad_char)
|
239
|
+
"\n| " + key.to_s.ljust(36, pad_char) + "| " + value.to_s.ljust(36, pad_char)
|
240
|
+
end
|
241
|
+
|
214
242
|
def summary
|
215
243
|
info if @verbose
|
216
|
-
|
217
244
|
puts "[#{elapsed}] #{Rainbow(@name).yellow.bright} #{Rainbow(version).yellow.bright}"
|
218
245
|
end
|
219
246
|
|
@@ -295,13 +322,12 @@ module Raykit
|
|
295
322
|
else
|
296
323
|
# display error details
|
297
324
|
cmd.details
|
298
|
-
#puts cmd.output
|
299
|
-
#$stderr.puts cmd.error
|
300
325
|
if quit_on_failure
|
301
326
|
abort
|
302
327
|
end
|
303
328
|
end
|
304
329
|
cmd.save
|
330
|
+
@commands << cmd
|
305
331
|
cmd
|
306
332
|
end
|
307
333
|
end
|
data/lib/raykit.rb
CHANGED
@@ -10,6 +10,7 @@ lib_dir = File.dirname(__FILE__)
|
|
10
10
|
Dir.glob("#{lib_dir}/raykit/**/*.rb").sort.each { |file| require file }
|
11
11
|
|
12
12
|
PROJECT = Raykit::Project.new
|
13
|
+
|
13
14
|
SECRETS = Raykit::Secrets.new
|
14
15
|
|
15
16
|
REPOSITORIES = Raykit::Git::Repositories.new("#{Raykit::Environment.get_dev_dir("log")}/Raykit.Git.Repositories.json")
|
@@ -38,6 +39,7 @@ if defined?(RAYKIT_GLOBALS)
|
|
38
39
|
|
39
40
|
def show_value(name, value)
|
40
41
|
Raykit::Log.show_value(name, value)
|
42
|
+
PROJECT.values[name] = value
|
41
43
|
end
|
42
44
|
|
43
45
|
def copy_files(src_dir, target_dir, glob)
|
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.389
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- lib/raykit/log.rb
|
108
108
|
- lib/raykit/logevent.rb
|
109
109
|
- lib/raykit/logging.rb
|
110
|
+
- lib/raykit/markdown.rb
|
110
111
|
- lib/raykit/msbuild.rb
|
111
112
|
- lib/raykit/nugetpackage.rb
|
112
113
|
- lib/raykit/nunit.rb
|