Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: b1844566ea
...
compare: 3aeff96671
Checking mergeability… Don't worry, you can still create the pull request.
  • 6 commits
  • 13 files changed
  • 0 commit comments
  • 1 contributor
View
7 lib/decompiler/method/as_code.rb
@@ -1,7 +1,8 @@
-require 'internal/node/as_code'
-require 'internal/vm/iseq/as_code'
require 'internal/method'
-require 'internal/method/signature'
+
+require 'decompiler/node/as_code'
+require 'decompiler/vm/iseq/as_code'
+require 'decompiler/method/signature'
module MethodAsCode
# Returns a string representation of the method definition/body.
View
7 lib/decompiler/method/as_expression.rb
@@ -1,8 +1,9 @@
-require 'internal/node/as_expression'
-require 'internal/vm/iseq/as_expression'
-require 'internal/method/signature'
require 'internal/method'
+require 'decompiler/node/as_expression'
+require 'decompiler/vm/iseq/as_expression'
+require 'decompiler/method/signature'
+
module MethodAsExpression
# Return a single-line string representation of a method
# TODO: this method would be more aptly named "as_expression_string".
View
13 lib/decompiler/method/signature.rb
@@ -1,13 +1,14 @@
require 'internal/method'
require 'internal/node'
-require 'internal/node/as_expression'
-require 'internal/method/signature/argument'
-require 'internal/method/signature/node'
-require 'internal/method/signature/signature'
+
+require 'decompiler/node/as_expression'
+require 'decompiler/method/signature/argument'
+require 'decompiler/method/signature/node'
+require 'decompiler/method/signature/signature'
if defined?(RubyVM) then
-require 'internal/vm/bytedecoder'
-require 'internal/method/signature/iseq'
+require 'decompiler/vm/bytedecoder'
+require 'decompiler/method/signature/iseq'
end
module MethodSig
View
3  lib/decompiler/module/as_code.rb
@@ -1,6 +1,7 @@
-require 'internal/node/as_code'
require 'internal/module'
+require 'decompiler/node/as_code'
+
class Module
# TODO: it would be nice if we could go back and find the AST
# for the class instead of recreating the code from the class's
View
4 lib/decompiler/node/as_code.rb
@@ -1,6 +1,6 @@
require 'internal/node'
-require 'internal/node/as_expression'
-require 'internal/object/as_code'
+require 'decompiler/node/as_expression'
+require 'decompiler/object/as_code'
require 'rbconfig'
class Node
View
5 lib/decompiler/proc/as_code.rb
@@ -1,6 +1,7 @@
-require 'internal/node/as_code'
require 'internal/proc'
-require 'internal/proc/signature'
+
+require 'decompiler/node/as_code'
+require 'decompiler/proc/signature'
class Proc
# Return a string representation of a proc's definition/body,
View
5 lib/decompiler/proc/as_expression.rb
@@ -1,7 +1,8 @@
-require 'internal/node/as_expression'
-require 'internal/proc/signature'
require 'internal/proc'
+require 'decompiler/node/as_expression'
+require 'decompiler/proc/signature'
+
class Proc
# Return a single-line string representation of a proc's
# definition/body, similarly to +Method#as_expression+.
View
2  lib/decompiler/vm/iseq/as_code.rb
@@ -1,7 +1,7 @@
require 'internal/vm'
if defined?(RubyVM::InstructionSequence) then
- require 'internal/vm/bytedecoder'
+ require 'decompiler/vm/bytedecoder'
class RubyVM
class InstructionSequence
View
2  lib/decompiler/vm/iseq/as_expression.rb
@@ -1,7 +1,7 @@
require 'internal/vm'
if defined?(RubyVM::InstructionSequence) then
- require 'internal/vm/bytedecoder'
+ require 'decompiler/vm/bytedecoder'
class RubyVM
class InstructionSequence
View
4 ruby-decompiler.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = 'ruby-decompiler'
- s.version = '0.0.1'
+ s.version = '0.0.2'
s.summary = 'A decompiler for ruby (both YARV and MRI)'
s.homepage = 'http://github.com/cout/ruby-decompiler/'
s.author = 'Paul Brannan'
@@ -10,6 +10,8 @@ Ruby-decompiler is a decompiler for ruby code. Use it to deconstruct
method signatures and decompile bytecode (1.9.x) or the AST (1.8.x).
END_DESCRIPTION
+ s.add_dependency 'ruby-internal', '>= 0.8.4'
+
patterns = [
'lib/**/*.rb',
'README.rdoc',
View
44 test/test_as_code.rb
@@ -6,10 +6,10 @@
$:.unshift("#{dir}/../lib") if not $:.include?("#{dir}/../lib")
$:.unshift("#{dir}/../ext") if not $:.include?("#{dir}/../ext")
-require 'internal/node/as_code'
-require 'internal/method/as_code'
-require 'internal/module/as_code'
-require 'internal/proc/as_code'
+require 'decompiler/node/as_code'
+require 'decompiler/method/as_code'
+require 'decompiler/module/as_code'
+require 'decompiler/proc/as_code'
require 'expression_samples'
@@ -239,23 +239,23 @@ class ObjectWithFooAccessor
end
if __FILE__ == $0 then
- require 'test/unit/ui/console/testrunner'
-
- if Test::Unit.const_defined?(:AutoRunner) then
- exit Test::Unit::AutoRunner.run
- else
- if ARGV.empty? then
- suite = TC_As_Code.suite
- else
- suite = Test::Unit::TestSuite.new('TC_As_Code')
- TC_As_Code.suite.tests.each do |test|
- ARGV.each do |arg|
- suite << test if /#{arg}/ =~ test.name
- end
- end
- end
- result = Test::Unit::UI::Console::TestRunner.run(suite)
- exit(result.error_count + result.failure_count)
- end
+ # require 'test/unit/ui/console/testrunner'
+
+ # if Test::Unit.const_defined?(:AutoRunner) then
+ # exit Test::Unit::AutoRunner.run
+ # else
+ # if ARGV.empty? then
+ # suite = TC_As_Code.suite
+ # else
+ # suite = Test::Unit::TestSuite.new('TC_As_Code')
+ # TC_As_Code.suite.tests.each do |test|
+ # ARGV.each do |arg|
+ # suite << test if /#{arg}/ =~ test.name
+ # end
+ # end
+ # end
+ # result = Test::Unit::UI::Console::TestRunner.run(suite)
+ # exit(result.error_count + result.failure_count)
+ # end
end
View
42 test/test_as_expression.rb
@@ -6,9 +6,9 @@
$:.unshift("#{dir}/../lib") if not $:.include?("#{dir}/../lib")
$:.unshift("#{dir}/../ext") if not $:.include?("#{dir}/../ext")
-require 'internal/node/as_expression'
-require 'internal/method/as_expression'
-require 'internal/proc/as_expression'
+require 'decompiler/node/as_expression'
+require 'decompiler/method/as_expression'
+require 'decompiler/proc/as_expression'
require 'expression_samples'
@@ -207,23 +207,23 @@ class ObjectWithFooAccessor
end
if __FILE__ == $0 then
- require 'test/unit/ui/console/testrunner'
-
- if Test::Unit.const_defined?(:AutoRunner) then
- exit Test::Unit::AutoRunner.run
- else
- if ARGV.empty? then
- suite = TC_As_Expression.suite
- else
- suite = Test::Unit::TestSuite.new('TC_As_Expression')
- TC_As_Expression.suite.tests.each do |test|
- ARGV.each do |arg|
- suite << test if /#{arg}/ =~ test.name
- end
- end
- end
- result = Test::Unit::UI::Console::TestRunner.run(suite)
- exit(result.error_count + result.failure_count)
- end
+ # require 'test/unit/ui/console/testrunner'
+
+ # if Test::Unit.const_defined?(:AutoRunner) then
+ # exit Test::Unit::AutoRunner.run
+ # else
+ # if ARGV.empty? then
+ # suite = TC_As_Expression.suite
+ # else
+ # suite = Test::Unit::TestSuite.new('TC_As_Expression')
+ # TC_As_Expression.suite.tests.each do |test|
+ # ARGV.each do |arg|
+ # suite << test if /#{arg}/ =~ test.name
+ # end
+ # end
+ # end
+ # result = Test::Unit::UI::Console::TestRunner.run(suite)
+ # exit(result.error_count + result.failure_count)
+ # end
end
View
4 test/test_methodsig.rb
@@ -261,7 +261,7 @@ def test_three_default_and_rest_and_block_with_locals
end
if __FILE__ == $0 then
- require 'test_helpers'
- run_all_tests()
+ # require 'test_helpers'
+ # run_all_tests()
end

No commit comments for this range

Something went wrong with that request. Please try again.