diff options
author | Florian Frank <flori@ping.de> | 2019-02-21 22:50:11 +0100 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2019-02-21 23:12:31 +0100 |
commit | 3631dad29db6f6e940dc781b2867485bdff37648 (patch) | |
tree | a64173b09e9b5f2147bc965ee351d7a974a249b2 /Rakefile | |
parent | 81fbce0aa66738b3ea9758db2aee44b80bb8f9a5 (diff) | |
download | json-3631dad29db6f6e940dc781b2867485bdff37648.tar.gz |
Use which to resolve to actual path
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -23,8 +23,13 @@ class UndocumentedTestTask < Rake::TestTask def desc(*) end end -MAKE = ENV['MAKE'] || %w[gmake make].find { |c| system(c, '-v') } -BUNDLE = ENV['BUNDLE'] || %w[bundle].find { |c| system(c, '-v') } +which = lambda { |c| + w = `which #{c}` + break w.chomp unless w.empty? +} + +MAKE = ENV['MAKE'] || %w[gmake make].find(&which) +BUNDLE = ENV['BUNDLE'] || %w[bundle].find(&which) PKG_NAME = 'json' PKG_TITLE = 'JSON Implementation for Ruby' PKG_VERSION = File.read('VERSION').chomp @@ -47,8 +52,8 @@ JAVA_CLASSES = [] JRUBY_PARSER_JAR = File.expand_path("lib/json/ext/parser.jar") JRUBY_GENERATOR_JAR = File.expand_path("lib/json/ext/generator.jar") -RAGEL_CODEGEN = %w[rlcodegen rlgen-cd ragel].find { |c| system(c, '-v') } -RAGEL_DOTGEN = %w[rlgen-dot rlgen-cd ragel].find { |c| system(c, '-v') } +RAGEL_CODEGEN = %w[rlcodegen rlgen-cd ragel].find(&which) +RAGEL_DOTGEN = %w[rlgen-dot rlgen-cd ragel].find(&which) desc "Installing library (pure)" task :install_pure => :version do |