raykit 0.0.262 → 0.0.267
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/raykit/environment.rb +1 -2
- data/lib/raykit/git/files.rb +45 -0
- data/lib/raykit/tasks.rb +22 -15
- data/lib/raykit/zip.rb +46 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db4937f498b6f4ff1534aca2621301423a370ee8722a045b5e03228864300bcb
|
4
|
+
data.tar.gz: 1ea3d0605b9460ed91fdf6666edd6ccec38a2e0624119df614617e2faad9a159
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102692978d305c7b86164a0ab409a28fd1d129648011b74adef82008674a4d58b6f5ab7cfbef504223974805c444c9914e9ad07e4d80500df1b535611781cb67
|
7
|
+
data.tar.gz: 20b2acc869a1d1ebc9594da6424b626e588fe43fff96cb78b7341c805c648cd70c92909270314592eafb3cb4d5c99f555d92c694fbd2eb482a17bfbf5049536e
|
data/lib/raykit/environment.rb
CHANGED
@@ -63,13 +63,12 @@ module Raykit
|
|
63
63
|
if (File.exists?(name))
|
64
64
|
return name
|
65
65
|
end
|
66
|
-
puts ENV['PATH']
|
67
66
|
["",".exe",".bat",".cmd"].each{|ext|
|
68
67
|
aname = name + ext
|
69
68
|
if (File.exists?(aname))
|
70
69
|
return aname
|
71
70
|
end
|
72
|
-
ENV['PATH'].split(
|
71
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each{|path|
|
73
72
|
apath = (path.gsub("\\","/") + '/' + aname).gsub("//","/")
|
74
73
|
if(File.exists?(apath))
|
75
74
|
return apath
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Raykit
|
2
|
+
module Git
|
3
|
+
# Functionality to manage a local clone of a git repository
|
4
|
+
class Files
|
5
|
+
@url
|
6
|
+
@commit_id
|
7
|
+
def initialize(url,commit_id)
|
8
|
+
@url = url
|
9
|
+
@commit_id = commit_id
|
10
|
+
end
|
11
|
+
|
12
|
+
def clean
|
13
|
+
if Dir.exists?(commit_path())
|
14
|
+
FileUtils.rm_rf(commit_path())
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def get(name)
|
19
|
+
puts "commit_path(): " + commit_path()
|
20
|
+
if !Dir.exists?(commit_path())
|
21
|
+
puts 'cloning commit path...'
|
22
|
+
clone = Raykit::Command.new('git clone ' + @url + ' ' + commit_path())
|
23
|
+
puts clone.output
|
24
|
+
puts clone.error
|
25
|
+
Dir.chdir(commit_path()) do
|
26
|
+
checkout = Raykit::Command.new('git checkout ' + @commit_id)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
if File.exists?(filename(name))
|
31
|
+
return filename(name)
|
32
|
+
end
|
33
|
+
''
|
34
|
+
end
|
35
|
+
|
36
|
+
def commit_path
|
37
|
+
Dir.tmpdir() + File::SEPARATOR + 'Raykit.Git.Files' + File::SEPARATOR + @url.gsub('://','.') + File::SEPARATOR + @commit_id
|
38
|
+
end
|
39
|
+
|
40
|
+
def filename(name)
|
41
|
+
commit_path() + File::SEPARATOR + name
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/raykit/tasks.rb
CHANGED
@@ -6,23 +6,30 @@ end
|
|
6
6
|
|
7
7
|
desc "integrate changes into the git repository"
|
8
8
|
task :integrate do
|
9
|
-
if(PROJECT.outstanding_commit?)
|
10
|
-
if(Rake::Task.task_defined?("test"))
|
11
|
-
Rake::Task["test"].invoke
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
9
|
puts Rainbow(':integrate').blue.bright
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
PROJECT.run('git add --all')
|
10
|
+
|
11
|
+
git_dir=Raykit::Git::Directory.new(Rake.application.original_dir)
|
12
|
+
if(!git_dir.detached?)
|
20
13
|
if(PROJECT.outstanding_commit?)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
14
|
+
if(Rake::Task.task_defined?("test"))
|
15
|
+
Rake::Task["test"].invoke
|
16
|
+
end
|
17
|
+
else
|
18
|
+
puts "no outstanding commits detected"
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
if(!File.exist?('.gitignore'))
|
23
|
+
puts "warning: .gitignore does not exist."
|
24
|
+
else
|
25
|
+
PROJECT.run('git add --all')
|
26
|
+
if(PROJECT.outstanding_commit?)
|
27
|
+
commit_message='integrate'
|
28
|
+
PROJECT.run("git commit -m\"#{commit_message}\"") if(PROJECT.outstanding_commit?)
|
29
|
+
PROJECT.run("git pull")
|
30
|
+
PROJECT.run("git push")
|
31
|
+
PROJECT.run("git push --tags")
|
32
|
+
end
|
26
33
|
end
|
27
34
|
end
|
28
35
|
end
|
data/lib/raykit/zip.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
module Raykit
|
3
|
+
class Zip
|
4
|
+
@filename
|
5
|
+
@source_dir
|
6
|
+
@include_globs
|
7
|
+
@exclude_globs
|
8
|
+
|
9
|
+
def initialize(filename)
|
10
|
+
@filename = filename
|
11
|
+
@source_dir = Dir.pwd
|
12
|
+
@include_globs=Array::new
|
13
|
+
@exclude_globs=Array::new
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def source_dir(dir)
|
18
|
+
@source_dir=dir
|
19
|
+
self
|
20
|
+
end
|
21
|
+
|
22
|
+
def include_glob(glob)
|
23
|
+
@include_globs << glob
|
24
|
+
self
|
25
|
+
end
|
26
|
+
|
27
|
+
def exclude_glob(glob)
|
28
|
+
@exclude_globs << glob
|
29
|
+
self
|
30
|
+
end
|
31
|
+
|
32
|
+
def zip
|
33
|
+
path = File.dirname(@filename)
|
34
|
+
if !Dir.exists?(path)
|
35
|
+
FileUtils.mkdir_p(path)
|
36
|
+
end
|
37
|
+
|
38
|
+
Dir.chdir(@source_dir) do
|
39
|
+
include_files=Array::new
|
40
|
+
@include_globs.each{|include_glob|
|
41
|
+
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
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.
|
4
|
+
version: 0.0.267
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- lib/raykit/environment.rb
|
85
85
|
- lib/raykit/git/commit.rb
|
86
86
|
- lib/raykit/git/directory.rb
|
87
|
+
- lib/raykit/git/files.rb
|
87
88
|
- lib/raykit/git/repositories.rb
|
88
89
|
- lib/raykit/git/repository.rb
|
89
90
|
- lib/raykit/log.rb
|
@@ -100,11 +101,12 @@ files:
|
|
100
101
|
- lib/raykit/tasks.rb
|
101
102
|
- lib/raykit/timer.rb
|
102
103
|
- lib/raykit/version.rb
|
104
|
+
- lib/raykit/zip.rb
|
103
105
|
homepage: http://rubygems.org/gems/raykit
|
104
106
|
licenses:
|
105
107
|
- MIT
|
106
108
|
metadata: {}
|
107
|
-
post_install_message:
|
109
|
+
post_install_message:
|
108
110
|
rdoc_options: []
|
109
111
|
require_paths:
|
110
112
|
- lib
|
@@ -119,8 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
121
|
- !ruby/object:Gem::Version
|
120
122
|
version: '0'
|
121
123
|
requirements: []
|
122
|
-
rubygems_version: 3.1.
|
123
|
-
signing_key:
|
124
|
+
rubygems_version: 3.1.4
|
125
|
+
signing_key:
|
124
126
|
specification_version: 4
|
125
127
|
summary: ruby gem to support rake ci/cd tasks
|
126
128
|
test_files: []
|