lachlan-sprinkle 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,7 @@ module Sprinkle
19
19
 
20
20
  def process(name, commands, roles, suppress_and_return_failures = false) #:nodoc:
21
21
  commands.each do |command|
22
+ command = "cmd.exe /c " + command if RUBY_PLATFORM =~ /win32/
22
23
  system command
23
24
  return false if $?.to_i != 0
24
25
  end
@@ -9,6 +9,7 @@ module Sprinkle
9
9
 
10
10
  # Tests that the directory <tt>dir</tt> exists.
11
11
  def has_directory(dir)
12
+ dir = dir.to_s
12
13
  if RUBY_PLATFORM =~ /win32/
13
14
  dir += "\\" unless dir[-1,1] == "\\"
14
15
  command = "if exist \"#{dir}\" (exit 0) else (exit 1)"
@@ -23,6 +23,7 @@ module Sprinkle
23
23
  # absolute path to an executable. If no '/' is in the path, it assumes you're
24
24
  # checking for a global executable that would be available anywhere on the command line.
25
25
  def has_executable(path)
26
+ path = path.to_s
26
27
  if RUBY_PLATFORM =~ /win32/
27
28
  raise NotImplementedError, "Win32 platform does not support checking for executables"
28
29
  else
@@ -15,6 +15,7 @@ module Sprinkle
15
15
 
16
16
  # Checks to make sure <tt>path</tt> is a file on the remote server.
17
17
  def has_file(path)
18
+ path = path.to_s
18
19
  if RUBY_PLATFORM =~ /win32/
19
20
  command = "if exist \"#{path}\" (if not exist \"#{path}\\\" (exit 0) else (exit 1)) else (exit 1)"
20
21
  command << ' > NUL 2>&1' unless logger.debug?
@@ -25,6 +26,7 @@ module Sprinkle
25
26
  end
26
27
 
27
28
  def file_contains(path, text)
29
+ path, text = path.to_s, text.to_s
28
30
  if RUBY_PLATFORM =~ /win32/
29
31
  command = "findstr /m /c:\"#{text}\" \"#{path}\""
30
32
  command << ' > NUL 2>&1' unless logger.debug?
@@ -14,6 +14,7 @@ module Sprinkle
14
14
  # Checks to make sure <tt>process</tt> is a process running
15
15
  # on the remote server.
16
16
  def has_process(process)
17
+ process = process.to_s
17
18
  if RUBY_PLATFORM =~ /win32/
18
19
  command = "tasklist /fo table /nh | findstr /c:\"#{process}\""
19
20
  command << ' > NUL 2>&1' unless logger.debug?
@@ -17,6 +17,7 @@ module Sprinkle
17
17
 
18
18
  # Checks if a gem exists by calling "sudo gem list" and grepping against it.
19
19
  def has_gem(name, version=nil)
20
+ name = name.to_s
20
21
  version = version.nil? ? '' : version.gsub('.', '\.')
21
22
  if RUBY_PLATFORM =~ /win32/
22
23
  command = "gem list | findstr /r /c:\"^#{name} (.*#{version}.*)$\""
@@ -19,10 +19,11 @@ module Sprinkle
19
19
  # Checks that <tt>symlink</tt> is a symbolic link. If <tt>file</tt> is
20
20
  # given, it checks that <tt>symlink</tt> points to <tt>file</tt>
21
21
  def has_symlink(symlink, file = nil)
22
+ symlink, file = symlink.to_s, file.to_s
22
23
  if RUBY_PLATFORM =~ /win32/
23
24
  raise NotImplementedError, "Win32 platform does not support checking for symbolic links"
24
25
  else
25
- if file.nil?
26
+ if file.empty?
26
27
  @commands << "test -L #{symlink}"
27
28
  else
28
29
  @commands << "test '#{file}' = `readlink #{symlink}`"
@@ -2,7 +2,7 @@ module Sprinkle #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 8
5
+ TINY = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/sprinkle.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{sprinkle}
3
- s.version = "0.0.8"
3
+ s.version = "0.0.9"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Marcus Crafter", "Mitchell Hashimoto"]
7
- s.date = %q{2009-03-30}
7
+ s.date = %q{2009-03-31}
8
8
  s.default_executable = %q{sprinkle}
9
9
  s.description = %q{Ruby DSL based software provisioning tool}
10
10
  s.email = ["crafterm@redartisan.com", "mitchell.hashimoto@citrusbyte.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lachlan-sprinkle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Crafter
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-03-30 00:00:00 -07:00
13
+ date: 2009-03-31 00:00:00 -07:00
14
14
  default_executable: sprinkle
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency