public
Description: ruby2ruby code for my rubyconf08 talk
Homepage:
Clone URL: git://github.com/mchung/ruby2ruby_rubyconf08.git
ruby2ruby_rubyconf08 / 9_module_func.rb
100644 20 lines (16 sloc) 0.319 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module HelperModule
  def help
    puts "Helping me"
  end
  module_function :help
end
 
if $0 == __FILE__
  require 'rubygems'
  require 'ruby2ruby'
  require 'parse_tree'
  require 'yaml'
  
  puts "\nAST:"
  y ParseTree.new.parse_tree(HelperModule).first
  
  puts "\nRuby:"
  y Ruby2Ruby.translate(HelperModule)
end