semver_dialects 3.4.3 → 3.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12af4a8e1f6c11b5ae7ff80bd47fb58b28b6364f49bdcd37d65d8a30fb0af22a
4
- data.tar.gz: 957a0026a4a436d5718fe473901460386ec3ddddbea1b8c00f357bbda84529ce
3
+ metadata.gz: f8bdc291086fe3045ad20dbcd66689632e3ade434df5083612deac04d9c70734
4
+ data.tar.gz: a0ad9e2453d852fb21302255ebd6396720c2a83e276a19e1732511bf09b67886
5
5
  SHA512:
6
- metadata.gz: 2a854f058b3a3910cdf116a38561689602e71c311e6373202857ae9d0dbeb107e87dabb16a00b3ddc63a82b74982dcc1999e779c4af9ecd1a480b5cf486b4da9
7
- data.tar.gz: fd96abdf439f3cb239aab8527bc6124b8b0d7f0841755ee6ce0205b4d68901669ba55a311c26bcd10fa94a077ad3e94a5e3d1aa845b08ae14ef2b1844fd8bef2
6
+ metadata.gz: 2dc9a8c36935d003363114d308f4a2e62f32723e122c8c6259658f5ef1bd78baa4793930b716be4823e4e1567f01b10deebc33327a0f37451d376b2ba9b4155d
7
+ data.tar.gz: 4af84b590cbf953e99ad9ffb04e3e0cff6abcc1d4b32ed0be05b3b2e23cdd4f21116888156047c2aac6ffb992dba41ba451db3c8063cd0c69c47ca399952a73e
@@ -217,6 +217,8 @@ module SemverDialects
217
217
  @post_release << s.to_i
218
218
  return
219
219
  end
220
+ else
221
+ raise SemverDialects::InvalidVersionError, input
220
222
  end
221
223
  end
222
224
  end
@@ -234,6 +236,8 @@ module SemverDialects
234
236
  when (s = scanner.scan(DIGITS))
235
237
  @revision << s.to_i
236
238
  return
239
+ else
240
+ raise SemverDialects::InvalidVersionError, input
237
241
  end
238
242
  end
239
243
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SemverDialects
4
- VERSION = '3.4.3'
4
+ VERSION = '3.4.5'
5
5
  end
@@ -122,7 +122,7 @@ module SemverDialects # rubocop:todo Style/Documentation
122
122
 
123
123
  when 'npm'
124
124
  # npm follows Semver 2.0.0.
125
- Semver2::VersionParser.parse(raw_ver)
125
+ Semver2::VersionParser.parse(cleanup(raw_ver))
126
126
 
127
127
  when 'go'
128
128
  # Go follows Semver 2.0.0.
@@ -228,4 +228,9 @@ module SemverDialects # rubocop:todo Style/Documentation
228
228
  # Gem::Version.new raises an ArgumentError for invalid versions.
229
229
  raise InvalidVersionError, raw_ver
230
230
  end
231
+
232
+ # cleanup loose npm versions
233
+ def self.cleanup(raw_ver)
234
+ raw_ver.strip.gsub(/^[=v]/, '')
235
+ end
231
236
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semver_dialects
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.3
4
+ version: 3.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Thome
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2024-08-09 00:00:00.000000000 Z
13
+ date: 2024-12-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pastel