dirty 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,6 +4,8 @@ dirty
4
4
  Easily run dirty (changed, untracked, added) cucumber features in the current directory when using Git.
5
5
 
6
6
  Usage:
7
+
8
+ $ gem install dirty
7
9
  $ dirty
8
10
 
9
11
  Credits:
data/dirty.gemspec CHANGED
@@ -19,6 +19,4 @@ Gem::Specification.new do |s|
19
19
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
-
23
- s.add_runtime_dependency 'grit', '~> 2.4.1'
24
22
  end
data/lib/dirty.rb CHANGED
@@ -1,36 +1,14 @@
1
- require 'grit'
2
-
3
1
  class Dirty
4
- def repo
5
- @repo ||= Grit::Repo.new(dir)
6
- end
7
-
8
- def changed_files
9
- files(:changed)
10
- end
11
-
12
- def added_files
13
- files(:added)
14
- end
15
-
16
- def untracked_files
17
- files(:untracked)
18
- end
19
-
20
- def files(type)
21
- repo.status.send(type).map(&:first)
2
+ def status
3
+ `git status --porcelain`.split("\n")
22
4
  end
23
5
 
24
6
  def dirty_files
25
- changed_files | added_files | untracked_files
7
+ status.reject { |f| f[/^ D/] }
26
8
  end
27
9
 
28
10
  def dirty_features
29
- dirty_files.select { |f| f.split('.').last[/feature/] }
30
- end
31
-
32
- def dir
33
- File.expand_path('.')
11
+ dirty_files.map { |s| s[/(features.*\.feature)/] }
34
12
  end
35
13
 
36
14
  def self.run
data/lib/dirty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dirty
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  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.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Robert Pitts
@@ -10,20 +10,10 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-07 00:00:00 -04:00
13
+ date: 2011-04-08 00:00:00 -04:00
14
14
  default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: grit
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ~>
23
- - !ruby/object:Gem::Version
24
- version: 2.4.1
25
- type: :runtime
26
- version_requirements: *id001
15
+ dependencies: []
16
+
27
17
  description: |-
28
18
  Easily run dirty cucumber features in your current project
29
19
  if you're using git