Skip to content

Commit

Permalink
Use which to resolve to actual path
Browse files Browse the repository at this point in the history
  • Loading branch information
flori committed Feb 21, 2019
1 parent 81fbce0 commit 3631dad
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3631dad

Please sign in to comment.