raykit 0.0.527 → 0.0.530

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -21
  3. data/README.md +25 -25
  4. data/bin/raykit +6 -6
  5. data/lib/raykit/auto_setup.rb +69 -69
  6. data/lib/raykit/command.rb +374 -374
  7. data/lib/raykit/conan/buildinfo.rb +69 -69
  8. data/lib/raykit/conanpackage.rb +49 -49
  9. data/lib/raykit/configuration.rb +53 -53
  10. data/lib/raykit/console.rb +310 -310
  11. data/lib/raykit/default_content.rb +227 -227
  12. data/lib/raykit/dir.rb +96 -96
  13. data/lib/raykit/dotnet.rb +174 -174
  14. data/lib/raykit/environment.rb +115 -115
  15. data/lib/raykit/filesystem.rb +34 -34
  16. data/lib/raykit/git/commit.rb +16 -16
  17. data/lib/raykit/git/directory.rb +258 -220
  18. data/lib/raykit/git/files.rb +46 -46
  19. data/lib/raykit/git/repositories.rb +89 -89
  20. data/lib/raykit/git/repository.rb +362 -362
  21. data/lib/raykit/installer.rb +17 -17
  22. data/lib/raykit/log.rb +80 -80
  23. data/lib/raykit/logevent.rb +29 -29
  24. data/lib/raykit/logger.rb +100 -100
  25. data/lib/raykit/logging.rb +57 -57
  26. data/lib/raykit/markdown.rb +21 -21
  27. data/lib/raykit/msbuild.rb +54 -54
  28. data/lib/raykit/nugetpackage.rb +54 -54
  29. data/lib/raykit/nunit.rb +13 -13
  30. data/lib/raykit/project.rb +343 -343
  31. data/lib/raykit/rake.rb +39 -39
  32. data/lib/raykit/runner.rb +42 -42
  33. data/lib/raykit/secrets.rb +38 -38
  34. data/lib/raykit/sourceImport.rb +76 -76
  35. data/lib/raykit/sourceImports.rb +43 -43
  36. data/lib/raykit/string.rb +18 -18
  37. data/lib/raykit/symbols.rb +115 -115
  38. data/lib/raykit/tasks.rb +91 -91
  39. data/lib/raykit/text.rb +32 -32
  40. data/lib/raykit/timer.rb +31 -31
  41. data/lib/raykit/version.rb +95 -95
  42. data/lib/raykit/vstest.rb +24 -24
  43. data/lib/raykit/wix.rb +61 -61
  44. data/lib/raykit/wt.rb +28 -28
  45. data/lib/raykit/zip.rb +73 -73
  46. data/lib/raykit.rb +135 -132
  47. metadata +3 -3
