changelog 0.2 → 0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/changelog.rb +9 -3
  2. metadata +3 -5
@@ -28,9 +28,15 @@ class CHANGELOG
28
28
  # @return [Array<String>, nil]
29
29
  # List of changes in the last version or nil if the changelog is empty
30
30
  # @author Jakub Stastny aka Botanicus
31
- # @since 0.0.1
32
- def last_version_changes
33
- self.parse[self.versions.last]
31
+ # @since 0.0.3
32
+ # @example
33
+ # changelog.version_changes
34
+ # changelog.version_changes("Version 0.1")
35
+ # changelog.version_changes(/0\.1/)
36
+ def version_changes(version = self.versions.last)
37
+ self.parse[version].inject(String.new) do |buffer, line|
38
+ buffer += "[\e[32m#{version}\e[0m] #{line}\n"
39
+ end
34
40
  end
35
41
 
36
42
  # @param [String, Regexp] version Full name of the version or pattern matching the version.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.2"
4
+ version: "0.3"
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jakub \xC5\xA0\xC5\xA5astn\xC3\xBD aka Botanicus"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
- date: 2009-12-25 00:00:00 +00:00
11
+ date: 2010-01-10 00:00:00 +01:00
12
12
  default_executable:
13
13
  dependencies: []
14
14
 
@@ -29,9 +29,7 @@ has_rdoc: true
29
29
  homepage: http://github.com/botanicus/changelog
30
30
  licenses: []
31
31
 
32
- post_install_message: |-
33
- === Changes in the last version of CHANGELOG ===
34
- - Removed Ruby 1.8 compatibility since we need unordered hash from 1.9
32
+ post_install_message: "[\e[32mVersion 0.3\e[0m] CHANGELOG#last_version_changes renamed to CHANGELOG#version_changes and it takes optinal argument with version\n"
35
33
  rdoc_options: []
36
34
 
37
35
  require_paths: