summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorUbiratan Pires Alberton <u.alberton@gmail.com>2009-10-05 18:55:26 -0300
committerUbiratan Pires Alberton <u.alberton@gmail.com>2009-10-05 18:55:26 -0300
commit457cef9a455aa1a6e4e5341e380df37c75de0d74 (patch)
treec92c210ac54a27c2f567e2a5a14a1643b319cc61 /Rakefile
parentcaf23f2b2327968e0cbeda716dbda671b40ee331 (diff)
downloadjson-457cef9a455aa1a6e4e5341e380df37c75de0d74.tar.gz
Warn about the absence of rake-compiler if it's not installed.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile12
1 files 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