raykit 0.0.504 → 0.0.505
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 +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/nugetpackage.rb
CHANGED
@@ -1,54 +1,54 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Raykit
|
4
|
-
class NuGetPackage
|
5
|
-
attr_accessor :name, :version
|
6
|
-
|
7
|
-
def initialize(name, version)
|
8
|
-
@name = name
|
9
|
-
@version = version
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.get(text, name)
|
13
|
-
Raykit::NugetPackage.new(name, get_version(text, name))
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.get_version(text, name)
|
17
|
-
[/<PackageReference[\s]+Include=\"#{name}\"[\s]+Version=\"([\d\.]+)/,
|
18
|
-
/<Reference[\s]+Include=\"#{name},[\s]+Version=([\d\.]+)/,
|
19
|
-
/<HintPath>[\.\\\/\w\d]+#{name}.([\d\.]+)/].each { |regex|
|
20
|
-
matches = text.scan(regex)
|
21
|
-
if matches.length > 0 && matches[0].length > 0
|
22
|
-
return matches[0][0]
|
23
|
-
end
|
24
|
-
}
|
25
|
-
""
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.set_version(text, name, version)
|
29
|
-
puts "NuGetPackage::set_version"
|
30
|
-
new_text = text
|
31
|
-
[/(<PackageReference[\s]+Include=\"#{name}\"[\s]+Version=\"[\d\.]+)/,
|
32
|
-
/(<Reference[\s]+Include=\"#{name},[\s]+Version=[\d\.]+)/,
|
33
|
-
/(<HintPath>[\.\\\/\w\d]+#{name}.[\d\.]+)/].each { |regex|
|
34
|
-
matches = text.scan(regex)
|
35
|
-
if matches.length > 0 && matches[0].length > 0
|
36
|
-
orig = matches[0][0]
|
37
|
-
oversion = get_version(orig, name)
|
38
|
-
mod = orig.sub(oversion, version)
|
39
|
-
puts "match[0][0] " + matches[0][0]
|
40
|
-
puts "old version " + oversion
|
41
|
-
puts "new version " + version
|
42
|
-
new_text = new_text.gsub(orig, mod)
|
43
|
-
end
|
44
|
-
}
|
45
|
-
new_text
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.set_version_in_file(filename, name, version)
|
49
|
-
text = set_version(IO.read(filename), name, version)
|
50
|
-
orig = IO.read(filename)
|
51
|
-
File.open(filename, "w") { |f| f.puts text } if (text != orig)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Raykit
|
4
|
+
class NuGetPackage
|
5
|
+
attr_accessor :name, :version
|
6
|
+
|
7
|
+
def initialize(name, version)
|
8
|
+
@name = name
|
9
|
+
@version = version
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.get(text, name)
|
13
|
+
Raykit::NugetPackage.new(name, get_version(text, name))
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.get_version(text, name)
|
17
|
+
[/<PackageReference[\s]+Include=\"#{name}\"[\s]+Version=\"([\d\.]+)/,
|
18
|
+
/<Reference[\s]+Include=\"#{name},[\s]+Version=([\d\.]+)/,
|
19
|
+
/<HintPath>[\.\\\/\w\d]+#{name}.([\d\.]+)/].each { |regex|
|
20
|
+
matches = text.scan(regex)
|
21
|
+
if matches.length > 0 && matches[0].length > 0
|
22
|
+
return matches[0][0]
|
23
|
+
end
|
24
|
+
}
|
25
|
+
""
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.set_version(text, name, version)
|
29
|
+
puts "NuGetPackage::set_version"
|
30
|
+
new_text = text
|
31
|
+
[/(<PackageReference[\s]+Include=\"#{name}\"[\s]+Version=\"[\d\.]+)/,
|
32
|
+
/(<Reference[\s]+Include=\"#{name},[\s]+Version=[\d\.]+)/,
|
33
|
+
/(<HintPath>[\.\\\/\w\d]+#{name}.[\d\.]+)/].each { |regex|
|
34
|
+
matches = text.scan(regex)
|
35
|
+
if matches.length > 0 && matches[0].length > 0
|
36
|
+
orig = matches[0][0]
|
37
|
+
oversion = get_version(orig, name)
|
38
|
+
mod = orig.sub(oversion, version)
|
39
|
+
puts "match[0][0] " + matches[0][0]
|
40
|
+
puts "old version " + oversion
|
41
|
+
puts "new version " + version
|
42
|
+
new_text = new_text.gsub(orig, mod)
|
43
|
+
end
|
44
|
+
}
|
45
|
+
new_text
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.set_version_in_file(filename, name, version)
|
49
|
+
text = set_version(IO.read(filename), name, version)
|
50
|
+
orig = IO.read(filename)
|
51
|
+
File.open(filename, "w") { |f| f.puts text } if (text != orig)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/raykit/nunit.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
module Raykit
|
2
|
-
class NUnit
|
3
|
-
def self.nunit3console_path(version)
|
4
|
-
# C:\Users\lparslow\.nuget\packages\nunit.consolerunner\3.15.0\tools
|
5
|
-
path = "#{Environment.home_dir}/.nuget/packages/nunit.consolerunner/#{version}/tools"
|
6
|
-
if Dir.exist?(path)
|
7
|
-
path
|
8
|
-
else
|
9
|
-
""
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module Raykit
|
2
|
+
class NUnit
|
3
|
+
def self.nunit3console_path(version)
|
4
|
+
# C:\Users\lparslow\.nuget\packages\nunit.consolerunner\3.15.0\tools
|
5
|
+
path = "#{Environment.home_dir}/.nuget/packages/nunit.consolerunner/#{version}/tools"
|
6
|
+
if Dir.exist?(path)
|
7
|
+
path
|
8
|
+
else
|
9
|
+
""
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|