Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1. Create a file called mygame/app/repl.rb
- # 2. Start up the GTK environment.
- # 3. Change the line at the bottom of this file.
- # 4. Save repl.rb.
- # Explanation:
- # The code below tells GTK to give me all private member variables that have a public method,
- # and for those member variables, execute the public method, then call `.help` on whatever
- # that public method returned. Then finally save the help result to a file.
- def export_help_for_instance_variable o, ivar
- attr_name = ivar.to_s.gsub("@", "").to_sym
- if o.respond_to? attr_name
- output_file_name = "app/help-#{attr_name}.txt"
- .gsub("--", "-")
- .gsub("class", "")
- .gsub(":", "")
- .gsub(" ", "")
- .gsub("(", "")
- .gsub(")", "")
- $gtk.ffi_file.storefile output_file_name, o.send(attr_name).help
- end
- end
- def export_help_for_instance_variables o
- o.instance_variables.sort.map do |ivar|
- export_help_for_instance_variable o, ivar
- end
- end
- # Change the line below to things like $gtk, $gtk.args, $gtk.args.keyboard, etc
- export_help_for_instance_variables $gtk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement