raykit 0.0.398 → 0.0.401

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b629dd776504babf41e4f267708ca8cd375d0760dc1372f2b66a602812df531
4
- data.tar.gz: 16bc67c404d0262fbcaa97f88d844870ea5d38b561f34c73a961e8db71707100
3
+ metadata.gz: f9cf887ab1a6b24351fe0c63d1e0c5fd6de5cc4a007756fb2a23bde10fcffbaa
4
+ data.tar.gz: 612dbf110fd1ecf109382dc305d6cb7e7bfdf8606530fabd8d74c48392d153e3
5
5
  SHA512:
6
- metadata.gz: 9646908b0449f90ad346b5e0f83f62de481aed6808796649aff40e5ebc8a22bf136a10bbab7f296824171a104558c68bf91ccf256a86bfdd9dcf360c120e90d4
7
- data.tar.gz: 5d74aa7b742bf671abea52f840b6db0a300b34e50a01a0f378e30c1f5939e5d0ecebb7bbf60042c02cacd7beb3d7f43db702189f86129102b25a88522f2de171
6
+ metadata.gz: b87989b8a3cf6d6b3a903820bd58d5e1ecfbc11e90560fb101620a8f3ee75c847d7afcac240925f0da475a6b0af095d25af5b3823fcbcde2dc5965b13ee1167c
7
+ data.tar.gz: f26829d1df3e7eb0ed147a5ff8325d15e5ca151900b362ff001cfdb19b636dd6115da1b06406683f3f7bff5f436532f34f4e0e242fdf3bfce2d3fb6eea8716f7
@@ -3,14 +3,17 @@ module Raykit
3
3
  def self.copy_files(source_dir, target_dir, glob_pattern)
4
4
  FileUtils.mkdir_p(target_dir) if !Dir.exist?(target_dir)
5
5
  #Dir.chdir(source_dir) do
6
+ file_count = 0
6
7
  Dir.glob("#{source_dir}/#{glob_pattern}").each { |f|
7
8
  rel = f.gsub("#{source_dir}/", "")
8
9
  dest = "#{target_dir}/#{rel}"
9
10
  FileUtils.mkdir_p(File.dirname(dest)) if (!Dir.exists?(File.dirname(dest)))
10
- puts " copying #{rel} to #{dest}"
11
+ #puts " copying #{rel} to #{dest}"
11
12
  FileUtils.cp(f, dest)
13
+ file_count = file_count + 1
12
14
  }
13
15
  #end
16
+ puts " copied " + file_count.to_s + " file(s) from #{source_dir} to #{target_dir}"
14
17
  end
15
18
 
16
19
  def self.copy_file_to_dir(file, dir)
@@ -78,6 +78,24 @@ module Raykit
78
78
  end
79
79
  end
80
80
 
81
+ # git ls-tree -r master --name-only
82
+ def src_files
83
+ files = Array.new
84
+ Dir.chdir(@directory) do
85
+ `git ls-tree -r #{branch} --name-only`.each_line { |line|
86
+ file = line.strip
87
+ files << file if file.length > 0
88
+ }
89
+ end
90
+ files
91
+ end
92
+
93
+ def last_modified_src_time
94
+ Dir.chdir(@directory) do
95
+ File.mtime(src_files.select { |f| File.file?(f) }.max_by { |f| File.mtime(f) })
96
+ end
97
+ end
98
+
81
99
  # The latest tag for a branch of the repository
82
100
  def latest_tag(_branch)
83
101
  Dir.chdir(directory) do
@@ -25,9 +25,7 @@ module Raykit
25
25
 
26
26
  def save(_filename)
27
27
  File.open(@filename, "w") do |f|
28
- # json = JSON.pretty_generate(self)
29
28
  f.write(JSON.pretty_generate(self))
30
- # f.write(self.to_json)
31
29
  end
32
30
  end
33
31
 
data/lib/raykit/tasks.rb CHANGED
@@ -27,12 +27,9 @@ task :integrate do
27
27
  else
28
28
  PROJECT.run("git add --all")
29
29
  unless `git status`.include?("nothing to commit")
30
- # if(PROJECT.outstanding_commit?)
31
30
  commit_message = "integrate"
32
31
  PROJECT.run("git commit -m\"#{commit_message}\"") if PROJECT.outstanding_commit?
33
- PROJECT.run("git pull")
34
- # PROJECT.run("git push")
35
- # PROJECT.run("git push --tags")
32
+ PROJECT.run("git pull", false)
36
33
  end
37
34
  end
38
35
  end
data/lib/raykit.rb CHANGED
@@ -33,6 +33,10 @@ if defined?(RAYKIT_GLOBALS)
33
33
  Raykit::TopLevel.run(command, quit_on_failure)
34
34
  end
35
35
 
36
+ def try(command)
37
+ Raykit::TopLevel.run(command, false)
38
+ end
39
+
36
40
  def start_task(task_name)
37
41
  Raykit::Log.start_task(task_name)
38
42
  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.398
4
+ version: 0.0.401
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-05 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.3.7
147
+ rubygems_version: 3.2.22
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: ruby gem to support rake ci/cd tasks