raykit 0.0.266 → 0.0.271
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/git/files.rb +7 -0
- data/lib/raykit/git/repositories.rb +1 -1
- data/lib/raykit/tasks.rb +21 -17
- data/lib/raykit/text.rb +30 -0
- 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: 4f57d52cdb2ccceb597b61d2dc512acc75b57dad910049c8b1a3b72dac275063
|
4
|
+
data.tar.gz: 8b30dfebe9f3dce735b2a5b769257ee5816543f154b64b2d5ec8a8b3ea9e9b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a07b5dde44d345bd662e22fbe8397e7ca3d9f7ffad8a58f3a8d755e13701531efb79b2a7518e54eb31328a7279d638996090499180666df948a4f659c9c6489
|
7
|
+
data.tar.gz: d34e9e7d2990a343cdc2a6dfbdfb1ccd4130be33e3d28e7c30adbb9a630628927d77ebaf8ae76c13112320b12cd3414b61372f979ed233799c3cfc157aab6600
|
data/lib/raykit/git/files.rb
CHANGED
@@ -9,7 +9,14 @@ module Raykit
|
|
9
9
|
@commit_id = commit_id
|
10
10
|
end
|
11
11
|
|
12
|
+
def clean
|
13
|
+
if Dir.exists?(commit_path())
|
14
|
+
FileUtils.rm_rf(commit_path())
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
12
18
|
def get(name)
|
19
|
+
puts "commit_path(): " + commit_path()
|
13
20
|
if !Dir.exists?(commit_path())
|
14
21
|
puts 'cloning commit path...'
|
15
22
|
clone = Raykit::Command.new('git clone ' + @url + ' ' + commit_path())
|
data/lib/raykit/tasks.rb
CHANGED
@@ -7,25 +7,29 @@ end
|
|
7
7
|
desc "integrate changes into the git repository"
|
8
8
|
task :integrate do
|
9
9
|
puts Rainbow(':integrate').blue.bright
|
10
|
-
if(PROJECT.outstanding_commit?)
|
11
|
-
if(Rake::Task.task_defined?("test"))
|
12
|
-
Rake::Task["test"].invoke
|
13
|
-
end
|
14
|
-
else
|
15
|
-
puts "no outstanding commits detected"
|
16
|
-
end
|
17
10
|
|
18
|
-
|
19
|
-
if(!
|
20
|
-
puts "warning: .gitignore does not exist."
|
21
|
-
else
|
22
|
-
PROJECT.run('git add --all')
|
11
|
+
git_dir=Raykit::Git::Directory.new(Rake.application.original_dir)
|
12
|
+
if(!git_dir.detached?)
|
23
13
|
if(PROJECT.outstanding_commit?)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
data/lib/raykit/text.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
module Raykit
|
2
|
+
class Text
|
3
|
+
def self.replace_in_glob(glob,search,replace)
|
4
|
+
Dir.glob(glob).each{ |f| replace_in_file(f,search,replace) }
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.replace_in_file(filename,search,replace)
|
8
|
+
text1 = IO.read(filename)
|
9
|
+
text2 = text1.gsub(search) { |str| str=replace }
|
10
|
+
unless text1==text2
|
11
|
+
File.open(filename,"w") { |f| f.puts text2 }
|
12
|
+
return true
|
13
|
+
end
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.copy_if_different(source,destination)
|
18
|
+
if(!File.exists?(destination))
|
19
|
+
FileUtils.cp source, destination
|
20
|
+
else
|
21
|
+
source_text=IO.read(source)
|
22
|
+
destination_text=IO.read(destination)
|
23
|
+
if(source_text != destination_text)
|
24
|
+
FileUtils.rm destination
|
25
|
+
FileUtils.cp source, destination
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
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.271
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -99,13 +99,15 @@ files:
|
|
99
99
|
- lib/raykit/sourceImports.rb
|
100
100
|
- lib/raykit/string.rb
|
101
101
|
- lib/raykit/tasks.rb
|
102
|
+
- lib/raykit/text.rb
|
102
103
|
- lib/raykit/timer.rb
|
103
104
|
- lib/raykit/version.rb
|
105
|
+
- lib/raykit/zip.rb
|
104
106
|
homepage: http://rubygems.org/gems/raykit
|
105
107
|
licenses:
|
106
108
|
- MIT
|
107
109
|
metadata: {}
|
108
|
-
post_install_message:
|
110
|
+
post_install_message:
|
109
111
|
rdoc_options: []
|
110
112
|
require_paths:
|
111
113
|
- lib
|
@@ -120,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
122
|
- !ruby/object:Gem::Version
|
121
123
|
version: '0'
|
122
124
|
requirements: []
|
123
|
-
rubygems_version: 3.1.
|
124
|
-
signing_key:
|
125
|
+
rubygems_version: 3.1.4
|
126
|
+
signing_key:
|
125
127
|
specification_version: 4
|
126
128
|
summary: ruby gem to support rake ci/cd tasks
|
127
129
|
test_files: []
|