hen 0.0.6.193 → 0.0.6.195

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/hen/dsl.rb +13 -12
  3. metadata +6 -6
data/Rakefile CHANGED
@@ -13,6 +13,6 @@ Hen.lay! {{
13
13
  "helper that fits my own personal style.",
14
14
  :files => FileList['lib/**/*.rb', 'bin/*'].to_a,
15
15
  :extra_files => FileList['[A-Z]*', 'lib/hens/*.rake', 'example/*', 'example/.henrc'].to_a,
16
- :dependencies => ['rubyforge', ['ruby-nuggets', '>= 0.0.4']]
16
+ :dependencies => ['rubyforge', ['ruby-nuggets', '>= 0.0.7']]
17
17
  }
18
18
  }}
@@ -26,6 +26,8 @@
26
26
  ###############################################################################
27
27
  #++
28
28
 
29
+ require 'nuggets/file/which'
30
+
29
31
  class Hen
30
32
 
31
33
  # Some helper methods for use inside of a Hen definition.
@@ -55,19 +57,18 @@ class Hen
55
57
  task(t, &block)
56
58
  end
57
59
 
58
- # Execute a series of commands until one of them succeeds. Intended for
59
- # platform-dependent alternatives (Command A is not available? Then try
60
- # B instead).
61
- #
62
- # TODO: This won't detect cases where a command is actually available,
63
- # but simply fails.
60
+ # Find a command that is executable and run it. Intended for
61
+ # platform-dependent alternatives (Command A is not available?
62
+ # Then try B instead).
64
63
  def execute(*commands)
65
- commands.each { |command|
66
- ok, res = sh(command) { |ok, res| [ok, res] }
67
- break if ok
68
-
69
- warn "Error while executing command (return code #{res.exitstatus})"
70
- }
64
+ if command = File.which_command(commands)
65
+ sh(command) { |ok, res|
66
+ warn "Error while executing command: #{command} " <<
67
+ "(return code #{res.exitstatus})" unless ok
68
+ }
69
+ else
70
+ warn "Command not found: #{commands.join('; ')}"
71
+ end
71
72
  end
72
73
 
73
74
  # Prepare the use of Rubyforge, optionally logging in right away.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6.193
4
+ version: 0.0.6.195
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Wille
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: 0.0.4
31
+ version: 0.0.7
32
32
  version:
33
33
  description: Hoe or Echoe? No, thanks! Just a Rake helper that fits my own personal style.
34
34
  email: jens.wille@uni-koeln.de
@@ -60,15 +60,15 @@ has_rdoc: true
60
60
  homepage: http://prometheus.rubyforge.org/hen
61
61
  post_install_message:
62
62
  rdoc_options:
63
+ - --line-numbers
64
+ - --all
65
+ - --main
66
+ - README
63
67
  - --inline-source
64
68
  - --charset
65
69
  - UTF-8
66
70
  - --title
67
71
  - hen Application documentation
68
- - --all
69
- - --main
70
- - README
71
- - --line-numbers
72
72
  require_paths:
73
73
  - lib
74
74
  required_ruby_version: !ruby/object:Gem::Requirement