fastlane-plugin-changelog 0.13.0 → 0.14.0

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
  SHA1:
3
- metadata.gz: 5bcd34d3ae75cd8b0075289c7141b26dcccd7576
4
- data.tar.gz: e30ea3615ad84c9058df7d289189a7c3a01a4ccb
3
+ metadata.gz: 3b75c418b0bdc7d033a04fc8e2b5cd35b8e1784d
4
+ data.tar.gz: 47031da7b4f132a38a12f35f667a21421af06d78
5
5
  SHA512:
6
- metadata.gz: 3b75ff4c72e0f63f36af185a3ff4d96145574c0f6c1f60a4e926dad0babfd29bfaabc9eb65952ea4e9dbfb4517d2b212ab901ae834075edb32d633e94f9e39b9
7
- data.tar.gz: ffef246ec67ac5f6687d595107fc43dc22e50d3017eba5db1c6fede231e8a5b704d1908bb33e759837d63c14db021768b901462eac699d813e0cc8f0ff6166fd
6
+ metadata.gz: bb362ab6745365a8565f46c1f12c4b11490e0607d93a25dcda5c644f536a865f0adfaa5c698555887a5e06a8a9c9066ab2aa48cd19bbb61a6a4d1c10149abd5e
7
+ data.tar.gz: 371fb011fea1cd5f63c48deb874c34ad3cac7101459e76c208da9e67d882ed8abc3b7412830fb7ac973b05de33e388de4b2ec76b9e4a54ffdb6fb3446ae565a0
@@ -64,27 +64,33 @@ module Fastlane
64
64
  # 3. Create link to git tags diff
65
65
  if !git_tag.nil? && !git_tag.empty?
66
66
  last_line = file_content.lines.last
67
- previous_tag = ""
68
- previous_previous_tag = ""
67
+ previous_tag = ''
68
+ previous_previous_tag = ''
69
+ reversed_tags = false
69
70
 
70
71
  if last_line.include? 'https://github.com' # GitHub uses compare/olderTag...newerTag structure
71
72
  previous_previous_tag = %r{(?<=compare\/)(.*)?(?=\.{3})}.match(last_line)
72
73
  previous_tag = /(?<=\.{3})(.*)?/.match(last_line)
73
74
  elsif last_line.include? 'https://bitbucket.org' # Bitbucket uses compare/newerTag..olderTag structure
75
+ reversed_tags = true
74
76
  previous_tag = %r{(?<=compare\/)(.*)?(?=\.{2})}.match(last_line)
75
77
  previous_previous_tag = /(?<=\.{2})(.*)?/.match(last_line)
76
78
  end
77
79
 
78
80
  # Replace section identifier
79
- cleared_git_tag = git_tag.delete('[a-z]')
80
- cleared_previous_git_tag = previous_tag.to_s.delete('[a-z]')
81
- last_line.sub!("[#{cleared_previous_git_tag}]", "[#{cleared_git_tag}]")
82
-
83
- # Replace previous-previous tag with previous
84
- last_line.sub!(previous_previous_tag.to_s, previous_tag.to_s)
85
-
86
- # Replace previous tag with new
87
- last_line.sub!("..#{previous_tag}", "..#{git_tag}")
81
+ previous_section_identifier = /(?<=\[)[^\]]+(?=\]:)/.match(last_line)
82
+ last_line.sub!("[#{previous_section_identifier}]:", "[#{section_identifier}]:")
83
+
84
+ # Replace first tag
85
+ last_line.sub!(
86
+ reversed_tags ? previous_tag.to_s : previous_previous_tag.to_s,
87
+ reversed_tags ? git_tag.to_s : previous_tag.to_s
88
+ )
89
+ # Replace second tag
90
+ last_line.sub!(
91
+ "..#{reversed_tags ? previous_previous_tag : previous_tag}",
92
+ "..#{reversed_tags ? previous_tag : git_tag}"
93
+ )
88
94
 
89
95
  UI.message("Created a link for comparison between #{previous_tag} and #{git_tag} tag")
90
96
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Changelog
3
- VERSION = "0.13.0"
3
+ VERSION = "0.14.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Prochazka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-26 00:00:00.000000000 Z
11
+ date: 2019-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler