Sha256: 38c51e0f993dbf09f111b27fcba3cc6646e39a2bcf69be02f6471c7bf6a96bc4

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

# -*- ruby -*-

require 'rubygems'
require 'hoe'

Hoe.add_include_dirs("lib",
                     "../../ruby_parser/dev/lib",
                     "../../sexp_processor/dev/lib")

Hoe.plugin :seattlerb
Hoe.plugin :isolate
Hoe.plugin :rdoc

Hoe.spec 'ruby2ruby' do
  developer 'Ryan Davis', 'ryand-ruby@zenspider.com'

  license "MIT"

  dependency "sexp_processor", "~> 4.6"
  dependency "ruby_parser",    "~> 3.1"
end

def process ruby, file="stdin"
  require "ruby_parser"
  require "ruby2ruby"

  parser    = RubyParser.new
  ruby2ruby = Ruby2Ruby.new

  begin
    sexp = parser.process(ruby, file)

    pp sexp if ENV["SEXP"]

    ruby2ruby.process(sexp)
  rescue Interrupt => e
    raise e
  end
end

task :stress do
  $: << "lib"
  $: << "../../ruby_parser/dev/lib"
  require "pp"

  files = Dir["../../*/dev/**/*.rb"].reject { |s| s =~ %r%/gems/% }

  warn "Stress testing against #{files.size} files"

  bad = {}

  files.each do |file|
    warn file

    begin
      process File.read(file), file
    rescue Interrupt => e
      raise e
    rescue Exception => e
      bad[file] = e
    end
  end

  pp bad
end

task :debug => :isolate do
  ENV["V"] ||= "18"

  file = ENV["F"] || ENV["FILE"]

  ruby = if file then
           File.read(file)
         else
           file = "env"
           ENV["R"] || ENV["RUBY"]
         end

  puts process(ruby, file)
end

task :bugs do
  sh "for f in bug*.rb ; do #{Gem.ruby} -S rake debug F=$f && rm $f ; done"
end

# vim: syntax=ruby

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby2ruby-2.4.4 Rakefile
ruby2ruby-2.4.3 Rakefile
ruby2ruby-2.4.2 Rakefile