structured_changelog 0.7.0 → 0.7.1

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: 5dc0955b9d3778a3aee7b311988b678f99ebac61
4
- data.tar.gz: 1a14c160348f75794c29542fd72acb2478715d9a
3
+ metadata.gz: d179945efda81f57f447465b6ef868a8d8fb4c99
4
+ data.tar.gz: 6870615bbad1bf31b59d3ec8081df87415b344d1
5
5
  SHA512:
6
- metadata.gz: 6ba050c8aa47957bc20126a9c8ac1c1a799ec3efa5eb40c0b94738598f329182ba82a9b6f05eb169e03ec7daeaecc0d1e6e80d089c4b527edc6292f7306fe7a6
7
- data.tar.gz: 51378226b8f268054ef67dd196a29f39914f64d5b18dbbe43bbacd7631b423caf42d20831eb4cee16dbb3247857c0a3cd2a383de4c450ce44f2690d9a7c59be2
6
+ metadata.gz: 6fe02b7fbf1fe89edbe137c1f9ee9debf0536c4de9806223aa59321b01cd7565b06b37ba1e5a221d29beb7ed5e58d18861a6809c2ca25d589f5ce4b6fd51bc74
7
+ data.tar.gz: 8080b55e01dd378ffce14af3835aef6634635c5020eada121ddbc74bb77b7e1c03d5eb2462f0ab4d0dbb84cca09a38f09f8af556b0c7447b9c5f941863c9f51f
data/CHANGELOG.md CHANGED
@@ -8,10 +8,14 @@
8
8
  * validate that each line starts with BREAKING:/FEATURE:/FIX:
9
9
  * validate that each release has the appropriate version
10
10
  * validate that release numbers increase monotonically
11
- * centralize the version regex (if possible)
12
11
  * require release block lines to be ordered in descending severity
13
12
  * disable strict semver version validation before 1.0.0
14
13
 
14
+ ## RELEASE 0.7.1
15
+
16
+ * FIX: stopped trying to hijack gem tasks, as that led to errors in downstream projects
17
+ * FIX: added missing require
18
+
15
19
  ## RELEASE 0.7.0
16
20
 
17
21
  * FEATURE: rake changelog:recent displays the N most recent release sections
data/README.md CHANGED
@@ -10,15 +10,13 @@ require 'structured_changelog'
10
10
  MyProject::VERSION = StructuredChangeog.new("path/to/CHANGELOG.md").version
11
11
  ```
12
12
 
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`:
13
+ You can also add this to your Rakefile:
14
14
 
15
15
  ```ruby
16
16
  require 'structured_changelog/tasks'
17
17
  ```
18
18
 
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:
19
+ You'll get these other wonderful rake tasks:
22
20
 
23
21
  ## Wonderful Rake Tasks
24
22
 
@@ -45,15 +43,23 @@ for a specific release:
45
43
 
46
44
  for all releases inclusively after a given release:
47
45
 
48
- $ rake changelog:notes[1.0.4<]
46
+ $ rake changelog:notes[1.0.4 <]
49
47
 
50
48
  for all releases inclusively before a given release:
51
49
 
52
- $ rake changelog:notes[<2.0.4]
50
+ $ rake changelog:notes[< 2.0.4]
53
51
 
54
52
  for all releases inclusively between two releases:
55
53
 
56
- $ rake changelog:notes[1.0.4<2.0.4]
54
+ $ rake changelog:notes[1.0.4 < 2.0.4]
55
+
56
+ To view the last 3 releases:
57
+
58
+ $ rake changelog:recent
59
+
60
+ To view the last N releases:
61
+
62
+ $ rake changelog:recent[N]
57
63
 
58
64
  ## Installation
59
65
 
@@ -1,3 +1,5 @@
1
+ require 'structured_changelog/version_pattern'
2
+
1
3
  class StructuredChangelog
2
4
  class Release
3
5
  attr_reader :contents
@@ -7,7 +9,7 @@ class StructuredChangelog
7
9
  end
8
10
 
9
11
  def self.pattern
10
- /^## RELEASE (?<version>\d+\.\d+\.\d+\S*)$/
12
+ /^## RELEASE #{VersionPattern}$/
11
13
  end
12
14
 
13
15
  def initialize(contents)
@@ -1,10 +1,11 @@
1
1
  require 'structured_changelog/release_filters/base'
2
+ require 'structured_changelog/version_pattern'
2
3
 
3
4
  class StructuredChangelog
4
5
  module ReleaseFilters
5
6
  class MatchesSingleVersion < Base
6
7
  def self.pattern
7
- /^\d+\.\d+\.\d+\S*$/
8
+ /^#{VersionPattern}$/
8
9
  end
9
10
 
10
11
  def filter_releases(releases)
@@ -1,10 +1,11 @@
1
1
  require 'structured_changelog/release_filters/base'
2
+ require 'structured_changelog/version_pattern'
2
3
 
3
4
  class StructuredChangelog
4
5
  module ReleaseFilters
5
6
  class MatchesVersionsBetween < Base
6
7
  def self.pattern
7
- /^(?<floor>\d+\.\d+\.\d+\S*)\ \<\ (?<ceiling>\d+\.\d+\.\d+\S*)$/
8
+ /^(?<floor>#{VersionPattern})\ \<\ (?<ceiling>#{VersionPattern})$/
8
9
  end
9
10
 
10
11
  def filter_releases(releases)
@@ -1,10 +1,11 @@
1
1
  require 'structured_changelog/release_filters/base'
2
+ require 'structured_changelog/version_pattern'
2
3
 
3
4
  class StructuredChangelog
4
5
  module ReleaseFilters
5
6
  class MatchesVersionsGreaterThanOrEqualTo < Base
6
7
  def self.pattern
7
- /^(?<version>\d+\.\d+\.\d+\S*)\ \<$/
8
+ /^#{VersionPattern}\ \<$/
8
9
  end
9
10
 
10
11
  def filter_releases(releases)
@@ -1,10 +1,11 @@
1
1
  require 'structured_changelog/release_filters/base'
2
+ require 'structured_changelog/version_pattern'
2
3
 
3
4
  class StructuredChangelog
4
5
  module ReleaseFilters
5
6
  class MatchesVersionsLessThanOrEqualTo < Base
6
7
  def self.pattern
7
- /^\<\ (?<version>\d+\.\d+\.\d+\S*)$/
8
+ /^\<\ #{VersionPattern}$/
8
9
  end
9
10
 
10
11
  def filter_releases(releases)
@@ -1,7 +1,7 @@
1
1
  Dir[File.join(File.dirname(__FILE__), "release_filters", "*.rb")].each(&method(:require))
2
2
 
3
3
  class StructuredChangelog
4
- IllegalQuery = Class.new(StandardError)
4
+ class IllegalQuery < StandardError; end
5
5
 
6
6
  module ReleaseFilters
7
7
  def self.filter_for(query)
@@ -1,3 +1,5 @@
1
+ require 'structured_changelog/version_pattern'
2
+
1
3
  class StructuredChangelog
2
4
  class Roadmap
3
5
  def self.start_with?(line)
@@ -6,7 +8,7 @@ class StructuredChangelog
6
8
 
7
9
  def self.patterns
8
10
  [
9
- /^## ROADMAP (?<version>\d+\.\d+\.\d+\S*)$/,
11
+ /^## ROADMAP #{VersionPattern}$/,
10
12
  /^## ROADMAP/,
11
13
  /^## NEXT RELEASE/,
12
14
  ]
@@ -1,4 +1,4 @@
1
- require 'bundler/gem_tasks'
1
+ # require 'bundler/gem_tasks'
2
2
  require 'structured_changelog'
3
3
 
4
4
  desc 'Validate your Structured Changelog'
@@ -8,8 +8,8 @@ task 'changelog:validate', [:path] do |_task, arguments|
8
8
  puts "\e[32mValid #{path}\e[0m" if StructuredChangelog.new(path).validate
9
9
  end
10
10
 
11
- if (guard_clean_task = Rake::Task['release:guard_clean'])
12
- guard_clean_task.enhance(['changelog:validate'])
13
- elsif (release_task = Rake::Task['release'])
14
- release_task.enhance(['changelog:validate'])
15
- end
11
+ # if (guard_clean_task = Rake::Task['release:guard_clean'])
12
+ # guard_clean_task.enhance(['changelog:validate'])
13
+ # elsif (release_task = Rake::Task['release'])
14
+ # release_task.enhance(['changelog:validate'])
15
+ # end
@@ -0,0 +1,3 @@
1
+ class StructuredChangelog
2
+ VersionPattern = /(?<version>\d+\.\d+\.\d+\S*)/
3
+ end
@@ -1,4 +1,5 @@
1
1
  require 'pathname'
2
+ require 'set'
2
3
  require 'structured_changelog/release'
3
4
  require 'structured_changelog/roadmap'
4
5
  require 'structured_changelog/release_filters'
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.7.0
4
+ version: 0.7.1
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-30 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,6 +128,7 @@ files:
128
128
  - lib/structured_changelog/tasks/validate.rb
129
129
  - lib/structured_changelog/tasks/version.rb
130
130
  - lib/structured_changelog/version.rb
131
+ - lib/structured_changelog/version_pattern.rb
131
132
  - structured_changelog.gemspec
132
133
  homepage: https://www.github.com/yarmiganosca/structured_changelog
133
134
  licenses: []