pindo 5.20.12 → 5.20.14

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: 443ddd0df9f6ac9c94a64704d56d2af1e4e5787bf986e398460c68c0500af1d2
4
- data.tar.gz: b53590128f05104d85133f4bbac18f4216047e1123d8f5e07d7967aaf0afb035
3
+ metadata.gz: e894c776378d39d4e76d8aa4bb254cc789ae73f485930bb20dd1d68c7b63d445
4
+ data.tar.gz: 74f626f2f6852ace953cdb93ab1e864e917fd3ce34b15c6bb85d004186df3ef8
5
5
  SHA512:
6
- metadata.gz: c97ecc8b4bbb5e7a1e2d798093ccc899398022c1bbc50b5bbe9e9470878278d964ffbf7e2cff1e2c05336c542b03fa1446d3930af5d48383d5b14811d0e350bc
7
- data.tar.gz: 0b21dfd8f1ae5b872bff36d03809b7ae38c17c453c86b12c7349394d35c463b9de121c59fa1b651c3dd6c49687a4ae494928389a1637d5c09731f101f796c719
6
+ metadata.gz: b0b2f763b11a5deb050128e601a5ef39eb0aad09123bd5b31308615805ade7fd43cea031978e52c48f7f5c859ac0f8d2b688b3063ab6882fdf1864786dfe2dc9
7
+ data.tar.gz: 165df68e4f87b1da0a3e2f9b4b4b1ddeff39e8465c24a11eeac2046103f13020fdeb1f67b43beed7b2654bd74695fce444db22979894a098f04223f2b820009f
@@ -309,15 +309,18 @@ module Pindo
309
309
  return current_version
310
310
  end
311
311
 
312
- # 仓库从未打过版本tag:current_version 是起始基线而非"上一个已发布版本",
313
- # 直接作为首个版本使用,不再自增,否则首包会落在 0.0.2(patch) 0.1.0(mini)
314
- unless has_version_tag?(project_dir: project_dir, tag_prefixes: [tag_prefix])
315
- Funlog.instance.fancyinfo_success("仓库暂无版本tag,使用初始版本号: #{current_version}")
316
- return current_version
317
- end
318
-
319
- # 已有tag但不在HEAD,根据 version_increase_type 进位
320
- parts = current_version.split('.').map(&:to_i)
312
+ # 仓库从未打过版本tag时从 0.0.0 起算,使首个版本由 version_increase_type 决定:
313
+ # patch => 0.0.1、mini => 0.1.0、main => 1.0.0。
314
+ # 此处不能直接用 current_version(0.0.1),那是"无版本"的占位值,
315
+ # 拿它自增会让首包落在 0.0.2(patch) 或 0.1.0 之上的错误位置。
316
+ base_version = if has_version_tag?(project_dir: project_dir, tag_prefixes: [tag_prefix])
317
+ current_version
318
+ else
319
+ "0.0.0"
320
+ end
321
+
322
+ # 根据 version_increase_type 进位
323
+ parts = base_version.split('.').map(&:to_i)
321
324
  major = parts[0] || 0
322
325
  minor = parts[1] || 0
323
326
  patch = parts[2] || 0
@@ -112,7 +112,7 @@ module Pindo
112
112
  when 'patch'
113
113
  Pindo::VersionIncreaseType::PATCH
114
114
  else
115
- # 兜底与 ver_inc 的默认值保持一致,避免取值异常时静默退回 mini
115
+ # 兜底与 ver_inc 的默认值保持一致
116
116
  Pindo::VersionIncreaseType::PATCH
117
117
  end
118
118
  end
data/lib/pindo/version.rb CHANGED
@@ -6,7 +6,7 @@ require 'time'
6
6
 
7
7
  module Pindo
8
8
 
9
- VERSION = "5.20.12"
9
+ VERSION = "5.20.14"
10
10
 
11
11
  class VersionCheck
12
12
  RUBYGEMS_API = 'https://rubygems.org/api/v1/gems/pindo.json'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pindo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.20.12
4
+ version: 5.20.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade