fastlane-plugin-changelog 0.15.0 → 0.16.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
- SHA256:
3
- metadata.gz: d04b08c8560041a91f3d0519d4bfc23911b0a42288557cf8aef9c97079f8fb1d
4
- data.tar.gz: d63b349d8edb891f5aae14ad36f9a9b60a8d77b81cf7c9b8d333c6d273b2391b
2
+ SHA1:
3
+ metadata.gz: 88dc3f6cc69c73c660b54513b941382eda0f8866
4
+ data.tar.gz: bc40d6fe17cebb7a3ae63ffac3a2fe1f8a9a9a12
5
5
  SHA512:
6
- metadata.gz: 31e601796d7e22f23a49e4e8c2c2dbdb2fcde008d73f6876f217199cdc59e91c7a4c330f4a3617668de95ecad5920844b2edf035056a1ca7a77c7932b5c7a6cc
7
- data.tar.gz: 327da23f6766f75963b8fa41bcf4e6d4c1ba5b3b7e1ae49d1127d26c1135fdd05b8216a2d7e5629b5f1bf73e1996ad4de73d0f2e26dc49a8f3aad860ed03d48e
6
+ metadata.gz: 691abf1f00864a292359498499cf6af7b1fb308373f268ba7ac440e04ef73016af2ccb575190fa5b7c294c549be53e4806790a97809778d233cd65814e166033
7
+ data.tar.gz: 5ee732505ba076fd8bff381ade7e0ff6041f78edad5cb9a2160aca477e1c2d241102b07029086e65c51fc611f09afdd5dc7e6ae35cede277195bca694583d745
data/README.md CHANGED
@@ -14,7 +14,7 @@ fastlane add_plugin changelog
14
14
 
15
15
  This plugin is inspired by and based on [Keep a CHANGELOG](http://keepachangelog.com/) project. [Keep a CHANGELOG](http://keepachangelog.com/) proposes a standardised format for keeping change log of your project repository in `CHANGELOG.md` file. This file contains a curated, chronologically ordered list of notable changes for each version of a project in human readable format.
16
16
 
17
- Since [Keep a CHANGELOG](http://keepachangelog.com/) project proposes a well-defined structure with _sections_ (e.g.: `[Unreleased]`, `0.3.0]`) and _subsections_ (`Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`) it opens up an opportunity to automate reading from/writing to `CHANGELOG.md` with [`fastlane`](https://fastlane.tools).
17
+ Since [Keep a CHANGELOG](http://keepachangelog.com/) project proposes a well-defined structure with _sections_ (e.g.: `[Unreleased]`, `[0.3.0]`) and _subsections_ (`Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`) it opens up an opportunity to automate reading from/writing to `CHANGELOG.md` with [`fastlane`](https://fastlane.tools).
18
18
 
19
19
  ## Actions
20
20
  `fastlane-plugin-changelog` consists of 3 actions enabling you to manipulate `CHANGELOG.md` from [`fastlane`](https://fastlane.tools).
@@ -57,7 +57,7 @@ module Fastlane
57
57
  end
58
58
  end
59
59
 
60
- UI.success("Successfuly emojified output of read_changelog action")
60
+ UI.success("Successfully emojified output of read_changelog action")
61
61
 
62
62
  Actions.lane_context[SharedValues::EMOJIFY_CHANGELOG_CONTENT] = emojified_content
63
63
  end
@@ -14,20 +14,22 @@ module Fastlane
14
14
  UI.important("WARNING: No changes in [Unreleased] section to stamp!")
15
15
  else
16
16
  section_identifier = params[:section_identifier] unless params[:section_identifier].to_s.empty?
17
- stamp_date = params[:stamp_date]
17
+ should_stamp_date = params[:should_stamp_date]
18
+ stamp_datetime_format = params[:stamp_datetime_format]
18
19
  git_tag = params[:git_tag]
19
20
  placeholder_line = params[:placeholder_line]
20
21
 
21
- stamp(changelog_path, section_identifier, stamp_date, git_tag, placeholder_line)
22
+ stamp(changelog_path, section_identifier, should_stamp_date, stamp_datetime_format, git_tag, placeholder_line)
22
23
  end
23
24
  end
24
25
 
25
- def self.stamp(changelog_path, section_identifier, stamp_date, git_tag, placeholder_line)
26
+ def self.stamp(changelog_path, section_identifier, should_stamp_date, stamp_datetime_format, git_tag, placeholder_line)
26
27
  # 1. Update [Unreleased] section with given identifier
27
28
  Actions::UpdateChangelogAction.run(changelog_path: changelog_path,
28
29
  section_identifier: UNRELEASED_IDENTIFIER,
29
30
  updated_section_identifier: section_identifier,
30
- append_date: stamp_date,
31
+ should_append_date: should_stamp_date,
32
+ append_datetime_format: stamp_datetime_format,
31
33
  excluded_placeholder_line: placeholder_line)
32
34
 
33
35
  file_content = ""
@@ -101,7 +103,7 @@ module Fastlane
101
103
  changelog = File.open(changelog_path, "w")
102
104
  changelog.puts(file_content)
103
105
  changelog.close
104
- UI.success("Successfuly stamped #{section_identifier} in #{changelog_path}")
106
+ UI.success("Successfully stamped #{section_identifier} in #{changelog_path}")
105
107
  end
106
108
 
107
109
  #####################################################
@@ -129,10 +131,17 @@ module Fastlane
129
131
  env_name: "FL_STAMP_CHANGELOG_SECTION_IDENTIFIER",
130
132
  description: "The unique section identifier to stamp the [Unreleased] section with",
131
133
  is_string: true),
132
- FastlaneCore::ConfigItem.new(key: :stamp_date,
133
- env_name: "FL_STAMP_CHANGELOG_SECTION_STAMP_DATE",
134
- description: "Specifies whether the current date should be appended to section identifier",
134
+ FastlaneCore::ConfigItem.new(key: :should_stamp_date,
135
+ env_name: "FL_STAMP_CHANGELOG_SHOULD_STAMP_DATE",
136
+ description: "Specifies whether the current date as per the stamp_datetime_format should be stamped to the section identifier",
135
137
  default_value: true,
138
+ is_string: false,
139
+ optional: true),
140
+ FastlaneCore::ConfigItem.new(key: :stamp_datetime_format,
141
+ env_name: "FL_STAMP_CHANGELOG_DATETIME_FORMAT",
142
+ description: "The strftime format string to use for the date in the stamped section",
143
+ default_value: '%FZ',
144
+ is_string: true,
136
145
  optional: true),
137
146
  FastlaneCore::ConfigItem.new(key: :git_tag,
138
147
  env_name: "FL_STAMP_CHANGELOG_GIT_TAG",
@@ -48,8 +48,14 @@ module Fastlane
48
48
  line_old = line.dup
49
49
  line.sub!(section_name, new_section_identifier)
50
50
 
51
- if params[:append_date]
52
- now = Time.now.strftime("%Y-%m-%d")
51
+ should_append_date = params[:should_append_date]
52
+
53
+ if should_append_date
54
+ append_datetime_format = params[:append_datetime_format]
55
+
56
+ now = Time.now.utc.strftime(append_datetime_format)
57
+ ENV["FL_UPDATE_APPEND_DATETIME_VAL"] = now
58
+
53
59
  line.concat(" - " + now)
54
60
  line.delete!(line_separator) # remove line break, because concatenation adds line break between section identifer & date
55
61
  line.concat(line_separator) # add line break to the end of the string, in order to start next line on the next line
@@ -72,7 +78,7 @@ module Fastlane
72
78
  changelog = File.open(changelog_path, "w")
73
79
  changelog.puts(file_content)
74
80
  changelog.close
75
- UI.success("Successfuly updated #{changelog_path}")
81
+ UI.success("Successfully updated #{changelog_path}")
76
82
  end
77
83
 
78
84
  def self.is_section_line(line)
@@ -114,12 +120,18 @@ module Fastlane
114
120
  description: "The updated unique section identifier (without square brackets)",
115
121
  is_string: true,
116
122
  optional: true),
117
- FastlaneCore::ConfigItem.new(key: :append_date,
118
- env_name: "FL_UPDATE_CHANGELOG_APPEND_DATE",
119
- description: "Appends the current date in YYYY-MM-DD format after the section identifier",
123
+ FastlaneCore::ConfigItem.new(key: :should_append_date,
124
+ env_name: "FL_UPDATE_CHANGELOG_SHOULD_APPEND_DATE",
125
+ description: "Specifies whether the current date as per the append_datetime_format should be appended to section identifier",
120
126
  default_value: true,
121
127
  is_string: false,
122
128
  optional: true),
129
+ FastlaneCore::ConfigItem.new(key: :append_datetime_format,
130
+ env_name: "FL_UPDATE_CHANGELOG_APPEND_DATETIME_FORMAT",
131
+ description: "The strftime format string to use for the date after the section identifier",
132
+ default_value: '%FZ',
133
+ is_string: true,
134
+ optional: true),
123
135
  FastlaneCore::ConfigItem.new(key: :excluded_placeholder_line,
124
136
  env_name: "FL_UPDATE_CHANGELOG_EXCLUDED_PLACEHOLDER_LINE",
125
137
  description: "Placeholder string to be ignored in updated section",
@@ -65,7 +65,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
65
65
  # Writes given content to CHANGELOG.md in project root
66
66
  def self.write_to_changelog(changelog)
67
67
  File.open(CHANGELOG_PATH, 'w') { |f| f.write(changelog) }
68
- FastlaneCore::UI.success('Successfuly created CHANGELOG.md')
68
+ FastlaneCore::UI.success('Successfully created CHANGELOG.md')
69
69
  end
70
70
 
71
71
  def self.get_line_separator(file_path)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Changelog
3
- VERSION = "0.15.0"
3
+ VERSION = "0.16.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.15.0
4
+ version: 0.16.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-06-22 00:00:00.000000000 Z
11
+ date: 2021-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  requirements: []
131
131
  rubyforge_project:
132
- rubygems_version: 2.7.6
132
+ rubygems_version: 2.6.13
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Automate changes to your project CHANGELOG.md