approvals 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -2,4 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
+ - rbx-19mode
6
+
5
7
  script: bundle exec rspec spec
data/approvals.gemspec CHANGED
@@ -1,9 +1,11 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
+ require 'approvals/version'
5
+
4
6
  Gem::Specification.new do |s|
5
7
  s.name = "approvals"
6
- s.version = "0.0.5"
8
+ s.version = Approvals::VERSION
7
9
  s.authors = ["Katrina Owen"]
8
10
  s.email = ["katrina.owen@gmail.com"]
9
11
  s.homepage = ""
@@ -18,6 +20,7 @@ Gem::Specification.new do |s|
18
20
  s.require_paths = ["lib"]
19
21
 
20
22
  s.add_development_dependency 'rspec', '~> 2.9'
23
+ s.add_development_dependency 'json'
21
24
  s.add_dependency 'thor'
22
25
  s.add_dependency 'nokogiri'
23
26
  end
data/lib/approvals.rb CHANGED
@@ -1,5 +1,7 @@
1
+ require 'json'
1
2
  require 'fileutils'
2
3
  require 'nokogiri'
4
+ require 'approvals/version'
3
5
  require 'approvals/configuration'
4
6
  require 'approvals/approval'
5
7
  require 'approvals/dsl'
@@ -1,3 +1,4 @@
1
- require 'approvals/extensions/rspec'
1
+ require 'approvals'
2
+ require 'approvals/extensions/rspec'
2
3
 
3
4
 
@@ -4,8 +4,8 @@ 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 => 'vimdiff', :aliases => '-d', :desc => 'The difftool to use'
8
- method_option :ask, :type => :boolean, :default => false, :aliases => "-a", :desc => 'Offer to approve the received file for you.'
7
+ method_option :diff, :type => :string, :default => 'diff', :aliases => '-d', :desc => 'The difftool to use. e.g. opendiff, vimdiff, etc.'
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
 
@@ -8,6 +8,10 @@ module Approvals
8
8
  end
9
9
 
10
10
  def to_s
11
+ inspect
12
+ end
13
+
14
+ def inspect
11
15
  command
12
16
  end
13
17
  end
@@ -0,0 +1,3 @@
1
+ module Approvals
2
+ VERSION = '0.0.6'
3
+ end
@@ -1,5 +1,3 @@
1
- require 'json'
2
-
3
1
  module Approvals
4
2
  module Writers
5
3
  class JsonWriter < TextWriter
@@ -6,7 +6,10 @@ describe Approvals do
6
6
  let(:namer) { Approvals::Namers::RSpecNamer.new(self.example) }
7
7
 
8
8
  it "fails" do
9
- ->{ Approvals.verify "this one doesn't exist", :namer => namer }.should raise_error Approvals::ApprovalError
9
+ Approvals::Dotfile.stub(:path => '/dev/null')
10
+ lambda {
11
+ Approvals.verify "this one doesn't exist", :namer => namer
12
+ }.should raise_error Approvals::ApprovalError
10
13
  end
11
14
 
12
15
  it "verifies a string" do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
  require 'approvals/rspec'
3
2
 
4
3
  shared_context 'verify examples' do
@@ -29,7 +29,7 @@ describe Approvals::Namers::DefaultNamer do
29
29
  end
30
30
 
31
31
  it "must have a name" do
32
- ->{ Approvals::Namers::DefaultNamer.new(nil) }.should raise_error(ArgumentError)
32
+ lambda { Approvals::Namers::DefaultNamer.new(nil) }.should raise_error(ArgumentError)
33
33
  end
34
34
 
35
35
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'approvals/rspec'
2
3
 
3
4
  describe Approvals::Namers::DirectoryNamer do
4
5
 
data/spec/namers_spec.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'approvals/rspec'
2
3
 
3
4
  describe Approvals::Namers do
4
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: approvals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-24 00:00:00.000000000 Z
12
+ date: 2012-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70114913577820 !ruby/object:Gem::Requirement
16
+ requirement: &70197693976720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,21 @@ dependencies:
21
21
  version: '2.9'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70114913577820
24
+ version_requirements: *70197693976720
25
+ - !ruby/object:Gem::Dependency
26
+ name: json
27
+ requirement: &70197693976000 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70197693976000
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: thor
27
- requirement: &70114913577220 !ruby/object:Gem::Requirement
38
+ requirement: &70197693975480 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ! '>='
@@ -32,10 +43,10 @@ dependencies:
32
43
  version: '0'
33
44
  type: :runtime
34
45
  prerelease: false
35
- version_requirements: *70114913577220
46
+ version_requirements: *70197693975480
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: nokogiri
38
- requirement: &70114913576740 !ruby/object:Gem::Requirement
49
+ requirement: &70197693975040 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ! '>='
@@ -43,7 +54,7 @@ dependencies:
43
54
  version: '0'
44
55
  type: :runtime
45
56
  prerelease: false
46
- version_requirements: *70114913576740
57
+ version_requirements: *70197693975040
47
58
  description: Approval Tests for Ruby
48
59
  email:
49
60
  - katrina.owen@gmail.com
@@ -89,6 +100,7 @@ files:
89
100
  - lib/approvals/utilities/executable.rb
90
101
  - lib/approvals/utilities/scrubber.rb
91
102
  - lib/approvals/utilities/system_command.rb
103
+ - lib/approvals/version.rb
92
104
  - lib/approvals/writer.rb
93
105
  - lib/approvals/writers/array_writer.rb
94
106
  - lib/approvals/writers/hash_writer.rb