dirty 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/dirty +1 -1
  2. data/lib/dirty/version.rb +1 -1
  3. data/lib/dirty.rb +15 -7
  4. metadata +2 -2
data/bin/dirty CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'dirty'
4
4
 
5
- Dirty.run
5
+ exit(Dirty.perform)
data/lib/dirty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dirty
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/dirty.rb CHANGED
@@ -1,4 +1,6 @@
1
- class Dirty
1
+ module Dirty
2
+ extend self
3
+
2
4
  def status
3
5
  `git status --porcelain`.split("\n")
4
6
  end
@@ -8,14 +10,20 @@ class Dirty
8
10
  end
9
11
 
10
12
  def dirty_features
11
- dirty_files.map { |s| s[/(features.*\.feature)/] }
12
- end
13
-
14
- def self.run
15
- new.perform
13
+ dirty_files.map do |s|
14
+ s[/(features.*\.feature)/]
15
+ end.compact
16
16
  end
17
17
 
18
18
  def perform
19
- system("cucumber #{dirty_features.join(' ')}") if dirty_features.any?
19
+ return 0 if dirty_features.empty?
20
+
21
+ command = "cucumber #{dirty_features * ' '}"
22
+ puts command
23
+ system command
24
+
25
+ # Return cucumber's error status.
26
+ $?.exitstatus
20
27
  end
28
+
21
29
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dirty
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Robert Pitts
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-08 00:00:00 -04:00
13
+ date: 2011-04-10 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16