structured_changelog 0.5.0 → 0.6.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: 0278b9063784473fbb20ccbf450c0b88df4c5295
4
- data.tar.gz: 048479b8e751253f690a60d325ec50c15aba2062
3
+ metadata.gz: d62c6e49c9b39e054dcf91503691a586b8a29215
4
+ data.tar.gz: 06ef5d163ed5f36450182dd266dc211371e01c24
5
5
  SHA512:
6
- metadata.gz: cc9651df70ac1ead474b14ece1ebac6f8a612da52dc6c72a68e0844915a27f0799a042473c975b33a9e98dba9af34e5c2235968901215c8e8c36501b73ced105
7
- data.tar.gz: baf20d1048c3742f2330ce418e1dc73c07606999ea5f148e6289fb4a64d475d849ccd3351ae14bc3061d094ab1783cc711cba63d6d3bf1f29481e818bc1293ea
6
+ metadata.gz: ca72358aaabf311f18b8f6e24dead1bb049f4b0dfe235186965c9c1e679ed4cae8bf3cde16f8a1fba8141eb4ea94684d631cf12b8447de36ca63b8197237b46a
7
+ data.tar.gz: 127e75076921602f0225b2693b72fb873250569b301a2408571302f44c72bb0a40f72a0acc164dfb1ac0ea4e05083d40d6675b0a7c469afd88caca9c5b39fe4f
data/CHANGELOG.md CHANGED
@@ -1,10 +1,21 @@
1
+ ## ROADMAP 1.1.0
2
+
3
+ * investigate partial parsing of a file if parsing slows down *too much* on large changelogs
4
+
1
5
  ## ROADMAP 1.0.0
2
6
 
7
+ * consider moving from BREAKING/FEATURE/FIX to MAJOR/MINOR/PATCH
3
8
  * validate that each line starts with BREAKING:/FEATURE:/FIX:
4
9
  * validate that each release has the appropriate version
5
10
  * validate that release numbers increase monotonically
6
- * support variant versions (rc1, pre, alpha, etc..)
7
11
  * centralize the version regex (if possible)
12
+ * require release block lines to be ordered in descending severity
13
+ * disable strict semver version validation before 1.0.0
14
+
15
+ ## RELEASE 0.6.0
16
+
17
+ * FEATURE: variant versions (rc1, pre, alpha, etc..) are supported
18
+ * FEATURE: non-numbered roadmap versions (for un-released but immediate work) are now supported
8
19
 
9
20
  ## RELEASE 0.5.0
10
21
 
data/README.md CHANGED
@@ -10,38 +10,50 @@ require 'structured_changelog'
10
10
  MyProject::VERSION = StructuredChangeog.new("path/to/CHANGELOG.md").version
11
11
  ```
12
12
 
13
- To add `rake structured_changelog:validate` and make it part of `rake release`, add this to your `Rakefile`:
13
+ If you use `rake release` to release new code, & want changelog validation to be a part of that release task, you can add this to your `Rakefile`:
14
14
 
15
15
  ```ruby
16
16
  require 'structured_changelog/tasks'
17
17
  ```
18
18
 
19
- ## Shiny Rake Tasks
19
+ (This will execute code that injects the `changelog:validate` task into the list of tasks `rake release` runs before performing a release.)
20
+
21
+ You'll also get these other wonderful rake tasks:
22
+
23
+ ## Wonderful Rake Tasks
20
24
 
21
25
  To validate your changelog:
22
26
 
23
- $ bundle exec rake changelog:validate
27
+ $ rake changelog:validate
28
+
29
+ To determine what version you're on:
30
+
31
+ $ rake changelog:version
32
+
33
+ To view the release notes of the current release:
34
+
35
+ $ rake changelog:notes
36
+ $ rake changelog:notes[current]
24
37
 
25
- To view your the release notes of every release:
38
+ To view the release notes of every release:
26
39
 
27
- $ bundle exec rake changelog:notes
28
- $ bundle exec rake changelog:notes[ALL]
40
+ $ rake changelog:notes[all]
29
41
 
30
42
  for a specific release:
31
43
 
32
- $ bundle exec rake changelog:notes[1.0.4]
44
+ $ rake changelog:notes[1.0.4]
33
45
 
34
46
  for all releases inclusively after a given release:
35
47
 
36
- $ bundle exec rake changelog:notes[1.0.4<]
37
-
48
+ $ rake changelog:notes[1.0.4<]
49
+
38
50
  for all releases inclusively before a given release:
39
51
 
40
- $ bundle exec rake changelog:notes[<2.0.4]
52
+ $ rake changelog:notes[<2.0.4]
41
53
 
42
54
  for all releases inclusively between two releases:
43
55
 
44
- $ bundle exec rake changelog:notes[1.0.4<2.0.4]
56
+ $ rake changelog:notes[1.0.4<2.0.4]
45
57
 
46
58
  ## Installation
47
59
 
@@ -2,8 +2,12 @@ class StructuredChangelog
2
2
  class Release
3
3
  attr_reader :contents
4
4
 
5
+ def self.start_with?(line)
6
+ line =~ pattern
7
+ end
8
+
5
9
  def self.pattern
6
- /^## RELEASE (?<version>\d+\.\d+\.\d+)$/
10
+ /^## RELEASE (?<version>\S+)$/
7
11
  end
8
12
 
9
13
  def initialize(contents)
@@ -1,7 +1,15 @@
1
1
  class StructuredChangelog
2
2
  class Roadmap
3
- def self.pattern
4
- /^## ROADMAP (?<version>\d+\.\d+\.\d+)$/
3
+ def self.start_with?(line)
4
+ patterns.any? { |pattern| line =~ pattern }
5
+ end
6
+
7
+ def self.patterns
8
+ [
9
+ /^## ROADMAP (?<version>\S+)$/,
10
+ /^## ROADMAP/,
11
+ /^## NEXT RELEASE/,
12
+ ]
5
13
  end
6
14
 
7
15
  def <=>(roadmap)
@@ -13,7 +21,13 @@ class StructuredChangelog
13
21
  end
14
22
 
15
23
  def version
16
- contents.match(self.class.pattern)[:version]
24
+ self.class.patterns.each do |pattern|
25
+ match = contents.match(pattern)
26
+
27
+ return match[:version] if match && match.names.include?('version')
28
+ end
29
+
30
+ nil
17
31
  end
18
32
 
19
33
  private
@@ -49,11 +49,11 @@ class StructuredChangelog
49
49
  capture = []
50
50
 
51
51
  [*path.readlines, :EOF].each do |line|
52
- if line == :EOF || line =~ Roadmap.pattern || line =~ Release.pattern
53
- if capture.first =~ Roadmap.pattern
52
+ if line == :EOF || Roadmap.start_with?(line) || Release.start_with?(line)
53
+ if Roadmap.start_with?(capture.first)
54
54
  roadmaps << Roadmap.new(capture.join)
55
55
  capture = []
56
- elsif capture.first =~ Release.pattern
56
+ elsif Release.start_with?(capture.first)
57
57
  releases << Release.new(capture.join)
58
58
  capture = []
59
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structured_changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hoffman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-06 00:00:00.000000000 Z
11
+ date: 2016-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler