nice_commits 0.0.2 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 252f86712702bfe890f593fcf0684746142734db
4
- data.tar.gz: 46e005de64f06e2b077423d4b3f4836d9a928761
3
+ metadata.gz: 72598bb82be450e09c4dbe726488e68c11c37666
4
+ data.tar.gz: 245604aef3dff61da85312fb741f412093d8273f
5
5
  SHA512:
6
- metadata.gz: 65699cb2f2e4a550b0a505458f17ff35ac0dcbdb5ab438c27a3145fac1bc0629a860b08ac15340070a5fe9f940b72c549ab6d5d1232167004c42864c9d378594
7
- data.tar.gz: 739fcaaaa302ea24ff438e0c4681e7e3b4dc13926be177f09f19ac1ec80fdaf238ff454779cbdf70a63e1c30755e145f8182c694216e919bc1176fdd6ca5ecc2
6
+ metadata.gz: 303c419221605bcb67faa6204d66beae50f5031cfa26e1359f410749556e443ac9641c464936409ece390c7a84f3ab9322c342cf7d2ee394490147e101cdbf44
7
+ data.tar.gz: 84c0e09f830c3b7f35d10a2976d56fead758f2524a16dce9cf0fe21b09c3eb05df0eee0c02d73fad517c31670b4a5973406a8a6365cf341a26d05b622f6f5415
@@ -3,6 +3,7 @@ module NiceCommits
3
3
  def initialize(git, options)
4
4
  @git = git
5
5
  @since = options.since
6
+ @count = options.count
6
7
  end
7
8
 
8
9
  def each(&block)
@@ -12,7 +13,7 @@ module NiceCommits
12
13
  private
13
14
 
14
15
  def log
15
- @git.log.since(@since)
16
+ @git.log(@count).since(@since)
16
17
  end
17
18
  end
18
19
  end
@@ -14,7 +14,7 @@ module NiceCommits
14
14
  \(([^)\n:]+)\) # scope of changes
15
15
  :[[:blank:]]+
16
16
  ([^\n]{5,}) # subject
17
- (?:\n\n([^\n]+(?:.*\n)+))? # body not necessary
17
+ (?:\n\n([^\n]+(?:.|\n)*))? # body not necessary
18
18
  \Z/x
19
19
  MERGE = /\AMerge (?:branch|pull request)/
20
20
 
@@ -3,5 +3,6 @@ module NiceCommits
3
3
  attr_accessor :dir
4
4
  attr_accessor :since
5
5
  attr_accessor :logger
6
+ attr_accessor :count
6
7
  end
7
8
  end
@@ -1,3 +1,3 @@
1
1
  module NiceCommits
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -43,6 +43,11 @@ Long commit description with list of changed files:
43
43
  it { expect(subject.valid?).to be true }
44
44
  end
45
45
 
46
+ context 'for message with body without ending carriage return' do
47
+ let(:message) { %Q{refactor(subscriptions): fix feature envy in sender\n\nCommit description\n\nissue} }
48
+ it { expect(subject.valid?).to be true }
49
+ end
50
+
46
51
  context 'for emty message' do
47
52
  let(:message) { '' }
48
53
  it { expect(subject.valid?).to be false }
@@ -56,11 +61,6 @@ Commit description
56
61
  it { expect(subject.valid?).to be false }
57
62
  end
58
63
 
59
- context 'for message with body without ending carriage return' do
60
- let(:message) { %Q{refactor(subscriptions): fix feature envy in sender\n\nCommit description} }
61
- it { expect(subject.valid?).to be false }
62
- end
63
-
64
64
  context 'for message without type' do
65
65
  let(:message) { '(all): fix a lot of issues' }
66
66
  it { expect(subject.valid?).to be false }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nice_commits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mender (Alexey Gorbov)