approvals 0.0.17 → 0.0.18

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: 6df7476eb9432577895df3170adc9653d7f7615f
4
- data.tar.gz: 1ea30b6816e7282509c98524394ba9e76d787a27
3
+ metadata.gz: 289acfccac3d619495b776d467d8bf86096d25c6
4
+ data.tar.gz: 2f4e4d24848514429cab566fb9339f2b5f270fb2
5
5
  SHA512:
6
- metadata.gz: 2945a8151ca583748a19ea37448723a63fb0f9cb6eefc427cf2fa8a368b4d7372199231de86a7614e3e3746f9d9a1881b2f1e2bff23e6f2a1a16b55931446953
7
- data.tar.gz: 478fbaf9846755cedb47216ccbec95f879faeee7ad1728b794992e9ae39b7653bfdb40dd0979f73c6c5a779dab63f1f4cedf91958f8bc4a20e7058ba16fe515a
6
+ metadata.gz: 79fb265fe4c37fa45b3417c655384e21f6e180895657dc95687d8cd7215fc00e5b1fc456258aa690a418a2d3c33ca21ee5238ba3fd3e3fa5b0826b4d894852c5
7
+ data.tar.gz: 6e3e274b370d0893f4c54a4ca2b5e32ddd3870f1f94bcc7bdffd7ecbf08373b1a5713e2b9820095b3c59618462025ae0a089d6c6e6088885764f3eeb1ce485fb
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+
3
+ ### Next Release
4
+
5
+ * Your contribution here
6
+
7
+ ### v0.0.18 (2015-04-18)
8
+
9
+ - Greatly improve output on failure (Show the diff even if approved file is missing, don't complain if there's no .approvals file, print diff command before showing each diff for better context, and reverse the order of the arguments to the diff so that the additions/removals make sense). - [@randycoulman](https://github.com/randycoulman)
10
+ - General improvements (fix typos, replace PNG badges with SVG ones) - [@jamonholmgren](https://github.com/jamonholmgren), [@olivierlacan](https://github.com/olivierlacan)
11
+
12
+ ### v0.0.17 (2014-10-10)
13
+
14
+ - [#55](https://github.com/kytrinyx/approvals/pull/55) Upgrade to RSpec 3.1 - [@Willianvdv](https://github.com/Willianvdv)
15
+
16
+ ### v0.0.16 (2014-05-19)
17
+
18
+ - General improvements (refactoring, simplify travis build, fix whitespace issues) - [@zph](https://github.com/zph), [@markijbema](https://github.com/markijbema)
19
+ - Ignore trailing whitespace when making assertions. - [@kytrinyx](https://github.com/kytrinyx)
20
+
21
+ ### v0.0.15 (2014-04-05)
22
+
23
+ - [#46](https://github.com/kytrinyx/approvals/pull/46) Improve handling of malformed HTML. - [@hotgazpacho](https://github.com/hotgazpacho)
24
+
25
+ ### v0.0.14 (2014-04-05)
26
+
27
+ - [#48](https://github.com/kytrinyx/approvals/pull/48) Fix CLI namespace clash. - [@zph](https://github.com/zph)
28
+
29
+ ### v0.0.13 (2014-03-10)
30
+
31
+ - Allow verifying hashes and arrays as json. - [@markijbema](https://github.com/markijbema)
32
+ - Add support for RSpec 3.0. - [@markijbema](https://github.com/markijbema)
33
+ - General improvements (documentation, README, refactoring). - [@markijbema](https://github.com/markijbema), [@kytrinyx](https://github.com/kytrinyx)
34
+
35
+ ### v0.0.12 (2014-02-16)
36
+
37
+ - [#34](https://github.com/kytrinyx/approvals/pull/34) Make default formatter configurable. - [@markijbema](https://github.com/markijbema)
38
+ - Update dependencies, and lock them to major releases.
39
+ - Add a license to the gemspec.
40
+ - Add a default rake task.
41
+
42
+ ### v0.0.11 (2014-02-16)
43
+
44
+ - [#33](https://github.com/kytrinyx/approvals/pull/33) Append a trailing newline to all approval files. - [@markijbema](https://github.com/markijbema)
45
+
46
+ ### v0.0.10 (2014-01-30)
47
+
48
+ - [#9](https://github.com/kytrinyx/approvals/pull/9) Add option to let RSpec handle diffing when approval fails. - [@jeremyruppel](https://github.com/jeremyruppel)
49
+ - [#19](https://github.com/kytrinyx/approvals/pull/19) Switch rspec fail_with args so diff is correct. - [@bmarini](https://github.com/bmarini)
50
+ - Fix build, clean up specs, add badges, add CHANGELOG, fix warnings. - [@markijbema](https://github.com/markijbema)
51
+
52
+ ### v0.0.9 (2013-10-08)
53
+
54
+ Before this version, no changelog was maintained
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Approvals
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/kytrinyx/approvals.png?branch=master)](http://travis-ci.org/kytrinyx/approvals)
4
- [![Gem Version](https://badge.fury.io/rb/approvals.png)](http://badge.fury.io/rb/approvals)
5
- [![Code Climate](https://codeclimate.com/github/kytrinyx/approvals.png)](https://codeclimate.com/github/kytrinyx/approvals)
6
- [![Gemnasium](https://gemnasium.com/kytrinyx/approvals.png)](https://gemnasium.com/kytrinyx/approvals)
3
+ [![Build Status](https://secure.travis-ci.org/kytrinyx/approvals.svg?branch=master)](http://travis-ci.org/kytrinyx/approvals)
4
+ [![Gem Version](https://badge.fury.io/rb/approvals.svg)](http://badge.fury.io/rb/approvals)
5
+ [![Code Climate](https://codeclimate.com/github/kytrinyx/approvals.svg)](https://codeclimate.com/github/kytrinyx/approvals)
6
+ [![Gemnasium](https://gemnasium.com/kytrinyx/approvals.svg)](https://gemnasium.com/kytrinyx/approvals)
7
7
 
8
8
 
9
9
  Approvals are based on the idea of the *_golden master_*.
@@ -150,7 +150,7 @@ page = "<html><head></head><body><h1>ZOMG</h1></body></html>"
150
150
  Approvals.verify page, :format => :html
151
151
 
152
152
  data = "{\"beverage\":\"coffee\"}"
153
- Approvals.verify data, :format => :html
153
+ Approvals.verify data, :format => :json
154
154
  ```
155
155
 
156
156
  In RSpec, it looks like this:
@@ -86,7 +86,7 @@ module Approvals
86
86
  end
87
87
 
88
88
  def diff_path
89
- "#{received_path} #{approved_path}"
89
+ "#{approved_path} #{received_path}"
90
90
  end
91
91
 
92
92
  def full_path(state)
@@ -4,17 +4,20 @@ module Approvals
4
4
  class CLI < Thor
5
5
 
6
6
  desc "verify", "Go through all failing approvals with a diff tool"
7
- method_option :diff, :type => :string, :default => 'diff', :aliases => '-d', :desc => 'The difftool to use. e.g. opendiff, vimdiff, etc.'
7
+ method_option :diff, :type => :string, :default => 'diff -N', :aliases => '-d', :desc => 'The difftool to use. e.g. opendiff, vimdiff, etc.'
8
8
  method_option :ask, :type => :boolean, :default => true, :aliases => "-a", :desc => 'Offer to approve the received file for you.'
9
9
  def verify
10
10
  approvals = File.read('.approvals').split("\n")
11
11
 
12
12
  rejected = []
13
13
  approvals.each do |approval|
14
- system("#{options[:diff]} #{approval}")
14
+ diff_command = "#{options[:diff]} #{approval}"
15
+ puts diff_command
16
+ system(diff_command)
15
17
 
16
18
  if options[:ask] && yes?("Approve? [y/N] ")
17
- system("mv #{approval}")
19
+ approved, received = *approval.split
20
+ system("mv #{received} #{approved}")
18
21
  else
19
22
  rejected << approval
20
23
  end
@@ -20,7 +20,7 @@ module Approvals
20
20
  end
21
21
 
22
22
  def includes?(text)
23
- system("cat #{path} | grep -q \"^#{text}$\"")
23
+ system("cat #{path} 2> /dev/null | grep -q \"^#{text}$\"")
24
24
  end
25
25
 
26
26
  def write(text)
@@ -1,3 +1,3 @@
1
1
  module Approvals
2
- VERSION = '0.0.17'
2
+ VERSION = '0.0.18'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: approvals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-10 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -76,7 +76,7 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
78
78
  - ".travis.yml"
79
- - Changelog.md
79
+ - CHANGELOG.md
80
80
  - Gemfile
81
81
  - License.txt
82
82
  - README.md
@@ -1,27 +0,0 @@
1
- # Changelog
2
-
3
- ### HEAD
4
-
5
- - Allow to verify hashes and arrays as json
6
-
7
- - Added support for RSpec 3.0
8
-
9
- ### v0.0.12 (2014/02/16 16:43 +00:00)
10
-
11
- - Allow to configure a default format in RSpec
12
-
13
- ### v0.0.11 (2014/02/16 16:33 +00:00)
14
-
15
- - Append a trailing newline to all approval files
16
-
17
-
18
- ### v0.0.10 (2014/01/30 14:41 +00:00)
19
- - [#9](https://github.com/kytrinyx/approvals/pull/9) Send rspec approval failures to rspec for diffing (@jeremyruppel)
20
-
21
- - [#19](https://github.com/kytrinyx/approvals/pull/19) Switch rspec fail_with args so diff is correct (@bmarini)
22
-
23
- - Added configuration option `diff_on_approval_failure`, and functionality to let rspec diff on an approval failure.
24
-
25
- ### v0.0.9
26
-
27
- Before this version, no changelog was maintained