Last active
December 21, 2015 12:29
-
-
Save andoneve/6306216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/gem_tasks" | |
require 'rspec/core/rake_task' | |
RSpec::Core::RakeTask.new(:test) | |
namespace :rexical do | |
task :clean do | |
`rm lib/lani/parser/lexer.rb` | |
end | |
task :regenerate do | |
has_rexical = `which rexical` | |
if has_rexical | |
`rex lib/lani/parser/lani.rex -o lib/lani/parser/lexer.rb` | |
else | |
puts "You need Rexical. Install it by doing:" | |
puts | |
puts "\t\tgem install rexical" | |
puts | |
puts "Or just type `bundle install`." | |
end | |
end | |
end | |
namespace :racc do | |
task :clean do | |
`rm lib/lani/parser/parser.rb` | |
end | |
task :regenerate do | |
has_racc = `which racc` | |
if has_racc | |
`racc lib/lani/parser/lani.y -o lib/lani/parser/parser.rb` | |
else | |
puts "You need Racc. Install it by doing:" | |
puts | |
puts "\t\tgem install racc" | |
puts | |
puts "Or just type `bundle install`." | |
end | |
end | |
end | |
task :test => ["rex:regenerate", "racc:regenerate"] | |
task :default => :test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment