raykit 0.0.400 → 0.0.403

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: 051c41fec4ffa38c63e0ce608dec916b4b3c43faa9b6cefb14cb025482c3a5ad
4
- data.tar.gz: bcf3c976b55c4d21b22621404f76e203cb5c975b6bb8cefd719b7e6a40838461
3
+ metadata.gz: 87a638c355ecf27ad31cebb32d137ef7be99b7364bb80b024df3b1f90db66340
4
+ data.tar.gz: 73cc4db1b21b8f4979eab0037884fe8640e2982c6a23772eef9897ff5ca1e2da
5
5
  SHA512:
6
- metadata.gz: 6a282efb131e22be6044acd0dd6cc57fb1f0c2508281afe228555a6b33d346ef339b3e71b73828a647c9b180b02dadd966d65ff816ecae330ac288a9344f77bb
7
- data.tar.gz: 14aceb73b2e35bae2751366c1d85b0ec27566bf9fd1fbcef9e6b7bf16de8baeae8520f137c9e3263d731599dc9414b25049bc8f3bd6577a065a8fafcea1fb573
6
+ metadata.gz: b72587d9510e9990e70d38838b1fa5c37319031f99a8c8a76874aaa5a4bc84a008173263eedc0813df3d754886837b0f8605dc7723748d4303c71489b53c9dfd
7
+ data.tar.gz: 16da3264e487ce6da4e73b6c03ed83dd4fce3c3fca410c1bbab38e87c622d4101d6130ff7b24caacc082cc488b076bcfc12661ecc9a4e5fd2a832fbaf7342644
@@ -0,0 +1,47 @@
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
+
41
+ def self.set_version_in_file(filename, name, version)
42
+ text = set_version(IO.read(filename), name, version)
43
+ orig = IO.read(filename)
44
+ File.open(filename, "w") { |f| f.puts text } if (text != orig)
45
+ end
46
+ end
47
+ end
@@ -1,12 +1,54 @@
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
47
+
48
+ def self.set_version_in_file(filename, name, version)
49
+ text = set_version(IO.read(filename), name, version)
50
+ orig = IO.read(filename)
51
+ File.open(filename, "w") { |f| f.puts text } if (text != orig)
52
+ end
11
53
  end
12
54
  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.400
4
+ version: 0.0.403
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-18 00:00:00.000000000 Z
11
+ date: 2022-08-05 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.2.22
148
+ rubygems_version: 3.3.7
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: ruby gem to support rake ci/cd tasks