fastlane-plugin-gitlab_get_max_version_branch 0.1.2 → 0.1.3

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: a344437ac21ee58bb3d9a3ba0de31028b1364d9a7833af54b2b88f104699ed25
4
- data.tar.gz: 042ceca66b65c9736578bc4f97d495e74831c555737ac3426c748b8ee5b192bf
3
+ metadata.gz: 46dc69bc8694e18e961f5add96af62d512f6a5340ef1b1ee788e02ce071874e4
4
+ data.tar.gz: 85dc77981baf267d052e7ebe0acfef33c61dc23aeb5b141c34624ceb1b332cf2
5
5
  SHA512:
6
- metadata.gz: 6bd28a83d9efdce4b3c1aeccf29c83c7be9d9d45c88feba396ab82c2cff9d9d17c35ed4d21bbfec253660b523e029365f96294cb89749b3fb06847d3c9a6a36a
7
- data.tar.gz: 9526fee0ca1b6588a7cee7a806137184cf4503a627571e71e71376588310bcaab8c86a1d0da737bf21bce60d4220ce7eac80c67ef41aa9e8cf36afdedc38642b
6
+ metadata.gz: b3ed1a4560aa93e14bca8cd7850eadd6f2720d0ba17e2b9cddac242fcb8a4c3f262fecea31c90062afdbeff5f4eaf4161e76a00573dc3689ad9155b324566144
7
+ data.tar.gz: 9ad867f5bc734036ec5d6058eddd8402f8dff25a4325d5adb6b3c930806342fc9b464246347e38dfded69eae772aaa8322725730da6a5606ab5f57fd48a6f96e
@@ -5,27 +5,15 @@ module Fastlane
5
5
  module Actions
6
6
  class Version
7
7
  include Comparable
8
- attr_reader(:full_version, :major, :minor, :patch)
8
+ attr_reader(:version, :str)
9
9
 
10
- def initialize(version_str)
11
- @full_version = version_str
12
- @major, @minor, @patch = version_str.strip.gsub('master_', '').split('.').map(&:to_i)
13
- end
14
-
15
- def <=>(other)
16
- return nil unless other.is_a?(Version)
17
-
18
- [
19
- @major <=> other.major,
20
- @minor <=> other.minor,
21
- @patch <=> other.patch
22
- ].detect do |num|
23
- !num.zero?
24
- end || 0
10
+ def initialize(str)
11
+ @str = str
12
+ @version = Gem::Version.new(str.strip.gsub('master_', ''))
25
13
  end
26
14
 
27
15
  def to_s
28
- @full_version
16
+ @str
29
17
  end
30
18
  end
31
19
 
@@ -79,7 +67,7 @@ module Fastlane
79
67
  Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::GITLAB_GET_MAX_VERSIO_NBRANCH_RESULT] = branchs.map { |b|
80
68
  Version.new(b)
81
69
  }.sort { |v1, v2|
82
- v2 <=> v1
70
+ v2.version <=> v1.version
83
71
  }.first.to_s
84
72
 
85
73
  true
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GitlabGetMaxVersionBranch
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-gitlab_get_max_version_branch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - xiongzenghui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-04 00:00:00.000000000 Z
11
+ date: 2019-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab