huginn_github_autocommit_agent 0.1.0 → 0.1.1

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: cb623009f09d1a7d4360101c50d62f85273c7ff07a55391a0daa5c362f832e14
4
- data.tar.gz: f9b9e84d26bdff6f718203b9d196172d36bea1b8c7dda2b6de99208b5452c105
3
+ metadata.gz: 00bcbaf914067d7b8f992dc30dd42dcbbb0c0a5c316ddbb66eec5b380c24f8b0
4
+ data.tar.gz: 7e99f410b57240a7172c792ed47bc1859275c95048ea9858f7813a05dc0aae75
5
5
  SHA512:
6
- metadata.gz: 6d5d238102609b5f7349f4d0025ca882bfd9cc02b9677d317b50dad33413ad1370d5c64d2dea46b1de8d467536a054fff02e5f6d22ad66ab3bdfd32de3cd295f
7
- data.tar.gz: 36ad7d07350a0c00f3649efe8f6c5832295b12fc2a238f26cadc9413ec1273241bd1103d19b60fee6fbd8dcf8e3aeb3274b554c547c4a69a66ffa1efc3705a36
6
+ metadata.gz: a74d41c1a171401e0c3ec2ce599e2d179df7b4b5f3e08dcdb58d3665d9132cdddc2c12e2d3f75ae92ed73495ac65e4b1cd1ed376254c9a4e2ab273d0510d8fd1
7
+ data.tar.gz: e2c0a2c8ea26d91b9a8ded086c0f996922b5376c48466446d222a16c216a0d01162e855d746090b97d2eb5328712197db2427cd1d6b00399e39a89a2e246ebd1
@@ -261,8 +261,12 @@ module Agents
261
261
 
262
262
  file_content = Base64.decode64(file_content_base64)
263
263
  current_version = file_content.match(/^ENV #{to_apply['pattern']} (.*)/)
264
- if current_version && current_version[1] >= interpolated['version']
265
- log "The current version is already greater than or equal to the given version. No replacement necessary."
264
+ v1 = Gem::Version.new(interpolated['version'].gsub(/^v/i, ''))
265
+ v2 = Gem::Version.new(current_version.to_s.split.last.gsub(/^v/i, ''))
266
+ comparison_result = v1 <=> v2
267
+
268
+ if comparison_result == 0 || comparison_result == -1
269
+ log "The current version (#{current_version.to_s.split.last}) is already greater than or equal to the given version (#{interpolated['version']}). No replacement necessary."
266
270
  else
267
271
  file_content.gsub!(/^ENV #{to_apply['pattern']}.*/, "ENV #{to_apply['pattern']} #{interpolated['version']}")
268
272
  update_content(to_apply['owner'],to_apply['my_repository'],to_apply['file'],file_content,sha)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: huginn_github_autocommit_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Germain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-13 00:00:00.000000000 Z
11
+ date: 2023-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler