raykit 0.0.399 → 0.0.402

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: a7b05f830a5453ee89a4deb45c07985abd2da04438f1f245232439acfa7712a0
4
- data.tar.gz: 10ad2273ce10bbd102fd6a284f4c508e759f738691baa32dac1db320f7b9d685
3
+ metadata.gz: b64a21afba23dbd86cd8881f871550de514b684970d2d8256a9c4272c9a52e12
4
+ data.tar.gz: 9d8cfa0d75b233fd76c1130ca3be3afc1c8444315ad4f67a1484b8a3da3d8f29
5
5
  SHA512:
6
- metadata.gz: dc5e4a82d286210f8a9d9bb4cc332dde18820fd1e57fbf2fe368b5f5e3ac3ee01e45cc57355cdf065382be93bc848a1ac24a34c76d2a04c004da99bc9364ba9d
7
- data.tar.gz: 52458eace0ae6f78d09a506435efd016ff0c00fd412ba6dda823f2e915552b71a9cc89d29d82b84c588d98bd3648cb03c693cfb919d59e8e7205efe9b53fa93e
6
+ metadata.gz: 85065d4043132ef762c92644a911ef5df3a5359eecad4fcf776247fd889612ef81be7b41ab4b86af7c03748b9798440698ae191be56b89e3cf17bd884f3a6f90
7
+ data.tar.gz: 50d35fff071962a50638973fc21ae44aea109b281360417cffb116e3dcf16859f5ff7253a9c1f58f8b79f31d1977dd7768322b929d83645d8bcccc8213573f03
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Raykit
4
+ class ConanPackage
5
+ attr_accessor :name, :version
6
+
7
+ def initialize(name, version)
8
+ @name = name
9
+ @version = version
10
+ end
11
+
12
+ def self.get_version(text, name)
13
+ # "roam/0.0.14@my+channel.com/branch"
14
+ [/\"#{name}\/([\d\.]+)/].each { |regex|
15
+ matches = text.scan(regex)
16
+ if matches.length > 0 && matches[0].length > 0
17
+ return matches[0][0]
18
+ end
19
+ }
20
+ ""
21
+ end
22
+
23
+ def self.set_version(text, name, version)
24
+ puts "ConanPackage::set_version"
25
+ new_text = text
26
+ [/(\"#{name}\/[\d\.]+)/].each { |regex|
27
+ matches = text.scan(regex)
28
+ if matches.length > 0 && matches[0].length > 0
29
+ orig = matches[0][0]
30
+ oversion = get_version(orig, name)
31
+ mod = orig.sub(oversion, version)
32
+ puts "match[0][0] " + matches[0][0]
33
+ puts "old version " + oversion
34
+ puts "new version " + version
35
+ new_text = new_text.gsub(orig, mod)
36
+ end
37
+ }
38
+ new_text
39
+ end
40
+ end
41
+ end
@@ -13,7 +13,7 @@ module Raykit
13
13
  file_count = file_count + 1
14
14
  }
15
15
  #end
16
- puts " copied " + file_count.to_s + " file from #{source_dir} to #{target_dir}"
16
+ puts " copied " + file_count.to_s + " file(s) from #{source_dir} to #{target_dir}"
17
17
  end
18
18
 
19
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
@@ -1,12 +1,48 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Raykit
4
- class NugetPackage
4
+ class NuGetPackage
5
5
  attr_accessor :name, :version
6
6
 
7
7
  def initialize(name, version)
8
8
  @name = name
9
9
  @version = version
10
10
  end
11
+
12
+ def self.get(text, name)
13
+ Raykit::NugetPackage.new(name, get_version(text, name))
14
+ end
15
+
16
+ def self.get_version(text, name)
17
+ [/<PackageReference[\s]+Include=\"#{name}\"[\s]+Version=\"([\d\.]+)/,
18
+ /<Reference[\s]+Include=\"#{name},[\s]+Version=([\d\.]+)/,
19
+ /<HintPath>[\.\\\/\w\d]+#{name}.([\d\.]+)/].each { |regex|
20
+ matches = text.scan(regex)
21
+ if matches.length > 0 && matches[0].length > 0
22
+ return matches[0][0]
23
+ end
24
+ }
25
+ ""
26
+ end
27
+
28
+ def self.set_version(text, name, version)
29
+ puts "NuGetPackage::set_version"
30
+ new_text = text
31
+ [/(<PackageReference[\s]+Include=\"#{name}\"[\s]+Version=\"[\d\.]+)/,
32
+ /(<Reference[\s]+Include=\"#{name},[\s]+Version=[\d\.]+)/,
33
+ /(<HintPath>[\.\\\/\w\d]+#{name}.[\d\.]+)/].each { |regex|
34
+ matches = text.scan(regex)
35
+ if matches.length > 0 && matches[0].length > 0
36
+ orig = matches[0][0]
37
+ oversion = get_version(orig, name)
38
+ mod = orig.sub(oversion, version)
39
+ puts "match[0][0] " + matches[0][0]
40
+ puts "old version " + oversion
41
+ puts "new version " + version
42
+ new_text = new_text.gsub(orig, mod)
43
+ end
44
+ }
45
+ new_text
46
+ end
11
47
  end
12
48
  end
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.399
4
+ version: 0.0.402
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-11 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
@@ -93,6 +93,7 @@ files:
93
93
  - lib/raykit.rb
94
94
  - lib/raykit/command.rb
95
95
  - lib/raykit/conan/buildinfo.rb
96
+ - lib/raykit/conanpackage.rb
96
97
  - lib/raykit/console.rb
97
98
  - lib/raykit/dir.rb
98
99
  - lib/raykit/dotnet.rb
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
145
  - !ruby/object:Gem::Version
145
146
  version: '0'
146
147
  requirements: []
147
- rubygems_version: 3.3.7
148
+ rubygems_version: 3.2.22
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: ruby gem to support rake ci/cd tasks