raykit 0.0.540 → 0.0.542
Sign up to get free protection for your applications and to get access to all the features.
- 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 +8 -8
- data/lib/raykit/default_content.txt +219 -219
- data/lib/raykit/dir.rb +127 -127
- data/lib/raykit/dotnet.rb +174 -174
- data/lib/raykit/environment.rb +115 -115
- data/lib/raykit/filesystem.rb +34 -34
- data/lib/raykit/git/commit.rb +16 -16
- data/lib/raykit/git/directory.rb +280 -273
- 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 -91
- 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 +140 -140
- metadata +2 -2
data/lib/raykit.rb
CHANGED
@@ -1,140 +1,140 @@
|
|
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
|
-
ARTIFACTS_DIR = Raykit::Environment::get_dev_dir("artifacts")
|
33
|
-
|
34
|
-
LAST_MODIFIED_SOURCE_FILE = GIT_DIRECTORY.last_modified_src_file
|
35
|
-
LAST_MODIFIED_SOURCE_TIME = GIT_DIRECTORY.last_modified_src_time
|
36
|
-
LAST_MODIFIED_FILE = GIT_DIRECTORY.last_modified_filename
|
37
|
-
LAST_MODIFIED_TIME = GIT_DIRECTORY.last_modified_time
|
38
|
-
LAST_MODIFIED_ARTIFACT_TIME = GIT_DIRECTORY.last_modified_artifact_time
|
39
|
-
|
40
|
-
LOG = Raykit::Logging.new
|
41
|
-
MARKDOWN = Raykit::Markdown.new
|
42
|
-
|
43
|
-
Raykit::MsBuild::fix_msbuild_path
|
44
|
-
|
45
|
-
File.write(".gitignore", DEFAULT_GITIGNORE_CONTENT) unless File.exist?(".gitignore")
|
46
|
-
Raykit::AutoSetup.run if RAYKIT_AUTO_SETUP
|
47
|
-
|
48
|
-
def backup_git_directory
|
49
|
-
if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
|
50
|
-
puts "Backing up #{GIT_DIRECTORY.repository.url}"
|
51
|
-
Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
|
52
|
-
else
|
53
|
-
puts "Environment variable GIT_BACKUP_DIR is not set"
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# include Raykit::TopLevel to make run method accessible from the global scope
|
58
|
-
module Raykit
|
59
|
-
module TopLevel
|
60
|
-
def self.run(command, quit_on_failure = true)
|
61
|
-
PROJECT.run(command, quit_on_failure)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
if defined?(RAYKIT_GLOBALS)
|
67
|
-
def run(command, quit_on_failure = true)
|
68
|
-
Raykit::TopLevel.run(command, quit_on_failure)
|
69
|
-
end
|
70
|
-
|
71
|
-
def run_details(command)
|
72
|
-
cmd = Raykit::Command.new(command).run
|
73
|
-
cmd.details
|
74
|
-
end
|
75
|
-
|
76
|
-
def try(command)
|
77
|
-
Raykit::TopLevel.run(command, false)
|
78
|
-
end
|
79
|
-
|
80
|
-
def dir(name)
|
81
|
-
FileUtils.mkdir("artifacts") if (!Dir.exist?(name))
|
82
|
-
end
|
83
|
-
|
84
|
-
def make(artifact, command)
|
85
|
-
if (File.exist?(artifact))
|
86
|
-
puts " #{artifact} exists"
|
87
|
-
else
|
88
|
-
cmd = run(command)
|
89
|
-
if (cmd.exitstatus != 0)
|
90
|
-
File.delete(artifact) if (File.exist?(artifact))
|
91
|
-
end
|
92
|
-
cmd
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def make_log(artifact, command)
|
97
|
-
if (File.exist?(artifact))
|
98
|
-
puts " #{artifact} exists"
|
99
|
-
else
|
100
|
-
cmd = run(command).log_to_file(artifact)
|
101
|
-
if (cmd.exitstatus != 0)
|
102
|
-
File.delete(artifact) if (File.exist?(artifact))
|
103
|
-
end
|
104
|
-
cmd
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
def tag(name)
|
109
|
-
puts Rainbow(": #{name}").blue.bright
|
110
|
-
end
|
111
|
-
|
112
|
-
def start_task(task_name)
|
113
|
-
Raykit::Log.start_task(task_name)
|
114
|
-
end
|
115
|
-
|
116
|
-
def show(symbol)
|
117
|
-
show_binding(symbol, binding)
|
118
|
-
end
|
119
|
-
|
120
|
-
def show_binding(symbol, the_binding)
|
121
|
-
show_value symbol.to_s, eval(symbol.to_s, the_binding)
|
122
|
-
end
|
123
|
-
|
124
|
-
def show_value(name, value)
|
125
|
-
Raykit::Log.show_value(name, value)
|
126
|
-
PROJECT.values[name] = value
|
127
|
-
end
|
128
|
-
|
129
|
-
def show_table(symbols)
|
130
|
-
Raykit::Log.show_table(symbols)
|
131
|
-
end
|
132
|
-
|
133
|
-
def copy_files(src_dir, target_dir, glob)
|
134
|
-
Raykit::FileSystem::copy_files(src_dir, target_dir, glob)
|
135
|
-
end
|
136
|
-
|
137
|
-
def copy_file_to_dir(file, dir)
|
138
|
-
Raykit::FileSystem::copy_file_to_dir(file, dir)
|
139
|
-
end
|
140
|
-
end # if defined?(RAYKIT_GLOBALS)
|
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
|
+
ARTIFACTS_DIR = Raykit::Environment::get_dev_dir("artifacts")
|
33
|
+
|
34
|
+
LAST_MODIFIED_SOURCE_FILE = GIT_DIRECTORY.last_modified_src_file
|
35
|
+
LAST_MODIFIED_SOURCE_TIME = GIT_DIRECTORY.last_modified_src_time
|
36
|
+
LAST_MODIFIED_FILE = GIT_DIRECTORY.last_modified_filename
|
37
|
+
LAST_MODIFIED_TIME = GIT_DIRECTORY.last_modified_time
|
38
|
+
LAST_MODIFIED_ARTIFACT_TIME = GIT_DIRECTORY.last_modified_artifact_time
|
39
|
+
|
40
|
+
LOG = Raykit::Logging.new
|
41
|
+
MARKDOWN = Raykit::Markdown.new
|
42
|
+
|
43
|
+
Raykit::MsBuild::fix_msbuild_path
|
44
|
+
|
45
|
+
File.write(".gitignore", DEFAULT_GITIGNORE_CONTENT) unless File.exist?(".gitignore")
|
46
|
+
Raykit::AutoSetup.run if RAYKIT_AUTO_SETUP
|
47
|
+
|
48
|
+
def backup_git_directory
|
49
|
+
if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
|
50
|
+
puts "Backing up #{GIT_DIRECTORY.repository.url}"
|
51
|
+
Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
|
52
|
+
else
|
53
|
+
puts "Environment variable GIT_BACKUP_DIR is not set"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# include Raykit::TopLevel to make run method accessible from the global scope
|
58
|
+
module Raykit
|
59
|
+
module TopLevel
|
60
|
+
def self.run(command, quit_on_failure = true)
|
61
|
+
PROJECT.run(command, quit_on_failure)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
if defined?(RAYKIT_GLOBALS)
|
67
|
+
def run(command, quit_on_failure = true)
|
68
|
+
Raykit::TopLevel.run(command, quit_on_failure)
|
69
|
+
end
|
70
|
+
|
71
|
+
def run_details(command)
|
72
|
+
cmd = Raykit::Command.new(command).run
|
73
|
+
cmd.details
|
74
|
+
end
|
75
|
+
|
76
|
+
def try(command)
|
77
|
+
Raykit::TopLevel.run(command, false)
|
78
|
+
end
|
79
|
+
|
80
|
+
def dir(name)
|
81
|
+
FileUtils.mkdir("artifacts") if (!Dir.exist?(name))
|
82
|
+
end
|
83
|
+
|
84
|
+
def make(artifact, command)
|
85
|
+
if (File.exist?(artifact))
|
86
|
+
puts " #{artifact} exists"
|
87
|
+
else
|
88
|
+
cmd = run(command)
|
89
|
+
if (cmd.exitstatus != 0)
|
90
|
+
File.delete(artifact) if (File.exist?(artifact))
|
91
|
+
end
|
92
|
+
cmd
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def make_log(artifact, command)
|
97
|
+
if (File.exist?(artifact))
|
98
|
+
puts " #{artifact} exists"
|
99
|
+
else
|
100
|
+
cmd = run(command).log_to_file(artifact)
|
101
|
+
if (cmd.exitstatus != 0)
|
102
|
+
File.delete(artifact) if (File.exist?(artifact))
|
103
|
+
end
|
104
|
+
cmd
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def tag(name)
|
109
|
+
puts Rainbow(": #{name}").blue.bright
|
110
|
+
end
|
111
|
+
|
112
|
+
def start_task(task_name)
|
113
|
+
Raykit::Log.start_task(task_name)
|
114
|
+
end
|
115
|
+
|
116
|
+
def show(symbol)
|
117
|
+
show_binding(symbol, binding)
|
118
|
+
end
|
119
|
+
|
120
|
+
def show_binding(symbol, the_binding)
|
121
|
+
show_value symbol.to_s, eval(symbol.to_s, the_binding)
|
122
|
+
end
|
123
|
+
|
124
|
+
def show_value(name, value)
|
125
|
+
Raykit::Log.show_value(name, value)
|
126
|
+
PROJECT.values[name] = value
|
127
|
+
end
|
128
|
+
|
129
|
+
def show_table(symbols)
|
130
|
+
Raykit::Log.show_table(symbols)
|
131
|
+
end
|
132
|
+
|
133
|
+
def copy_files(src_dir, target_dir, glob)
|
134
|
+
Raykit::FileSystem::copy_files(src_dir, target_dir, glob)
|
135
|
+
end
|
136
|
+
|
137
|
+
def copy_file_to_dir(file, dir)
|
138
|
+
Raykit::FileSystem::copy_file_to_dir(file, dir)
|
139
|
+
end
|
140
|
+
end # if defined?(RAYKIT_GLOBALS)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.542
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
|
-
rubygems_version: 3.5.
|
155
|
+
rubygems_version: 3.5.3
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: ruby gem to support rake ci/cd tasks
|