makit 0.0.49 → 0.0.51
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/makit/version.rb +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c154ea62f7c1bd58c5983e83b2c9000bd308d6ff4643b3b287ab413f9a54027
|
4
|
+
data.tar.gz: b77d4245e2ff096c1abaf284d395cc6f9738a28576009fad0d4a0b9a73ad5406
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de998d3e2ea32496e3b84c96a318fd9f26a1aafae6106642f12a51a52685effa652dcc62e876a53089fe03826e882a70b3a03a68a91b27c63915931961f089f0
|
7
|
+
data.tar.gz: 3063426a0735c10f86e7e91676d9372a7eef4479b198d5bc5b9301710e09aeaee1770c1a280f8ed2e5b8bf955fd1fd3eeff7f385a6931802f1df7cb9f96cb8ac
|
data/lib/makit/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Makit
|
4
|
-
VERSION = "0.0.
|
4
|
+
VERSION = "0.0.51"
|
5
5
|
|
6
6
|
class Version
|
7
7
|
# given an array of version strings, return the highest version
|
@@ -9,6 +9,13 @@ module Makit
|
|
9
9
|
versions.sort { |a, b| Gem::Version.new(a) <=> Gem::Version.new(b) }.last
|
10
10
|
end
|
11
11
|
|
12
|
+
|
13
|
+
# example content from .gitlab-ci.yml
|
14
|
+
#variables:
|
15
|
+
# VERSION: "0.0.26" # Define the version here
|
16
|
+
|
17
|
+
|
18
|
+
|
12
19
|
def self.get_version_from_file(path)
|
13
20
|
if (!File.exist?(path))
|
14
21
|
raise "file #{path}does not exist"
|
@@ -24,6 +31,8 @@ module Makit
|
|
24
31
|
Makit::Version.detect_from_file(path, /<Version>([-\w\d.]+)</)
|
25
32
|
when ".wxs"
|
26
33
|
Makit::Version.detect_from_file(path, / Version="([\d\.]+)"/)
|
34
|
+
when ".yml"
|
35
|
+
Makit::Version.detect_from_file(path, /VERSION:\s*["']?([\d\.]+)["']?/)
|
27
36
|
else
|
28
37
|
raise "unrecognized file type"
|
29
38
|
end
|
@@ -41,6 +50,7 @@ module Makit
|
|
41
50
|
def self.set_version_in_file(filename, version)
|
42
51
|
text = IO.read(filename)
|
43
52
|
new_text = text
|
53
|
+
new_text = text.gsub(/VERSION:\s?['|"]([.\d]+)['|"]/, "VERSION: \"#{version}\"") if filename.include?(".yml")
|
44
54
|
new_text = text.gsub(/version\s?=\s?['|"]([.\d]+)['|"]/, "version='#{version}'") if filename.include?(".gemspec")
|
45
55
|
new_text = text.gsub(/<Version>([-\w\d.]+)</, "<Version>#{version}<") if filename.include?(".csproj")
|
46
56
|
new_text = text.gsub(/<version>([-\w\d.]+)</, "<version>#{version}<") if filename.include?(".nuspec")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: makit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.51
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|