executioner 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg/
data/.kick ADDED
@@ -0,0 +1 @@
1
+ recipe :ruby
data/VERSION.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  ---
2
- :minor: 2
2
+ :minor: 3
3
3
  :patch: 0
4
4
  :major: 0
5
+ :build:
@@ -0,0 +1,51 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{executioner}
8
+ s.version = "0.3.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Eloy Duran"]
12
+ s.date = %q{2009-12-09}
13
+ s.description = %q{Execute CLI utilities}
14
+ s.email = %q{eloy@fngtps.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".gitignore",
21
+ ".kick",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION.yml",
26
+ "executioner.gemspec",
27
+ "lib/executioner.rb",
28
+ "test/executioner_test.rb",
29
+ "test/test_helper.rb"
30
+ ]
31
+ s.homepage = %q{http://fingertips.github.com}
32
+ s.rdoc_options = ["--charset=UTF-8"]
33
+ s.require_paths = ["lib"]
34
+ s.rubygems_version = %q{1.3.5}
35
+ s.summary = %q{Execute CLI utilities}
36
+ s.test_files = [
37
+ "test/executioner_test.rb",
38
+ "test/test_helper.rb"
39
+ ]
40
+
41
+ if s.respond_to? :specification_version then
42
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
+ s.specification_version = 3
44
+
45
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
46
+ else
47
+ end
48
+ else
49
+ end
50
+ end
51
+
data/lib/executioner.rb CHANGED
@@ -5,7 +5,7 @@ module Executioner
5
5
  class ProcessError < ExecutionerError; end
6
6
  class ExecutableNotFoundError < ExecutionerError; end
7
7
 
8
- SEARCH_PATHS = %w{ /bin /usr/bin /usr/local/bin /opt/local/bin }
8
+ SEARCH_PATHS = %W{ #{File.expand_path('~/bin')} /bin /usr/bin /usr/local/bin /opt/homebrew/bin /opt/local/bin }
9
9
 
10
10
  class << self
11
11
  attr_accessor :logger
@@ -160,6 +160,7 @@ describe "Executioner, class methods" do
160
160
  end
161
161
 
162
162
  it "should be possible to find an executable" do
163
+ File.stubs(:exist?).with(File.expand_path('~/bin/sh')).returns(false)
163
164
  File.stubs(:exist?).with('/bin/sh').returns(true)
164
165
  Executioner::ClassMethods.find_executable('sh').should == '/bin/sh'
165
166
  end
@@ -170,9 +171,11 @@ describe "Executioner, class methods" do
170
171
  end
171
172
 
172
173
  it "should yield all found executables, but use the one for which the proc returns a truthful value" do
174
+ File.stubs(:exist?).with(File.expand_path('~/bin/with_selection_proc')).returns(true)
173
175
  File.stubs(:exist?).with('/bin/with_selection_proc').returns(true)
174
176
  File.stubs(:exist?).with('/usr/bin/with_selection_proc').returns(true)
175
177
  File.stubs(:exist?).with('/usr/local/bin/with_selection_proc').returns(true)
178
+ File.stubs(:exist?).with('/opt/homebrew/bin/with_selection_proc').returns(true)
176
179
  File.stubs(:exist?).with('/opt/local/bin/with_selection_proc').returns(true)
177
180
 
178
181
  AClassThatUsesSubshells.executable(:with_selection_proc, :select_if => lambda { |executable| nil })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: executioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-08 00:00:00 +02:00
12
+ date: 2009-12-09 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -23,10 +23,13 @@ extra_rdoc_files:
23
23
  - LICENSE
24
24
  - README.rdoc
25
25
  files:
26
+ - .gitignore
27
+ - .kick
26
28
  - LICENSE
27
29
  - README.rdoc
28
30
  - Rakefile
29
31
  - VERSION.yml
32
+ - executioner.gemspec
30
33
  - lib/executioner.rb
31
34
  - test/executioner_test.rb
32
35
  - test/test_helper.rb