raykit 0.0.518 → 0.0.520
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 +374 -374
- 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 +310 -310
- data/lib/raykit/default_content.rb +227 -227
- data/lib/raykit/dir.rb +73 -73
- data/lib/raykit/dotnet.rb +174 -174
- data/lib/raykit/environment.rb +115 -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 +362 -362
- data/lib/raykit/installer.rb +17 -17
- data/lib/raykit/log.rb +80 -80
- data/lib/raykit/logevent.rb +29 -29
- data/lib/raykit/logger.rb +100 -100
- 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 -115
- data/lib/raykit/tasks.rb +91 -99
- data/lib/raykit/text.rb +32 -32
- data/lib/raykit/timer.rb +31 -31
- data/lib/raykit/version.rb +95 -95
- data/lib/raykit/vstest.rb +24 -24
- data/lib/raykit/wix.rb +61 -61
- data/lib/raykit/wt.rb +28 -28
- data/lib/raykit/zip.rb +73 -73
- data/lib/raykit.rb +128 -127
- metadata +3 -3
data/lib/raykit.rb
CHANGED
@@ -1,127 +1,128 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rainbow"
|
4
|
-
require "rake/clean"
|
5
|
-
require "open3"
|
6
|
-
require "rake/testtask"
|
7
|
-
require "digest"
|
8
|
-
|
9
|
-
# Constants
|
10
|
-
BUFFER_SIZE = 1024 unless defined?(BUFFER_SIZE)
|
11
|
-
RAKE_DIRECTORY = Rake.application.original_dir unless defined?(RAKE_DIRECTORY)
|
12
|
-
DEFAULT_SUBDIRECTORIES = %w[src test examples] unless defined?(DEFAULT_SUBDIRECTORIES)
|
13
|
-
DEFAULT_FILES = %w[README.md LICENSE.md .gitignore] unless defined?(DEFAULT_FILES)
|
14
|
-
RAYKIT_GLOBALS = true unless defined?(RAYKIT_GLOBALS)
|
15
|
-
RAYKIT_AUTO_SETUP = false unless defined?(RAYKIT_AUTO_SETUP)
|
16
|
-
LOG_FILENAME = ARGV.empty? ? "log/rake.txt" : "log/rake.#{ARGV.join(".")}.txt"
|
17
|
-
|
18
|
-
# Load all the files in the raykit directory
|
19
|
-
|
20
|
-
lib_dir = File.dirname(__FILE__)
|
21
|
-
Dir.glob("#{lib_dir}/raykit/**/*.rb").sort.each { |file| require file }
|
22
|
-
|
23
|
-
# Constants
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rainbow"
|
4
|
+
require "rake/clean"
|
5
|
+
require "open3"
|
6
|
+
require "rake/testtask"
|
7
|
+
require "digest"
|
8
|
+
|
9
|
+
# Constants
|
10
|
+
BUFFER_SIZE = 1024 unless defined?(BUFFER_SIZE)
|
11
|
+
RAKE_DIRECTORY = Rake.application.original_dir unless defined?(RAKE_DIRECTORY)
|
12
|
+
DEFAULT_SUBDIRECTORIES = %w[src test examples] unless defined?(DEFAULT_SUBDIRECTORIES)
|
13
|
+
DEFAULT_FILES = %w[README.md LICENSE.md .gitignore] unless defined?(DEFAULT_FILES)
|
14
|
+
RAYKIT_GLOBALS = true unless defined?(RAYKIT_GLOBALS)
|
15
|
+
RAYKIT_AUTO_SETUP = false unless defined?(RAYKIT_AUTO_SETUP)
|
16
|
+
LOG_FILENAME = ARGV.empty? ? "log/rake.txt" : "log/rake.#{ARGV.join(".")}.txt"
|
17
|
+
|
18
|
+
# Load all the files in the raykit directory
|
19
|
+
|
20
|
+
lib_dir = File.dirname(__FILE__)
|
21
|
+
Dir.glob("#{lib_dir}/raykit/**/*.rb").sort.each { |file| require file }
|
22
|
+
|
23
|
+
# Constants
|
24
|
+
DEV_ROOT = Raykit::Environment::root_dir
|
25
|
+
DEFAULT_GITIGNORE_CONTENT = Raykit::DefaultContent::gitignore unless defined?(DEFAULT_GITIGNORE_CONTENT)
|
26
|
+
PROJECT = Raykit::Project.new
|
27
|
+
SECRETS = Raykit::Secrets.new
|
28
|
+
REPOSITORIES = Raykit::Git::Repositories.new("#{Raykit::Environment.get_dev_dir("log")}/Raykit.Git.Repositories.json")
|
29
|
+
GIT_DIRECTORY = Raykit::Git::Directory.new(Rake.application.original_dir)
|
30
|
+
NUGET_DIR = Raykit::Environment::get_dev_dir("nuget")
|
31
|
+
PUBLISH_DIR = Raykit::Environment::get_dev_dir("publish")
|
32
|
+
|
33
|
+
LOG = Raykit::Logging.new
|
34
|
+
MARKDOWN = Raykit::Markdown.new
|
35
|
+
|
36
|
+
Raykit::MsBuild::fix_msbuild_path
|
37
|
+
|
38
|
+
File.write(".gitignore", DEFAULT_GITIGNORE_CONTENT) unless File.exist?(".gitignore")
|
39
|
+
Raykit::AutoSetup.run if RAYKIT_AUTO_SETUP
|
40
|
+
|
41
|
+
def backup_git_directory
|
42
|
+
if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
|
43
|
+
puts "Backing up #{GIT_DIRECTORY.repository.url}"
|
44
|
+
Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
|
45
|
+
else
|
46
|
+
puts "Environment variable GIT_BACKUP_DIR is not set"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# include Raykit::TopLevel to make run method accessible from the global scope
|
51
|
+
module Raykit
|
52
|
+
module TopLevel
|
53
|
+
def self.run(command, quit_on_failure = true)
|
54
|
+
PROJECT.run(command, quit_on_failure)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
if defined?(RAYKIT_GLOBALS)
|
60
|
+
def run(command, quit_on_failure = true)
|
61
|
+
Raykit::TopLevel.run(command, quit_on_failure)
|
62
|
+
end
|
63
|
+
|
64
|
+
def try(command)
|
65
|
+
Raykit::TopLevel.run(command, false)
|
66
|
+
end
|
67
|
+
|
68
|
+
def dir(name)
|
69
|
+
FileUtils.mkdir("artifacts") if (!Dir.exist?(name))
|
70
|
+
end
|
71
|
+
|
72
|
+
def make(artifact, command)
|
73
|
+
if (File.exist?(artifact))
|
74
|
+
puts " #{artifact} exists"
|
75
|
+
else
|
76
|
+
cmd = run(command)
|
77
|
+
if (cmd.exitstatus != 0)
|
78
|
+
File.delete(artifact) if (File.exist?(artifact))
|
79
|
+
end
|
80
|
+
cmd
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def make_log(artifact, command)
|
85
|
+
if (File.exist?(artifact))
|
86
|
+
puts " #{artifact} exists"
|
87
|
+
else
|
88
|
+
cmd = run(command).log_to_file(artifact)
|
89
|
+
if (cmd.exitstatus != 0)
|
90
|
+
File.delete(artifact) if (File.exist?(artifact))
|
91
|
+
end
|
92
|
+
cmd
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def tag(name)
|
97
|
+
puts Rainbow(": #{name}").blue.bright
|
98
|
+
end
|
99
|
+
|
100
|
+
def start_task(task_name)
|
101
|
+
Raykit::Log.start_task(task_name)
|
102
|
+
end
|
103
|
+
|
104
|
+
def show(symbol)
|
105
|
+
show_binding(symbol, binding)
|
106
|
+
end
|
107
|
+
|
108
|
+
def show_binding(symbol, the_binding)
|
109
|
+
show_value symbol.to_s, eval(symbol.to_s, the_binding)
|
110
|
+
end
|
111
|
+
|
112
|
+
def show_value(name, value)
|
113
|
+
Raykit::Log.show_value(name, value)
|
114
|
+
PROJECT.values[name] = value
|
115
|
+
end
|
116
|
+
|
117
|
+
def show_table(symbols)
|
118
|
+
Raykit::Log.show_table(symbols)
|
119
|
+
end
|
120
|
+
|
121
|
+
def copy_files(src_dir, target_dir, glob)
|
122
|
+
Raykit::FileSystem::copy_files(src_dir, target_dir, glob)
|
123
|
+
end
|
124
|
+
|
125
|
+
def copy_file_to_dir(file, dir)
|
126
|
+
Raykit::FileSystem::copy_file_to_dir(file, dir)
|
127
|
+
end
|
128
|
+
end # if defined?(RAYKIT_GLOBALS)
|
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.520
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
154
|
+
rubygems_version: 3.5.5
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: ruby gem to support rake ci/cd tasks
|