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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe3dabed3aa28e59c5518034fa2fd4fd5a171690204e60e44b15d5d60a6e7fde
4
- data.tar.gz: 93a2371ec1d1200445ab5f672136591700a3f2da465fcad85b08aee53a5fe531
3
+ metadata.gz: 4f57d52cdb2ccceb597b61d2dc512acc75b57dad910049c8b1a3b72dac275063
4
+ data.tar.gz: 8b30dfebe9f3dce735b2a5b769257ee5816543f154b64b2d5ec8a8b3ea9e9b8e
5
5
  SHA512:
6
- metadata.gz: 2af68e0737046c0005e6948379502fd3d28c5fbdc9c191825b4abc1c2f59b367ac29e457a4d1ef6b29dd2d9639b17687ea01768d63cf25beb711a1836693da54
7
- data.tar.gz: 66aa1a94d1949484bc1d645bf27c86d9e299fac79403b6a501ac4b57e248f3f96de7c01acc477fa4d00d1dea60a8ca9b231987b62ef050c9688248c135e4fa4b
6
+ metadata.gz: 6a07b5dde44d345bd662e22fbe8397e7ca3d9f7ffad8a58f3a8d755e13701531efb79b2a7518e54eb31328a7279d638996090499180666df948a4f659c9c6489
7
+ data.tar.gz: d34e9e7d2990a343cdc2a6dfbdfb1ccd4130be33e3d28e7c30adbb9a630628927d77ebaf8ae76c13112320b12cd3414b61372f979ed233799c3cfc157aab6600
@@ -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())
@@ -17,7 +17,7 @@ module Raykit
17
17
  insert(-1,url)
18
18
  }
19
19
  else
20
- puts "filename #{filename} does not exist"
20
+ #puts "filename #{filename} does not exist"
21
21
  end
22
22
  end
23
23
 
@@ -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(!File.exist?('.gitignore'))
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
- commit_message='integrate'
25
- PROJECT.run("git commit -m\"#{commit_message}\"") if(PROJECT.outstanding_commit?)
26
- PROJECT.run("git pull")
27
- PROJECT.run("git push")
28
- PROJECT.run("git push --tags")
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
@@ -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
@@ -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.266
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: 2020-12-02 00:00:00.000000000 Z
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.2
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: []