Revisions
-
rlb3 revised this gist
Aug 14, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ require 'ripper' def Object.const_missing(name) klass = const_set name, Class.new klass.class_eval do def method_missing name, *args -
rlb3 renamed this gist
Aug 14, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rlb3 created this gist
Aug 14, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ require 'ripper' def Object.const_missing(name) puts "defining #{name}" klass = const_set name, Class.new klass.class_eval do def method_missing name, *args file, line_num, _ = caller[0].split(':') file_contents = File.open(file).read result = file_contents.split("\n")[line_num.to_i-1] Ripper.sexp(result)[1][0][2][1][0][1][1][1] end klass end end