dirty 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in dirty.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,11 @@
1
+ dirty
2
+ =====
3
+
4
+ Easily run dirty (changed, untracked, added) cucumber features in the current directory when using Git.
5
+
6
+ Usage:
7
+ $ dirty
8
+
9
+ Credits:
10
+
11
+ Robert Pitts
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/dirty ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'dirty'
4
+
5
+ Dirty.run
data/dirty.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "dirty/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "dirty"
7
+ s.version = Dirty::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Robert Pitts"]
10
+ s.email = ["rbxbxdev@gmail.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{Run those dirty features!}
13
+ s.description = %q{Easily run dirty cucumber features in your current project
14
+ if you're using git}
15
+
16
+ s.rubyforge_project = "dirty"
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+
23
+ s.add_runtime_dependency 'grit', '~> 2.4.1'
24
+ end
data/lib/dirty.rb ADDED
@@ -0,0 +1,43 @@
1
+ require 'grit'
2
+
3
+ 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)
22
+ end
23
+
24
+ def dirty_files
25
+ changed_files | added_files | untracked_files
26
+ end
27
+
28
+ def dirty_features
29
+ dirty_files.select { |f| f.split('.').last[/feature/] }
30
+ end
31
+
32
+ def dir
33
+ File.expand_path('.')
34
+ end
35
+
36
+ def self.run
37
+ new.perform
38
+ end
39
+
40
+ def perform
41
+ system("cucumber #{dirty_features.join(' ')}") if dirty_features.any?
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ module Dirty
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dirty
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Robert Pitts
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-04-07 00:00:00 -04:00
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
27
+ description: |-
28
+ Easily run dirty cucumber features in your current project
29
+ if you're using git
30
+ email:
31
+ - rbxbxdev@gmail.com
32
+ executables:
33
+ - dirty
34
+ extensions: []
35
+
36
+ extra_rdoc_files: []
37
+
38
+ files:
39
+ - .gitignore
40
+ - Gemfile
41
+ - README.md
42
+ - Rakefile
43
+ - bin/dirty
44
+ - dirty.gemspec
45
+ - lib/dirty.rb
46
+ - lib/dirty/version.rb
47
+ has_rdoc: true
48
+ homepage: ""
49
+ licenses: []
50
+
51
+ post_install_message:
52
+ rdoc_options: []
53
+
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ requirements: []
69
+
70
+ rubyforge_project: dirty
71
+ rubygems_version: 1.6.2
72
+ signing_key:
73
+ specification_version: 3
74
+ summary: Run those dirty features!
75
+ test_files: []
76
+