raykit 0.0.503 → 0.0.505
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/LICENSE +21 -21
- data/README.md +25 -25
- data/bin/raykit +6 -6
- data/lib/raykit/auto_setup.rb +69 -69
- data/lib/raykit/command.rb +373 -373
- data/lib/raykit/conan/buildinfo.rb +69 -69
- data/lib/raykit/conanpackage.rb +49 -49
- data/lib/raykit/configuration.rb +53 -53
- data/lib/raykit/console.rb +318 -314
- data/lib/raykit/default_content.rb +227 -227
- data/lib/raykit/dir.rb +49 -49
- data/lib/raykit/dotnet.rb +174 -174
- data/lib/raykit/environment.rb +114 -114
- data/lib/raykit/filesystem.rb +34 -34
- data/lib/raykit/git/commit.rb +16 -16
- data/lib/raykit/git/directory.rb +216 -216
- data/lib/raykit/git/files.rb +46 -46
- data/lib/raykit/git/repositories.rb +89 -89
- data/lib/raykit/git/repository.rb +376 -376
- data/lib/raykit/installer.rb +17 -17
- data/lib/raykit/log.rb +80 -80
- data/lib/raykit/logevent.rb +49 -49
- data/lib/raykit/logger.rb +98 -0
- data/lib/raykit/logging.rb +57 -57
- data/lib/raykit/markdown.rb +21 -21
- data/lib/raykit/msbuild.rb +54 -54
- data/lib/raykit/nugetpackage.rb +54 -54
- data/lib/raykit/nunit.rb +13 -13
- data/lib/raykit/project.rb +343 -343
- data/lib/raykit/rake.rb +39 -39
- data/lib/raykit/runner.rb +42 -42
- data/lib/raykit/secrets.rb +38 -38
- data/lib/raykit/sourceImport.rb +76 -76
- data/lib/raykit/sourceImports.rb +43 -43
- data/lib/raykit/string.rb +18 -18
- data/lib/raykit/symbols.rb +115 -16
- data/lib/raykit/tasks.rb +99 -99
- data/lib/raykit/text.rb +32 -32
- data/lib/raykit/timer.rb +31 -31
- data/lib/raykit/version.rb +89 -103
- data/lib/raykit/vstest.rb +24 -24
- data/lib/raykit/wt.rb +28 -28
- data/lib/raykit/zip.rb +73 -73
- data/lib/raykit.rb +126 -125
- metadata +4 -3
data/lib/raykit/rake.rb
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "time"
|
4
|
-
|
5
|
-
module Raykit
|
6
|
-
class Rake
|
7
|
-
def self.run(remote, branch, task = "default")
|
8
|
-
repo = Raykit::Git::Repository.new(remote)
|
9
|
-
rel_dir = repo.relative_path
|
10
|
-
commit = repo.latest_commit(branch)
|
11
|
-
log_filename = "#{Environment.get_dev_dir("log")}/RayKit.Runner/#{rel_dir}/#{branch}/#{commit}.json"
|
12
|
-
if File.exist?(log_filename)
|
13
|
-
Command.parse(File.read(log_filename))
|
14
|
-
else
|
15
|
-
run_dir = "#{Environment.get_dev_dir("tmp")}/#{rel_dir}.#{branch}.#{commit}"
|
16
|
-
unless Dir.exist?(run_dir)
|
17
|
-
parent_dir = File.expand_path("..", run_dir)
|
18
|
-
FileUtils.mkdir_p(parent_dir) unless Dir.exist?(parent_dir)
|
19
|
-
cmd = Command.new("git clone #{remote} #{run_dir}")
|
20
|
-
end
|
21
|
-
Dir.chdir(run_dir) do
|
22
|
-
cmd = Command.new("rake #{task}")
|
23
|
-
parent_dir = File.dirname(log_filename)
|
24
|
-
FileUtils.mkdir_p(parent_dir) unless Dir.exist?(parent_dir)
|
25
|
-
File.open(log_filename, "w") do |f|
|
26
|
-
f.write(JSON.generate(cmd.to_hash))
|
27
|
-
end
|
28
|
-
return cmd
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.rake(rakefile, task)
|
34
|
-
Dir.chdir(File.dirname(rakefile)) do
|
35
|
-
Raykit::TopLevel.run("rake #{task}", true)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "time"
|
4
|
+
|
5
|
+
module Raykit
|
6
|
+
class Rake
|
7
|
+
def self.run(remote, branch, task = "default")
|
8
|
+
repo = Raykit::Git::Repository.new(remote)
|
9
|
+
rel_dir = repo.relative_path
|
10
|
+
commit = repo.latest_commit(branch)
|
11
|
+
log_filename = "#{Environment.get_dev_dir("log")}/RayKit.Runner/#{rel_dir}/#{branch}/#{commit}.json"
|
12
|
+
if File.exist?(log_filename)
|
13
|
+
Command.parse(File.read(log_filename))
|
14
|
+
else
|
15
|
+
run_dir = "#{Environment.get_dev_dir("tmp")}/#{rel_dir}.#{branch}.#{commit}"
|
16
|
+
unless Dir.exist?(run_dir)
|
17
|
+
parent_dir = File.expand_path("..", run_dir)
|
18
|
+
FileUtils.mkdir_p(parent_dir) unless Dir.exist?(parent_dir)
|
19
|
+
cmd = Command.new("git clone #{remote} #{run_dir}")
|
20
|
+
end
|
21
|
+
Dir.chdir(run_dir) do
|
22
|
+
cmd = Command.new("rake #{task}")
|
23
|
+
parent_dir = File.dirname(log_filename)
|
24
|
+
FileUtils.mkdir_p(parent_dir) unless Dir.exist?(parent_dir)
|
25
|
+
File.open(log_filename, "w") do |f|
|
26
|
+
f.write(JSON.generate(cmd.to_hash))
|
27
|
+
end
|
28
|
+
return cmd
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.rake(rakefile, task)
|
34
|
+
Dir.chdir(File.dirname(rakefile)) do
|
35
|
+
Raykit::TopLevel.run("rake #{task}", true)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/raykit/runner.rb
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "yaml"
|
4
|
-
|
5
|
-
module Raykit
|
6
|
-
class Runner
|
7
|
-
def self.run(git_url)
|
8
|
-
commands = []
|
9
|
-
local_dir = Dir.mktmpdir("runner")
|
10
|
-
puts "local_dir : #{local_dir}"
|
11
|
-
commands << Raykit::Command.new("git clone #{git_url} #{local_dir}")
|
12
|
-
Dir.chdir(local_dir) do
|
13
|
-
commands << Raykit::Command.new("git log -n 1")
|
14
|
-
yaml = get_build_yaml(local_dir)
|
15
|
-
build_hash = YAML.safe_load(yaml)
|
16
|
-
build_commands = Raykit::Command.parse_yaml_commands(yaml)
|
17
|
-
if build_hash.key?("image")
|
18
|
-
image = build_hash["image"]
|
19
|
-
build_commands.insert(0, "cd home")
|
20
|
-
build_commands.insert(1, "git clone #{git_url} build")
|
21
|
-
build_commands.insert(2, "cd build")
|
22
|
-
build_commands_string = build_commands.join(";")
|
23
|
-
commands << Raykit::Command.new("docker run #{image} sh -c \"#{build_commands_string}\"")
|
24
|
-
else
|
25
|
-
build_commands.each do |cmd_string|
|
26
|
-
commands << Rakkit::Command.new(cmd_string)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
FileUtils.rm_rf(local_dir)
|
31
|
-
commands
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.get_build_yaml(directory)
|
35
|
-
yaml = ""
|
36
|
-
Dir.chdir(directory) do
|
37
|
-
yaml = File.open(".gitlab-ci.yml").read if File.exist?(".gitlab-ci.yml")
|
38
|
-
end
|
39
|
-
yaml
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaml"
|
4
|
+
|
5
|
+
module Raykit
|
6
|
+
class Runner
|
7
|
+
def self.run(git_url)
|
8
|
+
commands = []
|
9
|
+
local_dir = Dir.mktmpdir("runner")
|
10
|
+
puts "local_dir : #{local_dir}"
|
11
|
+
commands << Raykit::Command.new("git clone #{git_url} #{local_dir}")
|
12
|
+
Dir.chdir(local_dir) do
|
13
|
+
commands << Raykit::Command.new("git log -n 1")
|
14
|
+
yaml = get_build_yaml(local_dir)
|
15
|
+
build_hash = YAML.safe_load(yaml)
|
16
|
+
build_commands = Raykit::Command.parse_yaml_commands(yaml)
|
17
|
+
if build_hash.key?("image")
|
18
|
+
image = build_hash["image"]
|
19
|
+
build_commands.insert(0, "cd home")
|
20
|
+
build_commands.insert(1, "git clone #{git_url} build")
|
21
|
+
build_commands.insert(2, "cd build")
|
22
|
+
build_commands_string = build_commands.join(";")
|
23
|
+
commands << Raykit::Command.new("docker run #{image} sh -c \"#{build_commands_string}\"")
|
24
|
+
else
|
25
|
+
build_commands.each do |cmd_string|
|
26
|
+
commands << Rakkit::Command.new(cmd_string)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
FileUtils.rm_rf(local_dir)
|
31
|
+
commands
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.get_build_yaml(directory)
|
35
|
+
yaml = ""
|
36
|
+
Dir.chdir(directory) do
|
37
|
+
yaml = File.open(".gitlab-ci.yml").read if File.exist?(".gitlab-ci.yml")
|
38
|
+
end
|
39
|
+
yaml
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/raykit/secrets.rb
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "time"
|
4
|
-
|
5
|
-
module Raykit
|
6
|
-
# Provides functionality to record the time execution times
|
7
|
-
class Secrets < Hash
|
8
|
-
def initialize
|
9
|
-
if ENV.key?("RAYKIT_SECRETS_PATH")
|
10
|
-
secrets_file = ENV["RAYKIT_SECRETS_PATH"]
|
11
|
-
if File.exist?(secrets_file)
|
12
|
-
text = IO.read(secrets_file)
|
13
|
-
if text.length > 7
|
14
|
-
data = JSON.parse(text)
|
15
|
-
data.each do |key, value|
|
16
|
-
self[key] = value
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def hide(text)
|
24
|
-
hidden = text
|
25
|
-
each do |_k, v|
|
26
|
-
hidden = hidden.gsub(v, "****") if !v.nil? && v.length.positive?
|
27
|
-
end
|
28
|
-
hidden
|
29
|
-
end
|
30
|
-
|
31
|
-
def save
|
32
|
-
if ENV.key?("RAYKIT_SECRETS_PATH")
|
33
|
-
secrets_file = ENV["RAYKIT_SECRETS_PATH"]
|
34
|
-
File.open(secrets_file, "w") { |f| f.puts to_json }
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "time"
|
4
|
+
|
5
|
+
module Raykit
|
6
|
+
# Provides functionality to record the time execution times
|
7
|
+
class Secrets < Hash
|
8
|
+
def initialize
|
9
|
+
if ENV.key?("RAYKIT_SECRETS_PATH")
|
10
|
+
secrets_file = ENV["RAYKIT_SECRETS_PATH"]
|
11
|
+
if File.exist?(secrets_file)
|
12
|
+
text = IO.read(secrets_file)
|
13
|
+
if text.length > 7
|
14
|
+
data = JSON.parse(text)
|
15
|
+
data.each do |key, value|
|
16
|
+
self[key] = value
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def hide(text)
|
24
|
+
hidden = text
|
25
|
+
each do |_k, v|
|
26
|
+
hidden = hidden.gsub(v, "****") if !v.nil? && v.length.positive?
|
27
|
+
end
|
28
|
+
hidden
|
29
|
+
end
|
30
|
+
|
31
|
+
def save
|
32
|
+
if ENV.key?("RAYKIT_SECRETS_PATH")
|
33
|
+
secrets_file = ENV["RAYKIT_SECRETS_PATH"]
|
34
|
+
File.open(secrets_file, "w") { |f| f.puts to_json }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/raykit/sourceImport.rb
CHANGED
@@ -1,76 +1,76 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Raykit
|
4
|
-
class SourceImport < Hash
|
5
|
-
def initialize(url, source, glob, target, commit)
|
6
|
-
self["remote"] = url
|
7
|
-
self["source"] = source
|
8
|
-
self["glob"] = glob
|
9
|
-
self["target"] = target
|
10
|
-
self["commit"] = commit
|
11
|
-
end
|
12
|
-
|
13
|
-
def remote
|
14
|
-
self["remote"]
|
15
|
-
end
|
16
|
-
|
17
|
-
def source
|
18
|
-
self["source"]
|
19
|
-
end
|
20
|
-
|
21
|
-
def target
|
22
|
-
self["target"]
|
23
|
-
end
|
24
|
-
|
25
|
-
def glob
|
26
|
-
self["glob"]
|
27
|
-
end
|
28
|
-
|
29
|
-
def update
|
30
|
-
repo = Raykit::Git::Repository.new(remote)
|
31
|
-
work = repo.get_dev_dir("work")
|
32
|
-
#work = self["remote"].work_dir
|
33
|
-
work_parent = File.dirname(work)
|
34
|
-
FileUtils.mkdir_p(work_parent) unless Dir.exist?(work_parent)
|
35
|
-
if Dir.exist?(work)
|
36
|
-
Dir.chdir(work) do
|
37
|
-
cmd = Command.new("git pull")
|
38
|
-
end
|
39
|
-
else
|
40
|
-
PROJECT.run("git clone #{remote} #{work}")
|
41
|
-
end
|
42
|
-
|
43
|
-
Dir.chdir(work) do
|
44
|
-
text = `git log -n 1`
|
45
|
-
scan = text.scan(/commit (\w+)\s/)
|
46
|
-
self["commit"] = scan[0][0].to_s
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def copy
|
51
|
-
if target.length.zero?
|
52
|
-
puts "target has not been specified"
|
53
|
-
else
|
54
|
-
FileUtils.remove_dir(target) if Dir.exist?(target)
|
55
|
-
count = 0
|
56
|
-
source_names = []
|
57
|
-
work = self["remote"].work_dir
|
58
|
-
Dir.chdir(work) do
|
59
|
-
cmd = Command.new("rake clean") if File.exist?("rakefile.rb")
|
60
|
-
Dir.chdir(source) do
|
61
|
-
source_names = Dir.glob(self["glob"])
|
62
|
-
end
|
63
|
-
end
|
64
|
-
source_names.each do |source_name|
|
65
|
-
source_file = "#{work}/#{source}/#{source_name}"
|
66
|
-
target_name = "#{target}/#{source_name}"
|
67
|
-
target_parent = File.dirname(target_name)
|
68
|
-
FileUtils.mkdir_p(target_parent) unless Dir.exist?(target_parent)
|
69
|
-
FileUtils.copy(source_file, target_name)
|
70
|
-
count += 1
|
71
|
-
end
|
72
|
-
puts " copied #{count} files to #{target}"
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Raykit
|
4
|
+
class SourceImport < Hash
|
5
|
+
def initialize(url, source, glob, target, commit)
|
6
|
+
self["remote"] = url
|
7
|
+
self["source"] = source
|
8
|
+
self["glob"] = glob
|
9
|
+
self["target"] = target
|
10
|
+
self["commit"] = commit
|
11
|
+
end
|
12
|
+
|
13
|
+
def remote
|
14
|
+
self["remote"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def source
|
18
|
+
self["source"]
|
19
|
+
end
|
20
|
+
|
21
|
+
def target
|
22
|
+
self["target"]
|
23
|
+
end
|
24
|
+
|
25
|
+
def glob
|
26
|
+
self["glob"]
|
27
|
+
end
|
28
|
+
|
29
|
+
def update
|
30
|
+
repo = Raykit::Git::Repository.new(remote)
|
31
|
+
work = repo.get_dev_dir("work")
|
32
|
+
#work = self["remote"].work_dir
|
33
|
+
work_parent = File.dirname(work)
|
34
|
+
FileUtils.mkdir_p(work_parent) unless Dir.exist?(work_parent)
|
35
|
+
if Dir.exist?(work)
|
36
|
+
Dir.chdir(work) do
|
37
|
+
cmd = Command.new("git pull")
|
38
|
+
end
|
39
|
+
else
|
40
|
+
PROJECT.run("git clone #{remote} #{work}")
|
41
|
+
end
|
42
|
+
|
43
|
+
Dir.chdir(work) do
|
44
|
+
text = `git log -n 1`
|
45
|
+
scan = text.scan(/commit (\w+)\s/)
|
46
|
+
self["commit"] = scan[0][0].to_s
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def copy
|
51
|
+
if target.length.zero?
|
52
|
+
puts "target has not been specified"
|
53
|
+
else
|
54
|
+
FileUtils.remove_dir(target) if Dir.exist?(target)
|
55
|
+
count = 0
|
56
|
+
source_names = []
|
57
|
+
work = self["remote"].work_dir
|
58
|
+
Dir.chdir(work) do
|
59
|
+
cmd = Command.new("rake clean") if File.exist?("rakefile.rb")
|
60
|
+
Dir.chdir(source) do
|
61
|
+
source_names = Dir.glob(self["glob"])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
source_names.each do |source_name|
|
65
|
+
source_file = "#{work}/#{source}/#{source_name}"
|
66
|
+
target_name = "#{target}/#{source_name}"
|
67
|
+
target_parent = File.dirname(target_name)
|
68
|
+
FileUtils.mkdir_p(target_parent) unless Dir.exist?(target_parent)
|
69
|
+
FileUtils.copy(source_file, target_name)
|
70
|
+
count += 1
|
71
|
+
end
|
72
|
+
puts " copied #{count} files to #{target}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
data/lib/raykit/sourceImports.rb
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Raykit
|
4
|
-
class SourceImports < Array
|
5
|
-
def initialize(urls)
|
6
|
-
urls.each do |url|
|
7
|
-
self << SourceImport.new(url, "src", "**/*.cs", "dep", "")
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def update
|
12
|
-
each(&:update)
|
13
|
-
end
|
14
|
-
|
15
|
-
def copy
|
16
|
-
each(&:copy)
|
17
|
-
end
|
18
|
-
|
19
|
-
def targets_exist?
|
20
|
-
each do |si|
|
21
|
-
return false unless Dir.exist?(si.target)
|
22
|
-
end
|
23
|
-
true
|
24
|
-
end
|
25
|
-
|
26
|
-
def save(filename)
|
27
|
-
File.open(filename, "w") do |f|
|
28
|
-
f.write(JSON.pretty_generate(self))
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.load(filename)
|
33
|
-
sourceImports = SourceImports.new([])
|
34
|
-
array = JSON.parse(IO.read(filename))
|
35
|
-
array.each do |hash|
|
36
|
-
sourceImport = SourceImport.new(hash["remote"], hash["source"], hash["glob"], hash["target"],
|
37
|
-
hash["commit"])
|
38
|
-
sourceImports << sourceImport
|
39
|
-
end
|
40
|
-
sourceImports
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Raykit
|
4
|
+
class SourceImports < Array
|
5
|
+
def initialize(urls)
|
6
|
+
urls.each do |url|
|
7
|
+
self << SourceImport.new(url, "src", "**/*.cs", "dep", "")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def update
|
12
|
+
each(&:update)
|
13
|
+
end
|
14
|
+
|
15
|
+
def copy
|
16
|
+
each(&:copy)
|
17
|
+
end
|
18
|
+
|
19
|
+
def targets_exist?
|
20
|
+
each do |si|
|
21
|
+
return false unless Dir.exist?(si.target)
|
22
|
+
end
|
23
|
+
true
|
24
|
+
end
|
25
|
+
|
26
|
+
def save(filename)
|
27
|
+
File.open(filename, "w") do |f|
|
28
|
+
f.write(JSON.pretty_generate(self))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.load(filename)
|
33
|
+
sourceImports = SourceImports.new([])
|
34
|
+
array = JSON.parse(IO.read(filename))
|
35
|
+
array.each do |hash|
|
36
|
+
sourceImport = SourceImport.new(hash["remote"], hash["source"], hash["glob"], hash["target"],
|
37
|
+
hash["commit"])
|
38
|
+
sourceImports << sourceImport
|
39
|
+
end
|
40
|
+
sourceImports
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/raykit/string.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative("./environment")
|
4
|
-
|
5
|
-
class String
|
6
|
-
def work_dir
|
7
|
-
rel_name = sub("https://", "").gsub("http://", "").gsub(".git", "")
|
8
|
-
"#{Raykit::Environment.get_dev_dir("work")}/#{rel_name}"
|
9
|
-
end
|
10
|
-
|
11
|
-
def latest_commit
|
12
|
-
Dir.chdir(self) do
|
13
|
-
text = `git log -n 1`
|
14
|
-
scan = text.scan(/commit (\w+)\s/)
|
15
|
-
return scan[0][0].to_s
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative("./environment")
|
4
|
+
|
5
|
+
class String
|
6
|
+
def work_dir
|
7
|
+
rel_name = sub("https://", "").gsub("http://", "").gsub(".git", "")
|
8
|
+
"#{Raykit::Environment.get_dev_dir("work")}/#{rel_name}"
|
9
|
+
end
|
10
|
+
|
11
|
+
def latest_commit
|
12
|
+
Dir.chdir(self) do
|
13
|
+
text = `git log -n 1`
|
14
|
+
scan = text.scan(/commit (\w+)\s/)
|
15
|
+
return scan[0][0].to_s
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/raykit/symbols.rb
CHANGED
@@ -1,16 +1,115 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
# https://symbl.cc/en/unicode/table/
|
2
|
+
module Raykit
|
3
|
+
class Symbols
|
4
|
+
def self.checkmark
|
5
|
+
Rainbow("\u2713").green
|
6
|
+
end
|
7
|
+
def self.success
|
8
|
+
Rainbow("\u2713").green
|
9
|
+
end
|
10
|
+
def self.error
|
11
|
+
Rainbow("\u0058").red
|
12
|
+
end
|
13
|
+
def self.warning
|
14
|
+
Rainbow("\u26A0").yellow
|
15
|
+
end
|
16
|
+
def self.debug
|
17
|
+
Rainbow("\u24D8").blue # Circle with "i"
|
18
|
+
end
|
19
|
+
def self.info
|
20
|
+
Rainbow("\u2139").blue # Information source
|
21
|
+
end
|
22
|
+
def self.fatal
|
23
|
+
Rainbow("\u25A0").bright.red # Filled square, indicating stop/critical
|
24
|
+
end
|
25
|
+
def self.warn
|
26
|
+
Rainbow("\u26A0").yellow # Warning sign
|
27
|
+
end
|
28
|
+
def self.star
|
29
|
+
Rainbow("\u2605").yellow # Star
|
30
|
+
end
|
31
|
+
def self.coffee
|
32
|
+
Rainbow("\u2615").yellow # Hot beverage
|
33
|
+
end
|
34
|
+
def self.heart
|
35
|
+
Rainbow("\u2764").red # Heavy black heart
|
36
|
+
end
|
37
|
+
def self.bug
|
38
|
+
Rainbow("\u1F41E").yellow # Bug
|
39
|
+
end
|
40
|
+
def self.gear
|
41
|
+
Rainbow("\u2699").yellow # Gear
|
42
|
+
end
|
43
|
+
def self.magnifying_glass
|
44
|
+
Rainbow("\u1F50D").yellow # Left-pointing magnifying glass
|
45
|
+
end
|
46
|
+
def self.question
|
47
|
+
Rainbow("\u003F").yellow # Question mark
|
48
|
+
end
|
49
|
+
def self.arrow_right
|
50
|
+
Rainbow("\u27A4").yellow # Arrow pointing rightwards then curving upwards
|
51
|
+
end
|
52
|
+
def self.arrow_left
|
53
|
+
Rainbow("\u2B05").yellow # Left arrow
|
54
|
+
end
|
55
|
+
def self.arrow_up
|
56
|
+
Rainbow("\u2B06").yellow # Up arrow
|
57
|
+
end
|
58
|
+
def self.arrow_down
|
59
|
+
Rainbow("\u2B07").yellow # Down arrow
|
60
|
+
end
|
61
|
+
def self.arrow_up_down
|
62
|
+
Rainbow("\u2195").yellow # Up/down arrow
|
63
|
+
end
|
64
|
+
def self.arrow_left_right
|
65
|
+
Rainbow("\u2194").yellow # Left/right arrow
|
66
|
+
end
|
67
|
+
def self.arrow_upper_right
|
68
|
+
Rainbow("\u2197").yellow # North east arrow
|
69
|
+
end
|
70
|
+
def self.arrow_lower_right
|
71
|
+
Rainbow("\u2198").yellow # South east arrow
|
72
|
+
end
|
73
|
+
def self.arrow_lower_left
|
74
|
+
Rainbow("\u2199").yellow # South west arrow
|
75
|
+
end
|
76
|
+
def self.arrow_upper_left
|
77
|
+
Rainbow("\u2196").yellow # North west arrow
|
78
|
+
end
|
79
|
+
def self.arrow_up_small
|
80
|
+
Rainbow("\u2B06").yellow # Up arrow
|
81
|
+
end
|
82
|
+
def self.arrow_down_small
|
83
|
+
Rainbow("\u2B07").yellow # Down arrow
|
84
|
+
end
|
85
|
+
def self.arrow_right_small
|
86
|
+
Rainbow("\u27A1").yellow # Black rightwards arrow
|
87
|
+
end
|
88
|
+
def self.arrow_left_small
|
89
|
+
Rainbow("\u2B05").yellow # Left arrow
|
90
|
+
end
|
91
|
+
def self.arrow_up_down_small
|
92
|
+
Rainbow("\u2195").yellow # Up/down arrow
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.music
|
96
|
+
Rainbow("\u266B").yellow # Beamed eighth notes
|
97
|
+
end
|
98
|
+
def self.get_severity_symbol(severity)
|
99
|
+
case severity
|
100
|
+
when "DEBUG"
|
101
|
+
question
|
102
|
+
#when "INFO"
|
103
|
+
# info
|
104
|
+
when "WARN"
|
105
|
+
warning
|
106
|
+
when "ERROR"
|
107
|
+
error
|
108
|
+
when "FATAL"
|
109
|
+
fatal
|
110
|
+
else
|
111
|
+
" "
|
112
|
+
end
|
113
|
+
end # def get_severity_symbol
|
114
|
+
end # class Symbols
|
115
|
+
end # module Raykit
|