makit 0.0.49 → 0.0.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/makit/version.rb +11 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1126dba0ea27b77b9b5d9fb32689f47878419506aee8eb9a4b177b632148832
4
- data.tar.gz: e388dc96e51162a816d97ea373241edf0ff9b7eaecd640763a3a4196ddd038ef
3
+ metadata.gz: 7c154ea62f7c1bd58c5983e83b2c9000bd308d6ff4643b3b287ab413f9a54027
4
+ data.tar.gz: b77d4245e2ff096c1abaf284d395cc6f9738a28576009fad0d4a0b9a73ad5406
5
5
  SHA512:
6
- metadata.gz: bae18f395ed21a74a5c75dc5b039ca92e495083a15f469bda845dd35873f8f481a0768532984719091baeb16be5f458b4733df48b2beff58cdb5733ff0c6fb5a
7
- data.tar.gz: d535921e763f176a56c0432ce7dc22240b43eacf4a032e08da1de3b14b17b6030dfbad6851f8e83be0b92c0652a61b91c4a120c9a73fb5c26960c57b2a6389b4
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.49"
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.49
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-16 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp