nty_change_log 0.2.2 → 0.2.3

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: 021362d7cbfbad8e1d0aab657923f504646a63c5
4
- data.tar.gz: 7162479526d7ff6380a02ffbe7f15f18d9116a0a
3
+ metadata.gz: 4cada98bbaf9d860d0b594daf6d54d2aedb229c1
4
+ data.tar.gz: 03bd6883781199a85af7ee5a610bd9e1887c4cf1
5
5
  SHA512:
6
- metadata.gz: ac56287f548406925b7a70b64bca62eee8dc6f35367ebd61fecc46b0db751245a972b7166f8c61992f96adf9927ffd9ffb1588ee17030b223b81e3e8d0480b97
7
- data.tar.gz: 66f480dfc5e9df2d528cc74c539e48fc72dc4ff2eb5d6679fd8a275a3e9f20be9adcd57c792f4f77adb062eafe06d17bfcd94e390860fb9ee8adc797a20786b4
6
+ metadata.gz: 3ba7ea45a301870da2c33a5907355661d17e597e2ce58e9585fe28ef956ce089ae2646d01b6fa31d953572137750ff10fb6fe21086d502a3552e58348186f409
7
+ data.tar.gz: bbfcd6165fa0d29620d0063b9203d04786300ebad8736cab26c24cf4ea4f3c9470bd598d55bbfbce8aad70edf254caea9241f8c8961c4723db290b7aa40c6458
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.2.3
6
+
7
+ ### Fixed
8
+ * Fix some methods to parse texts that have no change groups.
9
+
5
10
  ## 0.2.2
6
11
 
7
12
  ### Fixed
data/README.md CHANGED
@@ -1,20 +1,21 @@
1
1
  # NTYChangeLog
2
+ [![Gem Version](https://badge.fury.io/rb/nty_change_log.svg)](https://badge.fury.io/rb/nty_change_log)
2
3
 
3
4
  ```markdown
4
5
  # Change Log
5
6
 
6
7
  ## 1.0.1
7
8
 
8
- ### Change
9
+ ### Changed
9
10
  * Change the name of this rubygem. [#3](https://github.com/naoty/nty_change_log/pull/3)
10
11
  * Divide a large methods into some small methods. [#3](https://github.com/naoty/nty_change_log/pull/3)
11
12
 
12
- ### Fix
13
+ ### Fixed
13
14
  * Fix some bugs. [#3](https://github.com/naoty/nty_change_log/pull/3)
14
15
 
15
16
  ## 1.0.0
16
17
 
17
- ### Add
18
+ ### Added
18
19
  * Parse change groups. [#2](https://github.com/naoty/nty_change_log/pull/2)
19
20
  * Parse change logs in my style. [#1](https://github.com/naoty/nty_change_log/pull/1)
20
21
  ```
@@ -6,6 +6,7 @@ module NTYChangeLog
6
6
  end
7
7
 
8
8
  def parse_versions(text)
9
+ return [] if text.empty?
9
10
  result = text.split(/^## (.+)$/)[1..-1].map(&:strip)
10
11
  Hash[*result].map do |name, change_group_texts|
11
12
  change_groups = parse_change_groups(change_group_texts)
@@ -14,6 +15,7 @@ module NTYChangeLog
14
15
  end
15
16
 
16
17
  def parse_change_groups(text)
18
+ return [] if text.empty?
17
19
  result = text.split(/^### (.+)$/)[1..-1].map(&:strip)
18
20
  Hash[*result].map do |name, change_texts|
19
21
  changes = parse_changes(change_texts)
@@ -22,6 +24,7 @@ module NTYChangeLog
22
24
  end
23
25
 
24
26
  def parse_changes(text)
27
+ return [] if text.empty?
25
28
  rows = text.split("\n").map(&:strip)
26
29
  rows.map do |row|
27
30
  if match = row.match(/\[#(?<number>\d+)\]\((?<url>\S+)\)/)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "nty_change_log"
3
- spec.version = "0.2.2"
3
+ spec.version = "0.2.3"
4
4
  spec.authors = ["Naoto Kaneko"]
5
5
  spec.email = ["naoty.k@gmail.com"]
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nty_change_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoto Kaneko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-06 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.5.2
113
+ rubygems_version: 2.5.1
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: A rubygem to parse CHANGELOGs in my style