poper 0.0.2 → 0.0.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: a9abd695f0fb3e1824c45c4979a2a9d3d72021e9
4
- data.tar.gz: 6e2891f64e04be17af1e4ed5eb1a1ec53dbefb49
3
+ metadata.gz: 8f86545c610029866d99bad4fcbf3745ab6736bb
4
+ data.tar.gz: 78c5ac4bb93b7c86afd212c0ec2ccf0d617e7db7
5
5
  SHA512:
6
- metadata.gz: 29155d2fb248dc20e7f907aeb9586699d1c1486fc6043f690e0bde1e98493cc0be5565d5a2cb9f99be1406a54fd5f323a53a6aeeecc57256546153a5491cd477
7
- data.tar.gz: 0307cd1f8cc2c319d83704aba0ffdbc4eab30db81d251fccd4bed29da5f643925c8abb44b75eac5082382bab38489b6d66b5fd9929a7729b17414046b46c315b
6
+ metadata.gz: 5437729ed76b22d257201c43431ddcfd4436fc13ea649ac1373ac86ae60f5247557fd607fce7580af22062cf75b68f0105bc2b9d1c10f20a33f712bbb91a1d55
7
+ data.tar.gz: 4db630bcb63d3d1e797c049a6fa72c8a0c4db2363048f657a22050409d1718c85f9485322d0689820e532f812ae541c88ac0ae16b384fa1d15a935a577b5bfaa
data/README.md CHANGED
@@ -1,15 +1,19 @@
1
1
  # Poper
2
2
 
3
- Poper makes sure that your git commit messages are well-formed
4
3
 
5
4
  [![Code Climate](https://codeclimate.com/github/mmozuras/poper.png)](https://codeclimate.com/github/mmozuras/poper)
6
5
  [![Build Status](https://travis-ci.org/mmozuras/poper.png)](https://travis-ci.org/mmozuras/poper)
7
6
  [![Gem Version](https://badge.fury.io/rb/poper.png)](http://badge.fury.io/rb/poper)
8
7
  [![Dependency Status](https://gemnasium.com/mmozuras/poper.png)](https://gemnasium.com/mmozuras/poper)
9
8
 
10
- ## Usage
9
+ Poper makes sure that your git commit messages are well-formed. It's partly
10
+ inspired by [this article][] written by [tpope][]. Rules specified there form
11
+ the basis of [Poper rules][]. But Poper doesn't stop there. It also doesn't
12
+ like generic commit messages like 'oops, fix tests'. Poper was created to be
13
+ used by [Pronto][], but will work perfectly well in whatever scenario you'll
14
+ come up for it!
11
15
 
12
- Poper is partly inspired by an [article](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) written by [tpope](https://twitter.com/tpope). That's where the name comes from actually. Rules from the article form the basis of [Poper rules](https://github.com/mmozuras/poper/tree/master/lib/poper/rule).
16
+ ## Usage
13
17
 
14
18
  ![Poper demo](poper.gif "")
15
19
 
@@ -19,7 +23,12 @@ a commit:
19
23
  ```bash
20
24
  gem install poper
21
25
  cd /repo/which/commits/you/want/to/check
22
- poper run 86ae550
26
+ poper run HEAD~3
23
27
  ```
24
28
 
25
29
  Every commit between current HEAD and specified commit will be checked.
30
+
31
+ [this article]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
32
+ [tpope]: https://twitter.com/tpope
33
+ [Poper rules]: https://github.com/mmozuras/poper/tree/master/lib/poper/rule
34
+ [Pronto]: https://github.com/mmozuras/pronto
@@ -1,7 +1,7 @@
1
1
  module Poper
2
2
  module Rule
3
3
  class Capitalization < Rule
4
- MSG = 'Commit message should start with a capital letter'
4
+ MSG = 'Git commit message should start with a capital letter'
5
5
 
6
6
  def check(message)
7
7
  MSG unless message[0] == message[0].capitalize
@@ -1,7 +1,7 @@
1
1
  module Poper
2
2
  module Rule
3
3
  class FiftyCharSummary < Rule
4
- MSG = 'Summary should be 50 chars or less'
4
+ MSG = 'Git commit message summary (first line) should be 50 chars or less'
5
5
 
6
6
  def check(message)
7
7
  MSG if message.lines.first.length > 50
@@ -1,13 +1,19 @@
1
1
  module Poper
2
2
  module Rule
3
3
  class Generic < Rule
4
- MSG = 'Consider writing a more detailed, not as generic, commit summary'
4
+ MSG = "Consider writing a more detailed, not as generic, commit message"
5
5
  GENERIC = %w(fix fixed fixes oops todo fixme commit changes hm hmm hmmm
6
6
  test tests quickfix)
7
7
 
8
8
  def check(message)
9
9
  words = message.scan(/[\w-]+/).compact
10
- MSG if words.all? { |word| GENERIC.include?(word.downcase) }
10
+ MSG if words.all? { |word| generic?(word) }
11
+ end
12
+
13
+ private
14
+
15
+ def generic?(word)
16
+ GENERIC.include?(word.downcase)
11
17
  end
12
18
  end
13
19
  end
@@ -1,7 +1,7 @@
1
1
  module Poper
2
2
  module Rule
3
3
  class SeventyTwoCharLimit < Rule
4
- MSG = 'Every line should be 72 chars or less'
4
+ MSG = 'Every line of git commit message should be 72 chars or less'
5
5
 
6
6
  def check(message)
7
7
  MSG if message.lines.any? { |line| line.length > 72 }
@@ -1,7 +1,7 @@
1
1
  module Poper
2
2
  module Rule
3
3
  class SingleWord < Rule
4
- MSG = 'Commit message should consist of more than a single word'
4
+ MSG = 'Git commit message should consist of more than a single word'
5
5
 
6
6
  def check(message)
7
7
  MSG if message.split.count < 2
data/lib/poper/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Poper
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poper
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
  - Mindaugas Mozūras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-20 00:00:00.000000000 Z
11
+ date: 2013-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged