raykit 0.0.501 → 0.0.503
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 -20
- 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 -50
- data/lib/raykit/console.rb +314 -308
- 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/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 +16 -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 +103 -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 +125 -125
- metadata +1 -1
@@ -1,89 +1,89 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative("./directory")
|
4
|
-
|
5
|
-
module Raykit
|
6
|
-
module Git
|
7
|
-
# Functionality to manage a remote git repository
|
8
|
-
class Repositories < Array
|
9
|
-
attr_accessor :filename
|
10
|
-
|
11
|
-
def initialize(filename)
|
12
|
-
@filename = filename
|
13
|
-
open(@filename)
|
14
|
-
end
|
15
|
-
|
16
|
-
def open(filename)
|
17
|
-
if File.exist?(filename)
|
18
|
-
JSON.parse(File.read(filename)).each do |url|
|
19
|
-
insert(-1, url)
|
20
|
-
end
|
21
|
-
else
|
22
|
-
# puts "filename #{filename} does not exist"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def save(_filename)
|
27
|
-
File.open(@filename, "w") do |f|
|
28
|
-
f.write(JSON.pretty_generate(self))
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def work_dir
|
33
|
-
Environment.get_dev_dir("work")
|
34
|
-
end
|
35
|
-
|
36
|
-
def is_remote_url(pattern)
|
37
|
-
return true if pattern.include?("http://")
|
38
|
-
return true if pattern.include?("https://")
|
39
|
-
|
40
|
-
false
|
41
|
-
end
|
42
|
-
|
43
|
-
def remove(url)
|
44
|
-
if include?(url)
|
45
|
-
delete(url)
|
46
|
-
save(@filename)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def import(pattern)
|
51
|
-
imported = []
|
52
|
-
if is_remote_url(pattern)
|
53
|
-
remote = pattern
|
54
|
-
unless include?(remote)
|
55
|
-
insert(-1, remote)
|
56
|
-
imported.insert(-1, remote)
|
57
|
-
end
|
58
|
-
else
|
59
|
-
git_dirs = []
|
60
|
-
Dir.chdir(work_dir) do
|
61
|
-
Dir.glob("**/.git") do |git_dir|
|
62
|
-
dir = File.expand_path("..", git_dir)
|
63
|
-
git_dirs.insert(0, dir) if dir.length.positive?
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
git_dirs.each do |git_dir|
|
68
|
-
dir = Raykit::Git::Directory.new(git_dir)
|
69
|
-
remote = dir.remote
|
70
|
-
if remote.include?(pattern) && !include?(remote)
|
71
|
-
insert(-1, remote)
|
72
|
-
imported.insert(-1, remote)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
save(@filename)
|
77
|
-
imported
|
78
|
-
end
|
79
|
-
|
80
|
-
def matches(pattern)
|
81
|
-
matches = []
|
82
|
-
REPOSITORIES.each do |url|
|
83
|
-
matches << url if url.include?(pattern)
|
84
|
-
end
|
85
|
-
matches
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative("./directory")
|
4
|
+
|
5
|
+
module Raykit
|
6
|
+
module Git
|
7
|
+
# Functionality to manage a remote git repository
|
8
|
+
class Repositories < Array
|
9
|
+
attr_accessor :filename
|
10
|
+
|
11
|
+
def initialize(filename)
|
12
|
+
@filename = filename
|
13
|
+
open(@filename)
|
14
|
+
end
|
15
|
+
|
16
|
+
def open(filename)
|
17
|
+
if File.exist?(filename)
|
18
|
+
JSON.parse(File.read(filename)).each do |url|
|
19
|
+
insert(-1, url)
|
20
|
+
end
|
21
|
+
else
|
22
|
+
# puts "filename #{filename} does not exist"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def save(_filename)
|
27
|
+
File.open(@filename, "w") do |f|
|
28
|
+
f.write(JSON.pretty_generate(self))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def work_dir
|
33
|
+
Environment.get_dev_dir("work")
|
34
|
+
end
|
35
|
+
|
36
|
+
def is_remote_url(pattern)
|
37
|
+
return true if pattern.include?("http://")
|
38
|
+
return true if pattern.include?("https://")
|
39
|
+
|
40
|
+
false
|
41
|
+
end
|
42
|
+
|
43
|
+
def remove(url)
|
44
|
+
if include?(url)
|
45
|
+
delete(url)
|
46
|
+
save(@filename)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def import(pattern)
|
51
|
+
imported = []
|
52
|
+
if is_remote_url(pattern)
|
53
|
+
remote = pattern
|
54
|
+
unless include?(remote)
|
55
|
+
insert(-1, remote)
|
56
|
+
imported.insert(-1, remote)
|
57
|
+
end
|
58
|
+
else
|
59
|
+
git_dirs = []
|
60
|
+
Dir.chdir(work_dir) do
|
61
|
+
Dir.glob("**/.git") do |git_dir|
|
62
|
+
dir = File.expand_path("..", git_dir)
|
63
|
+
git_dirs.insert(0, dir) if dir.length.positive?
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
git_dirs.each do |git_dir|
|
68
|
+
dir = Raykit::Git::Directory.new(git_dir)
|
69
|
+
remote = dir.remote
|
70
|
+
if remote.include?(pattern) && !include?(remote)
|
71
|
+
insert(-1, remote)
|
72
|
+
imported.insert(-1, remote)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
save(@filename)
|
77
|
+
imported
|
78
|
+
end
|
79
|
+
|
80
|
+
def matches(pattern)
|
81
|
+
matches = []
|
82
|
+
REPOSITORIES.each do |url|
|
83
|
+
matches << url if url.include?(pattern)
|
84
|
+
end
|
85
|
+
matches
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|