raykit 0.0.387 → 0.0.390
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 +10 -0
- data/lib/raykit/git/repository.rb +20 -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: bb12af1057aa3299989b7abf7f72ec212d29ceb8b05bd4df3ec3b22d79186785
|
4
|
+
data.tar.gz: 8a9fe0bea74febde15c5805f9e6ccedd4cbbcb10dccbafc3e12c7fe6c4ce7280
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a0179beb632abaf48dcf2e322d6269f64f2237c4c92a52a77bc697114c6ec097d583e24f6f02e7d6a7c83f834ff34f351ff736302ef5d336e508298a00a8db2
|
7
|
+
data.tar.gz: 5d9942a5e7bfefee3d751ac6423ef42090e7339b9db4bab6f6060c2db25126096719ec687565bf9b940c1983861364e72fb3b630c890dadb2ca04319bf118b54
|
data/README.md
CHANGED
data/lib/raykit/command.rb
CHANGED
@@ -224,6 +224,16 @@ module Raykit
|
|
224
224
|
end
|
225
225
|
end
|
226
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
|
+
|
227
237
|
def save
|
228
238
|
filename = "#{Environment.get_dev_dir("log")}/Commands/#{SecureRandom.uuid}"
|
229
239
|
log_dir = File.dirname(filename)
|
@@ -134,6 +134,26 @@ 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
|
+
if (Dir.exists?(make_dir))
|
143
|
+
Dir.chdir(make_dir) do
|
144
|
+
run("git pull")
|
145
|
+
end
|
146
|
+
else
|
147
|
+
run("git clone #{url} #{make_dir}")
|
148
|
+
end
|
149
|
+
cmd = 0
|
150
|
+
Dir.chdir(make_dir) do
|
151
|
+
run("git checkout #{commit_id}")
|
152
|
+
cmd = run(command)
|
153
|
+
end
|
154
|
+
FileUtils.rm_rf(make_dir) if (cmd.exitstatus == 0)
|
155
|
+
cmd
|
156
|
+
end
|
137
157
|
end
|
138
158
|
end
|
139
159
|
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.390
|
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-03 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
|