From 457cef9a455aa1a6e4e5341e380df37c75de0d74 Mon Sep 17 00:00:00 2001 From: Ubiratan Pires Alberton Date: Mon, 5 Oct 2009 18:55:26 -0300 Subject: Warn about the absence of rake-compiler if it's not installed. --- Rakefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 2fdd671..e2c6b4e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,14 @@ begin require 'rake/gempackagetask' +rescue LoadError +end + +begin require 'rake/extensiontask' rescue LoadError + puts "WARNING: rake-compiler is not installed. You will not be able to build the json gem until you install it." end + require 'rake/clean' CLOBBER.include Dir['benchmarks/data/*.{dat,log}'] @@ -95,7 +101,7 @@ task :ragel_dot_ps do root = 'diagrams' specs = [] File.new(RAGEL_PATH).grep(/^\s*machine\s*(\S+);\s*$/) { specs << $1 } - for s in specs + for s in specs if RAGEL_DOTGEN == 'ragel' system "ragel #{RAGEL_PATH} -S#{s} -p -V | dot -Tps -o#{root}/#{s}.ps" else @@ -109,7 +115,7 @@ task :ragel_dot_png do root = 'diagrams' specs = [] File.new(RAGEL_PATH).grep(/^\s*machine\s*(\S+);\s*$/) { specs << $1 } - for s in specs + for s in specs if RAGEL_DOTGEN == 'ragel' system "ragel #{RAGEL_PATH} -S#{s} -p -V | dot -Tpng -o#{root}/#{s}.png" else @@ -233,7 +239,7 @@ if defined?(Gem) and defined?(Rake::GemPackageTask) and defined?(Rake::Extension ext.ext_dir = 'ext/json/ext/parser' ext.lib_dir = 'lib/json/ext' end - + Rake::ExtensionTask.new do |ext| ext.name = 'generator' ext.gem_spec = spec_ext -- cgit v1.2.1