sprinkle 0.6.1 → 0.6.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,18 +18,9 @@ module Sprinkle
18
18
  module Executable
19
19
  Sprinkle::Verify.register(Sprinkle::Verifiers::Executable)
20
20
 
21
- # Checks if <tt>path</tt> is an executable script. This verifier is "smart" because
22
- # if the path contains a forward slash '/' then it assumes you're checking an
23
- # absolute path to an executable. If no '/' is in the path, it assumes you're
24
- # checking for a global executable that would be available anywhere on the command line.
21
+ # Checks if <tt>path</tt> is an executable script using which
22
+ # - accepts both absolute paths and binary names with no path
25
23
  def has_executable(path)
26
- # Be smart: If the path includes a forward slash, we're checking
27
- # an absolute path. Otherwise, we're checking a global executable
28
- if path.include?('/')
29
- test "-x #{path}"
30
- else
31
- @commands << "[ -n \"`echo \\`which #{path}\\``\" ]"
32
- end
33
24
  @commands << "which #{path}"
34
25
  end
35
26
 
@@ -62,6 +62,9 @@ module Sprinkle
62
62
  include Sprinkle::Attributes
63
63
  attr_accessor :package, :description, :commands #:nodoc:
64
64
 
65
+ delegate :opts, :to => :package
66
+ delegate :args, :to => :package
67
+
65
68
  class <<self
66
69
  # Register a verification module
67
70
  def register(new_module)
@@ -1,3 +1,3 @@
1
1
  module Sprinkle
2
- Version = "0.6.1"
2
+ Version = "0.6.1.1"
3
3
  end
@@ -116,11 +116,11 @@ describe Sprinkle::Verify do
116
116
  end
117
117
 
118
118
  it 'should do a "test -x" to check for an executable' do
119
- @verification.commands.should include("test -x /usr/bin/ruby")
119
+ @verification.commands.should include("which /usr/bin/ruby")
120
120
  end
121
121
 
122
122
  it 'should test the "which" command to look for a global executable' do
123
- @verification.commands.should include('[ -n "`echo \`which rails\``" ]')
123
+ @verification.commands.should include('which rails')
124
124
  end
125
125
 
126
126
  it 'should test the process list to find a process' do
@@ -138,6 +138,16 @@ describe Sprinkle::Verify do
138
138
  it 'should check that an RPM is installed' do
139
139
  @verification.commands.should include("rpm -qa | grep ntp")
140
140
  end
141
+
142
+ it 'should delegate opts' do
143
+ @package.opts = {:tester_opt => "test-opt"}
144
+ @verification.opts[:tester_opt].should == "test-opt"
145
+ end
146
+
147
+ it 'should delegate args' do
148
+ @package.args = ["test-arg"]
149
+ @verification.args[0].should == "test-arg"
150
+ end
141
151
  end
142
152
 
143
153
  describe 'with process' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprinkle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-05-28 00:00:00.000000000 Z
13
+ date: 2013-05-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec