raykit 0.0.504 → 0.0.505

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) 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 +373 -373
  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 +318 -314
  11. data/lib/raykit/default_content.rb +227 -227
  12. data/lib/raykit/dir.rb +49 -49
  13. data/lib/raykit/dotnet.rb +174 -174
  14. data/lib/raykit/environment.rb +114 -114
  15. data/lib/raykit/filesystem.rb +34 -34
  16. data/lib/raykit/git/commit.rb +16 -16
  17. data/lib/raykit/git/directory.rb +216 -216
  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 +376 -376
  21. data/lib/raykit/installer.rb +17 -17
  22. data/lib/raykit/log.rb +80 -80
  23. data/lib/raykit/logevent.rb +49 -49
  24. data/lib/raykit/logger.rb +98 -0
  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 -16
  38. data/lib/raykit/tasks.rb +99 -99
  39. data/lib/raykit/text.rb +32 -32
  40. data/lib/raykit/timer.rb +31 -31
  41. data/lib/raykit/version.rb +89 -103
  42. data/lib/raykit/vstest.rb +24 -24
  43. data/lib/raykit/wt.rb +28 -28
  44. data/lib/raykit/zip.rb +73 -73
  45. data/lib/raykit.rb +126 -125
  46. metadata +4 -3
@@ -1,69 +1,69 @@
1
- module Raykit
2
- module Conan
3
- # Functionality to manage a git commit
4
- class BuildInfo < Hash
5
- def initialize(filename)
6
- current_section = ""
7
- current_list = Array.new()
8
- File.readlines(filename).each do |line|
9
- #puts line
10
- if (line.index("[") == 0)
11
- if (current_section.length > 0)
12
- self.store(current_section, current_list)
13
- current_list = Array.new()
14
- end
15
- current_section = line.strip()
16
- else
17
- item = line.strip()
18
- if (item.length > 0)
19
- current_list << item
20
- end
21
- end
22
- #
23
- end
24
- end
25
-
26
- def section(name)
27
- items = Array.new()
28
- if (self.has_key?(name))
29
- return self[name]
30
- end
31
- items
32
- end
33
-
34
- def pdbs
35
- items = Array.new()
36
- self.section("[builddirs]").each { |dir|
37
- Dir.glob("#{dir}/**/*.pdb").sort.each { |pdb|
38
- items << pdb
39
- }
40
- }
41
- items
42
- end
43
-
44
- def copy_pdbs(dir)
45
- FileUtils.mkdir_p(dir) if !Dir.exist?(dir)
46
- self.pdbs.each { |pdb|
47
- target = "#{dir}/#{File.basename(pdb)}"
48
- if (!File.exist?(target))
49
- puts " copying #{pdb} to #{target}"
50
- FileUtils.cp(pdb, "#{target}")
51
- end
52
- }
53
- end
54
-
55
- def source_dirs(pattern)
56
- items = Array.new()
57
- self.section("[builddirs]").each { |dir|
58
- if (dir.include?(pattern))
59
- parts = dir.split("package/")
60
- if (parts.length == 2)
61
- items << "#{parts[0]}source"
62
- end
63
- end
64
- }
65
- items
66
- end
67
- end
68
- end
69
- end
1
+ module Raykit
2
+ module Conan
3
+ # Functionality to manage a git commit
4
+ class BuildInfo < Hash
5
+ def initialize(filename)
6
+ current_section = ""
7
+ current_list = Array.new()
8
+ File.readlines(filename).each do |line|
9
+ #puts line
10
+ if (line.index("[") == 0)
11
+ if (current_section.length > 0)
12
+ self.store(current_section, current_list)
13
+ current_list = Array.new()
14
+ end
15
+ current_section = line.strip()
16
+ else
17
+ item = line.strip()
18
+ if (item.length > 0)
19
+ current_list << item
20
+ end
21
+ end
22
+ #
23
+ end
24
+ end
25
+
26
+ def section(name)
27
+ items = Array.new()
28
+ if (self.has_key?(name))
29
+ return self[name]
30
+ end
31
+ items
32
+ end
33
+
34
+ def pdbs
35
+ items = Array.new()
36
+ self.section("[builddirs]").each { |dir|
37
+ Dir.glob("#{dir}/**/*.pdb").sort.each { |pdb|
38
+ items << pdb
39
+ }
40
+ }
41
+ items
42
+ end
43
+
44
+ def copy_pdbs(dir)
45
+ FileUtils.mkdir_p(dir) if !Dir.exist?(dir)
46
+ self.pdbs.each { |pdb|
47
+ target = "#{dir}/#{File.basename(pdb)}"
48
+ if (!File.exist?(target))
49
+ puts " copying #{pdb} to #{target}"
50
+ FileUtils.cp(pdb, "#{target}")
51
+ end
52
+ }
53
+ end
54
+
55
+ def source_dirs(pattern)
56
+ items = Array.new()
57
+ self.section("[builddirs]").each { |dir|
58
+ if (dir.include?(pattern))
59
+ parts = dir.split("package/")
60
+ if (parts.length == 2)
61
+ items << "#{parts[0]}source"
62
+ end
63
+ end
64
+ }
65
+ items
66
+ end
67
+ end
68
+ end
69
+ end
@@ -1,49 +1,49 @@
1
- # frozen_string_literal: true
2
-
3
- module Raykit
4
- class ConanPackage
5
- attr_accessor :name, :version
6
-
7
- def initialize(name, version)
8
- @name = name
9
- @version = version
10
- end
11
-
12
- def self.get_version(text, name)
13
- # "gtest/0.0.14@my+channel.com/branch"
14
- # gtest/1.10.0
15
- [/\b#{name}\/([\d\.]+)/].each { |regex|
16
- matches = text.scan(regex)
17
- if matches.length > 0 && matches[0].length > 0
18
- return matches[0][0]
19
- end
20
- }
21
- ""
22
- end
23
-
24
- def self.set_version(text, name, version)
25
- #puts "ConanPackage::set_version"
26
- new_text = text
27
- [/(\b#{name}\/[\d\.]+)/].each { |regex|
28
- matches = text.scan(regex)
29
- if matches.length > 0 && matches[0].length > 0
30
- orig = matches[0][0]
31
- oversion = get_version(orig, name)
32
- mod = orig.sub(oversion, version)
33
- #puts "match[0][0] " + matches[0][0]
34
- #puts "old version " + oversion
35
- #puts "new version " + version
36
- #puts "updating from #{orig} to #{mod}"
37
- new_text = new_text.gsub(orig, mod)
38
- end
39
- }
40
- new_text
41
- end
42
-
43
- def self.set_version_in_file(filename, name, version)
44
- text = set_version(IO.read(filename), name, version)
45
- orig = IO.read(filename)
46
- File.open(filename, "w") { |f| f.puts text } if (text != orig)
47
- end
48
- end
49
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Raykit
4
+ class ConanPackage
5
+ attr_accessor :name, :version
6
+
7
+ def initialize(name, version)
8
+ @name = name
9
+ @version = version
10
+ end
11
+
12
+ def self.get_version(text, name)
13
+ # "gtest/0.0.14@my+channel.com/branch"
14
+ # gtest/1.10.0
15
+ [/\b#{name}\/([\d\.]+)/].each { |regex|
16
+ matches = text.scan(regex)
17
+ if matches.length > 0 && matches[0].length > 0
18
+ return matches[0][0]
19
+ end
20
+ }
21
+ ""
22
+ end
23
+
24
+ def self.set_version(text, name, version)
25
+ #puts "ConanPackage::set_version"
26
+ new_text = text
27
+ [/(\b#{name}\/[\d\.]+)/].each { |regex|
28
+ matches = text.scan(regex)
29
+ if matches.length > 0 && matches[0].length > 0
30
+ orig = matches[0][0]
31
+ oversion = get_version(orig, name)
32
+ mod = orig.sub(oversion, version)
33
+ #puts "match[0][0] " + matches[0][0]
34
+ #puts "old version " + oversion
35
+ #puts "new version " + version
36
+ #puts "updating from #{orig} to #{mod}"
37
+ new_text = new_text.gsub(orig, mod)
38
+ end
39
+ }
40
+ new_text
41
+ end
42
+
43
+ def self.set_version_in_file(filename, name, version)
44
+ text = set_version(IO.read(filename), name, version)
45
+ orig = IO.read(filename)
46
+ File.open(filename, "w") { |f| f.puts text } if (text != orig)
47
+ end
48
+ end
49
+ end
@@ -1,53 +1,53 @@
1
- require "json"
2
-
3
- module Raykit
4
- class Configuration
5
- attr_accessor :root_dir, :auto_setup, :backup_dir, :log_level
6
-
7
- # Define a subdirectory and filename for the config file in a cross-platform manner.
8
- CONFIG_DIR = File.join(Dir.home, ".config", "raykit")
9
- CONFIG_FILE = File.join(CONFIG_DIR, "config.json")
10
-
11
- def initialize
12
- if File.exist?(CONFIG_FILE)
13
- load_configuration
14
- else
15
- set_default_configuration
16
- if (!Dir.exist?(CONFIG_DIR))
17
- save_configuration # Save the default configuration if no configuration file exists.
18
- end
19
- end
20
- end
21
-
22
- def load_configuration
23
- config_data = JSON.parse(File.read(CONFIG_FILE))
24
- @root_dir = config_data["root_dir"]
25
- @auto_setup = config_data["auto_setup"]
26
- @backup_dir = config_data["backup_dir"]
27
- @log_level = config_data["log_level"]
28
- end
29
-
30
- def set_default_configuration
31
- @root_dir = ""
32
- @auto_setup = false
33
- @backup_dir = "backup"
34
- @log_level = Logger::DEBUG
35
- end
36
-
37
- def save_configuration
38
- # Create the config directory if it doesn't exist.
39
- FileUtils.mkdir_p(CONFIG_DIR) unless Dir.exist?(CONFIG_DIR)
40
-
41
- File.write(CONFIG_FILE, {
42
- root_dir: @root_dir,
43
- auto_setup: @auto_setup,
44
- backup_dir: @backup_dir,
45
- log_level: @log_level,
46
- }.to_json)
47
- end
48
-
49
- def to_s
50
- "Root Directory: #{@root_dir}\nAuto Setup: #{@auto_setup}\nBackup Directory: #{@backup_dir}"
51
- end
52
- end # class Configuration
53
- end # module Raykit
1
+ require "json"
2
+
3
+ module Raykit
4
+ class Configuration
5
+ attr_accessor :root_dir, :auto_setup, :backup_dir, :log_level
6
+
7
+ # Define a subdirectory and filename for the config file in a cross-platform manner.
8
+ CONFIG_DIR = File.join(Dir.home, ".config", "raykit")
9
+ CONFIG_FILE = File.join(CONFIG_DIR, "config.json")
10
+
11
+ def initialize
12
+ if File.exist?(CONFIG_FILE)
13
+ load_configuration
14
+ else
15
+ set_default_configuration
16
+ if (!Dir.exist?(CONFIG_DIR))
17
+ save_configuration # Save the default configuration if no configuration file exists.
18
+ end
19
+ end
20
+ end
21
+
22
+ def load_configuration
23
+ config_data = JSON.parse(File.read(CONFIG_FILE))
24
+ @root_dir = config_data["root_dir"]
25
+ @auto_setup = config_data["auto_setup"]
26
+ @backup_dir = config_data["backup_dir"]
27
+ @log_level = config_data["log_level"]
28
+ end
29
+
30
+ def set_default_configuration
31
+ @root_dir = ""
32
+ @auto_setup = false
33
+ @backup_dir = "backup"
34
+ @log_level = ::Logger::DEBUG
35
+ end
36
+
37
+ def save_configuration
38
+ # Create the config directory if it doesn't exist.
39
+ FileUtils.mkdir_p(CONFIG_DIR) unless Dir.exist?(CONFIG_DIR)
40
+
41
+ File.write(CONFIG_FILE, {
42
+ root_dir: @root_dir,
43
+ auto_setup: @auto_setup,
44
+ backup_dir: @backup_dir,
45
+ log_level: @log_level,
46
+ }.to_json)
47
+ end
48
+
49
+ def to_s
50
+ "Root Directory: #{@root_dir}\nAuto Setup: #{@auto_setup}\nBackup Directory: #{@backup_dir}"
51
+ end
52
+ end # class Configuration
53
+ end # module Raykit