tailor 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tailor (1.1.4)
4
+ tailor (1.1.5)
5
5
  log_switch (>= 0.3.0)
6
6
  term-ansicolor (>= 1.0.5)
7
7
  text-table (>= 1.2.2)
data/History.rdoc CHANGED
@@ -1,3 +1,11 @@
1
+ === 1.1.5 2013-01-30
2
+
3
+ * gh-127[https://github.com/turboladen/tailor/issues/127]
4
+ * The last fix had SystemExit being displayed to the user at all times (since
5
+ it should've been getting rescued from when the program exits). Properly
6
+ rescuing this now for Rake tasks, so it now behaves just like bin/tailor in
7
+ this respect.
8
+
1
9
  === 1.1.4 2013-01-29
2
10
 
3
11
  * gh-127[https://github.com/turboladen/tailor/issues/127]
@@ -2,7 +2,7 @@ Feature: Continuous Integration
2
2
  As a Ruby developer, I want builds to fail when my project encounters tailor
3
3
  errors so I can be sure to fix those errors as soon as possible.
4
4
 
5
- Scenario: Warnings found, but not errors
5
+ Scenario: tailor executable, warnings found, but no errors
6
6
  Given my configuration file ".tailor" looks like:
7
7
  """
8
8
  Tailor.config do |config|
@@ -21,7 +21,7 @@ Feature: Continuous Integration
21
21
  Then the output should match /File has 2 trailing newlines/
22
22
  And the exit status should be 0
23
23
 
24
- Scenario: Errors found
24
+ Scenario: tailor executable, errors found
25
25
  Given my configuration file ".tailor" looks like:
26
26
  """
27
27
  Tailor.config do |config|
@@ -38,5 +38,84 @@ Feature: Continuous Integration
38
38
  """
39
39
  When I run `tailor -d -c .tailor errors.rb`
40
40
  Then the output should match /File has 2 trailing newlines/
41
+ And the output should not match /SystemExit/
41
42
  And the exit status should be 1
42
43
 
44
+ Scenario: Rake task, warnings found, but no errors
45
+ Given a file named "warnings.rb" with:
46
+ """
47
+ puts 'hi'
48
+
49
+
50
+ """
51
+ And my configuration file ".tailor" looks like:
52
+ """
53
+ Tailor.config do |config|
54
+ config.file_set 'warnings.rb' do |style|
55
+ style.trailing_newlines 0, level: :warn
56
+ end
57
+ end
58
+ """
59
+ And a file named "Rakefile" with:
60
+ """
61
+ require 'tailor/rake_task'
62
+
63
+ Tailor::RakeTask.new
64
+ """
65
+ When I successfully run `rake tailor`
66
+ Then the output should match /File has 2 trailing newlines/
67
+ And the exit status should be 0
68
+
69
+ Scenario: Rake task, errors found
70
+ Given a file named "errors.rb" with:
71
+ """
72
+ puts 'hi'
73
+
74
+
75
+ """
76
+ And my configuration file ".tailor" looks like:
77
+ """
78
+ Tailor.config do |config|
79
+ config.file_set 'errors.rb' do |style|
80
+ style.trailing_newlines 0, level: :error
81
+ end
82
+ end
83
+ """
84
+ And a file named "Rakefile" with:
85
+ """
86
+ require 'tailor/rake_task'
87
+
88
+ Tailor::RakeTask.new
89
+ """
90
+ When I run `rake tailor`
91
+ Then the output should match /File has 2 trailing newlines/
92
+ And the output should not match /SystemExit/
93
+ And the exit status should be 1
94
+
95
+ Scenario: Rake task, missing config file
96
+ Given a file named "errors.rb" with:
97
+ """
98
+ puts 'hi'
99
+
100
+
101
+ """
102
+ And my configuration file ".tailor" looks like:
103
+ """
104
+ Tailor.config do |config|
105
+ config.file_set 'errors.rb' do |style|
106
+ style.trailing_newlines 0, level: :error
107
+ end
108
+ end
109
+ """
110
+ And a file named "Rakefile" with:
111
+ """
112
+ require 'tailor/rake_task'
113
+
114
+ Tailor::RakeTask.new do |t|
115
+ t.config_file = 'asdfasdfasdfasdfadsfasdfasdfadsfadsfadsfasdfasdfasdfsad'
116
+ end
117
+ """
118
+ When I run `rake tailor`
119
+ Then the output should match /No config file found at/
120
+ And the output should not match /SystemExit/
121
+ And the exit status should be 1
@@ -97,6 +97,8 @@ class Tailor
97
97
  rescue Tailor::RuntimeError => ex
98
98
  STDERR.puts ex.message
99
99
  STDERR.puts ex.backtrace.join("\n")
100
+ rescue SystemExit => ex
101
+ exit(ex.status)
100
102
  rescue Exception => ex
101
103
  STDERR.puts("#{ex.message} (#{ex.class})")
102
104
  STDERR.puts(ex.backtrace.join("\n"))
@@ -1,3 +1,3 @@
1
1
  class Tailor
2
- VERSION = '1.1.4'
2
+ VERSION = '1.1.5'
3
3
  end
@@ -2,5 +2,5 @@ require_relative '../../spec_helper'
2
2
  require 'tailor/version'
3
3
 
4
4
  describe Tailor::VERSION do
5
- it { should == "1.1.4" }
5
+ it { should == "1.1.5" }
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-30 00:00:00.000000000 Z
12
+ date: 2013-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: log_switch
@@ -348,7 +348,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
348
  version: '0'
349
349
  requirements: []
350
350
  rubyforge_project:
351
- rubygems_version: 1.8.24
351
+ rubygems_version: 1.8.23
352
352
  signing_key:
353
353
  specification_version: 3
354
354
  summary: A Ruby style & complexity measurer