data/lib/raykit.rb CHANGED
@@ -1,132 +1,135 @@
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_TIME = GIT_DIRECTORY.last_modified_src_time
35
- LAST_MODIFIED_ARTIFACT_TIME = GIT_DIRECTORY.last_modified_artifact_time
36
-
37
- LOG = Raykit::Logging.new
38
- MARKDOWN = Raykit::Markdown.new
39
-
40
- Raykit::MsBuild::fix_msbuild_path
41
-
42
- File.write(".gitignore", DEFAULT_GITIGNORE_CONTENT) unless File.exist?(".gitignore")
43
- Raykit::AutoSetup.run if RAYKIT_AUTO_SETUP
44
-
45
- def backup_git_directory
46
- if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
47
- puts "Backing up #{GIT_DIRECTORY.repository.url}"
48
- Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
49
- else
50
- puts "Environment variable GIT_BACKUP_DIR is not set"
51
- end
52
- end
53
-
54
- # include Raykit::TopLevel to make run method accessible from the global scope
55
- module Raykit
56
- module TopLevel
57
- def self.run(command, quit_on_failure = true)
58
- PROJECT.run(command, quit_on_failure)
59
- end
60
- end
61
- end
62
-
63
- if defined?(RAYKIT_GLOBALS)
64
- def run(command, quit_on_failure = true)
65
- Raykit::TopLevel.run(command, quit_on_failure)
66
- end
67
-
68
- def try(command)
69
- Raykit::TopLevel.run(command, false)
70
- end
71
-
72
- def dir(name)
73
- FileUtils.mkdir("artifacts") if (!Dir.exist?(name))
74
- end
75
-
76
- def make(artifact, command)
77
- if (File.exist?(artifact))
78
- puts " #{artifact} exists"
79
- else
80
- cmd = run(command)
81
- if (cmd.exitstatus != 0)
82
- File.delete(artifact) if (File.exist?(artifact))
83
- end
84
- cmd
85
- end
86
- end
87
-
88
- def make_log(artifact, command)
89
- if (File.exist?(artifact))
90
- puts " #{artifact} exists"
91
- else
92
- cmd = run(command).log_to_file(artifact)
93
- if (cmd.exitstatus != 0)
94
- File.delete(artifact) if (File.exist?(artifact))
95
- end
96
- cmd
97
- end
98
- end
99
-
100
- def tag(name)
101
- puts Rainbow(": #{name}").blue.bright
102
- end
103
-
104
- def start_task(task_name)
105
- Raykit::Log.start_task(task_name)
106
- end
107
-
108
- def show(symbol)
109
- show_binding(symbol, binding)
110
- end
111
-
112
- def show_binding(symbol, the_binding)
113
- show_value symbol.to_s, eval(symbol.to_s, the_binding)
114
- end
115
-
116
- def show_value(name, value)
117
- Raykit::Log.show_value(name, value)
118
- PROJECT.values[name] = value
119
- end
120
-
121
- def show_table(symbols)
122
- Raykit::Log.show_table(symbols)
123
- end
124
-
125
- def copy_files(src_dir, target_dir, glob)
126
- Raykit::FileSystem::copy_files(src_dir, target_dir, glob)
127
- end
128
-
129
- def copy_file_to_dir(file, dir)
130
- Raykit::FileSystem::copy_file_to_dir(file, dir)
131
- end
132
- 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 try(command)
72
+ Raykit::TopLevel.run(command, false)
73
+ end
74
+
75
+ def dir(name)
76
+ FileUtils.mkdir("artifacts") if (!Dir.exist?(name))
77
+ end
78
+
79
+ def make(artifact, command)
80
+ if (File.exist?(artifact))
81
+ puts " #{artifact} exists"
82
+ else
83
+ cmd = run(command)
84
+ if (cmd.exitstatus != 0)
85
+ File.delete(artifact) if (File.exist?(artifact))
86
+ end
87
+ cmd
88
+ end
89
+ end
90
+
91
+ def make_log(artifact, command)
92
+ if (File.exist?(artifact))
93
+ puts " #{artifact} exists"
94
+ else
95
+ cmd = run(command).log_to_file(artifact)
96
+ if (cmd.exitstatus != 0)
97
+ File.delete(artifact) if (File.exist?(artifact))
98
+ end
99
+ cmd
100
+ end
101
+ end
102
+
103
+ def tag(name)
104
+ puts Rainbow(": #{name}").blue.bright
105
+ end
106
+
107
+ def start_task(task_name)
108
+ Raykit::Log.start_task(task_name)
109
+ end
110
+
111
+ def show(symbol)
112
+ show_binding(symbol, binding)
113
+ end
114
+
115
+ def show_binding(symbol, the_binding)
116
+ show_value symbol.to_s, eval(symbol.to_s, the_binding)
117
+ end
118
+
119
+ def show_value(name, value)
120
+ Raykit::Log.show_value(name, value)
121
+ PROJECT.values[name] = value
122
+ end
123
+
124
+ def show_table(symbols)
125
+ Raykit::Log.show_table(symbols)
126
+ end
127
+
128
+ def copy_files(src_dir, target_dir, glob)
129
+ Raykit::FileSystem::copy_files(src_dir, target_dir, glob)
130
+ end
131
+
132
+ def copy_file_to_dir(file, dir)
133
+ Raykit::FileSystem::copy_file_to_dir(file, dir)
134
+ end
135
+ 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.527
4
+ version: 0.0.530
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-29 00:00:00.000000000 Z
11
+ date: 2024-03-20 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.5.6
154
+ rubygems_version: 3.3.7
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: ruby gem to support rake ci/cd tasks