Skip to content

Commit

Permalink
do not use dirglobs for file requirement as the list is nondeterminis…
Browse files Browse the repository at this point in the history
…tic.
  • Loading branch information
tenderlove committed Jun 8, 2009
1 parent ac2fca9 commit 272deb0
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 73 deletions.
File renamed without changes.
5 changes: 2 additions & 3 deletions Manifest.txt
@@ -1,6 +1,6 @@
CHANGELOG.txt
CHANGELOG.rdoc
Manifest.txt
README.txt
README.rdoc
Rakefile
lib/parser.y
lib/rkelly.rb
Expand Down Expand Up @@ -64,7 +64,6 @@ lib/rkelly/visitors/pointcut_visitor.rb
lib/rkelly/visitors/real_sexp_visitor.rb
lib/rkelly/visitors/sexp_visitor.rb
lib/rkelly/visitors/visitor.rb
rkelly.gemspec
test/ecma_script_test_case.rb
test/execute_test_case.rb
test/execution_contexts/test_10_1_3-1.rb
Expand Down
2 changes: 1 addition & 1 deletion README.txt → README.rdoc
@@ -1,6 +1,6 @@
= RKelly

http://rkelly.rubyforge.org/
* http://rkelly.rubyforge.org/

== DESCRIPTION

Expand Down
56 changes: 5 additions & 51 deletions Rakefile
Expand Up @@ -8,14 +8,11 @@ require 'rkelly/constants'
GENERATED_PARSER = "lib/rkelly/generated_parser.rb"

HOE = Hoe.new('rkelly', RKelly::VERSION) do |p|
p.rubyforge_name = 'rkelly'
p.author = 'Aaron Patterson'
p.email = 'aaronp@rubyforge.org'
p.summary = "RKelly parses JavaScript and returns a parse tree suitable for feeding to Ruby2Ruby."
p.description = p.paragraphs_of('README.txt', 3).join("\n\n")
p.url = p.paragraphs_of('README.txt', 1).first.strip
p.changes = p.paragraphs_of('CHANGELOG.txt', 0..2).join("\n\n")
p.clean_globs = [GENERATED_PARSER]
p.developer('Aaron Patterson', 'aaronp@rubyforge.org')
p.readme_file = 'README.rdoc'
p.history_file = 'CHANGELOG.rdoc'
p.extra_rdoc_files = FileList['*.rdoc']
p.clean_globs = [GENERATED_PARSER]
end

file GENERATED_PARSER => "lib/parser.y" do |t|
Expand All @@ -32,49 +29,6 @@ task :parser => GENERATED_PARSER
Rake::Task[:test].prerequisites << :parser
Rake::Task[:check_manifest].prerequisites << :parser

desc "Create a new node"
task :new_node do
filename = ENV['NODE']
raise "invalid node name" if !filename

classname = nil
if filename =~ /[A-Z]/
classname = filename
filename = filename.gsub(/([A-Z])/) { |x| "_#{x.downcase}" }.gsub(/^_/, '')
end

full_file = "lib/rkelly/nodes/#{filename}.rb"
test_file = "test/test_#{filename}.rb"
puts "writing: #{full_file}"
File.open(full_file, 'wb') { |f|
f.write <<-END
module RKelly
module Nodes
class #{classname} < Node
end
end
end
END
}
puts "adding to nodes include"
File.open("lib/rkelly/nodes.rb", 'ab') { |f|
f.puts "require 'rkelly/nodes/#{filename}'"
}

puts "writing test case: #{test_file}"
File.open(test_file, 'wb') { |f|
f.write <<-END
require File.dirname(__FILE__) + "/helper"
class #{classname}Test < NodeTestCase
def test_failure
assert false
end
end
END
}
end

namespace :gem do
task :spec do
File.open("#{HOE.name}.gemspec", 'w') do |f|
Expand Down
26 changes: 23 additions & 3 deletions lib/rkelly/nodes.rb
@@ -1,5 +1,25 @@
require 'rkelly/nodes/node'
require 'rkelly/nodes/function_expr_node'
Dir[File.join(File.dirname(__FILE__), "nodes/*_node.rb")].each do |file|
require file[/rkelly\/nodes\/.*/]
end
require 'rkelly/nodes/binary_node'
require 'rkelly/nodes/bracket_accessor_node'
require 'rkelly/nodes/case_clause_node'
require 'rkelly/nodes/comma_node'
require 'rkelly/nodes/conditional_node'
require 'rkelly/nodes/dot_accessor_node'
require 'rkelly/nodes/for_in_node'
require 'rkelly/nodes/for_node'
require 'rkelly/nodes/function_call_node'
require 'rkelly/nodes/function_decl_node'
require 'rkelly/nodes/function_expr_node'
require 'rkelly/nodes/if_node'
require 'rkelly/nodes/label_node'
require 'rkelly/nodes/new_expr_node'
require 'rkelly/nodes/not_strict_equal_node'
require 'rkelly/nodes/op_equal_node'
require 'rkelly/nodes/postfix_node'
require 'rkelly/nodes/prefix_node'
require 'rkelly/nodes/property_node'
require 'rkelly/nodes/resolve_node'
require 'rkelly/nodes/strict_equal_node'
require 'rkelly/nodes/try_node'
require 'rkelly/nodes/var_decl_node'

0 comments on commit 272deb0

Please sign in to comment.