Rakefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. require 'rubygems'
  2. require 'bundler'
  3. Bundler.setup(:default, :development)
  4. require 'rake'
  5. require 'jeweler'
  6. require 'rspec/core/rake_task'
  7. require File.expand_path("../lib/treetop/version", __FILE__)
  8. Jeweler::Tasks.new do |gem|
  9. gem.name = "treetop"
  10. gem.version = Treetop::VERSION::STRING
  11. gem.author = "Nathan Sobo"
  12. gem.license = "MIT"
  13. gem.email = "cliffordheath@gmail.com"
  14. gem.homepage = "http://functionalform.blogspot.com"
  15. gem.platform = Gem::Platform::RUBY
  16. gem.summary = "A Ruby-based text parsing and interpretation DSL"
  17. gem.files = ["LICENSE", "README.md", "Rakefile", "treetop.gemspec", "{spec,lib,bin,doc,examples}/**/*"].map{|p| Dir[p]}.flatten
  18. gem.bindir = "bin"
  19. gem.executables = ["tt"]
  20. gem.require_path = "lib"
  21. gem.autorequire = "treetop"
  22. gem.has_rdoc = false
  23. gem.add_dependency "polyglot", ">= 0.3.1"
  24. end
  25. Jeweler::RubygemsDotOrgTasks.new
  26. task :default => :spec
  27. RSpec::Core::RakeTask.new do |t|
  28. t.pattern = 'spec/**/*spec.rb'
  29. # t.libs << 'spec' # @todo not sure what this did in the original rspec 1.3
  30. end
  31. task :spec => 'lib/treetop/compiler/metagrammar.treetop'
  32. file 'lib/treetop/compiler/metagrammar.treetop' do |t|
  33. unless $bootstrapped_gen_1_metagrammar
  34. load File.expand_path('../lib/treetop/bootstrap_gen_1_metagrammar.rb', __FILE__)
  35. end
  36. Treetop::Compiler::GrammarCompiler.new.compile(METAGRAMMAR_PATH)
  37. end
  38. task :version do
  39. puts RUBY_VERSION
  40. end
  41. desc 'Generate website files'
  42. task :website_generate do
  43. `cd doc; ruby ./site.rb`
  44. end
  45. desc 'Upload website files'
  46. task :website_upload do
  47. rubyforge_config_file = "#{ENV['HOME']}/.rubyforge/user-config.yml"
  48. rubyforge_config = YAML.load_file(rubyforge_config_file)
  49. `rsync -aCv doc/site/ #{rubyforge_config['username']}@rubyforge.org:/var/www/gforge-projects/treetop/`
  50. end
  51. desc 'Generate and upload website files'
  52. task :website => [:website_generate, :website_upload]