Skip to content

Instantly share code, notes, and snippets.

@phaedryx
Created April 21, 2019 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phaedryx/84470cf7145db335b19a952c7ec2df8e to your computer and use it in GitHub Desktop.
Save phaedryx/84470cf7145db335b19a952c7ec2df8e to your computer and use it in GitHub Desktop.
exploring dragonruby
Run ./dragonruby
the ':' character lets you type commands
:puts local_variables
[]
:puts global_variables
[:$dragon, :$layout, :$stdin, :$/, :$stdout, :$stderr, :$top_level, :$ffi, :$1, :$2, :$3, :$4, :$5, :$6, :$7, :$8, :$9]
:puts $dragon.class
DragonRuby
:puts $dragon.methods.sort
[:!, :!=, :!~, :==, :===, :Array, :Float, :Hash, :Integer, :String, :__caller_without_noise__, :__case_eqq, :__dragon_ruby_source_files__, :__dragon_ruby_string_contains_source_file_path__?, :__id__, :__method__, :__pretty_print_exception__, :__printstr__, :__send__, :__supports_ivars__?, :_inspect, :`, :args, :args=, :block_given?, :border_to_ffi, :borders, :calc_wrapper, :caller, :class, :class_defined?, :clear_draw_passes, :clear_draw_primitives, :clear_input, :clone, :current_framerate, :current_framerate_raw, :define_singleton_method, :dequeue_sounds, :dig, :dup, :enum_for, :eql?, :equal?, :export!, :extend, :fail, :fast_rand, :ffi_file, :ffi_mrb, :flattened_solids, :format, :freeze, :frozen?, :getc, :gets, :global_variables, :gridlines!, :has_toast?, :hash, :here, :highlights, :init_args_if_needed, :initialize, :initialize_copy, :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :iterator?, :itself, :kind_of?, :label_to_ffi, :labels, :lambda, :line_to_ffi, :lines, :local_variables, :loop, :method_missing, :methods, :nil?, :object_id, :open, :p, :passes, :pause!, :paused?, :pin_root_values, :primitive_to_ffi, :primitives, :print, :printf, :private_methods, :proc, :protected_methods, :public_methods, :purge_class, :puts, :putsc, :queue_key_up, :raise, :raise_method_missing_better_error, :raise_with_caller, :rand, :remove_instance_variable, :render_height, :render_width, :require, :reset, :respond_to?, :root, :root=, :send, :singleton_class, :singleton_methods, :solid_to_ffi, :sprintf, :sprite_to_ffi, :sprites, :srand, :tap, :target, :text_font, :then, :tick, :tick_core, :tick_speed_count, :tick_speed_count=, :tick_speed_sum, :tick_speed_sum=, :tick_toast, :to_enum, :to_s, :toast!, :toast_labels, :toggle_gridlines!, :ungridlines!, :unpause!, :yield_self]
:puts $layout.class
Layout
:puts $layout.methods.sort
[:!, :!=, :!~, :==, :===, :Array, :Float, :Hash, :Integer, :String, :__caller_without_noise__, :__case_eqq, :__dragon_ruby_source_files__, :__dragon_ruby_string_contains_source_file_path__?, :__files_to_reload, :__highlights, :__id__, :__init_mtimes, :__method__, :__pretty_print_exception__, :__printstr__, :__reload_if_needed, :__reload_repl_file, :__reload_ruby_file, :__repl_labels, :__send__, :__supports_ivars__?, :_inspect, :`, :append_buffer, :append_current_repl_code, :append_mini_buffer_code, :append_repl_code, :background_color, :black, :blink_cursor, :block_given?, :borders, :button_name_given_enum, :bye, :caller, :center_aligned, :char_with_shift, :class, :class_defined?, :clone, :color_with_perc_towards, :current_repl_code_index, :current_repl_code_index=, :dark_gray, :define_singleton_method, :dig, :dup, :enum_for, :eql?, :equal?, :eval_or_create_main_rb, :exit_mini_buffer_if_needed, :extend, :fail, :fast_rand, :ffi_file, :ffi_mrb, :font_med, :format, :freeze, :frozen?, :get_buffer, :get_current_repl_code, :get_mini_buffer_code, :get_repl_code, :getc, :gets, :global_variables, :gray, :green, :gridline_color, :gridline_label_color, :gridline_label_spacing_x, :gridline_label_spacing_y, :gridline_spacing_x, :gridline_spacing_y, :gridlines, :hash, :here, :hide_repl, :highlights, :in_game_repl_labels, :in_game_repl_shown, :in_game_repl_shown=, :initialize, :initialize_copy, :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :iterator?, :itself, :key_down_player_one, :key_down_player_two, :key_held_player_one, :key_held_player_two, :key_up_in_game, :key_up_player_one, :key_up_player_two, :key_up_raw, :key_up_raw_repl, :key_up_raw_show_hide_mini_buffer, :key_up_raw_show_hide_repl, :keyboard_methods, :keyboard_methods_invalidate!, :kind_of?, :labels, :labels_with_alpha, :lambda, :left_aligned, :light_gray, :lines, :local_variables, :loop, :method_missing, :methods, :mini_buffer_enabled?, :mini_buffer_label, :mouse_pressed, :nil?, :object_id, :on_reload, :on_startup, :open, :p, :passes, :prepend_buffer, :prepend_current_repl_code, :pretty_print_exception_and_export!, :primitives, :print, :print_help_when_mouse_clicked, :printf, :private_methods, :proc, :process_mini_buffer, :process_repl, :protected_methods, :public_methods, :purge_class, :puts, :putsc, :queue_flash, :queue_music, :queue_sound, :raise, :raise_method_missing_better_error, :raise_with_caller, :rand, :really_light_gray, :red, :remove_instance_variable, :render_height, :render_width, :repl_before_after_cursor, :repl_clear, :repl_code_labels, :repl_code_line, :repl_code_lines, :repl_cursor_down, :repl_cursor_index, :repl_cursor_key, :repl_cursor_left, :repl_cursor_location, :repl_cursor_location_shifted, :repl_cursor_right, :repl_cursor_up, :repl_cursor_width, :repl_dismissed, :repl_enabled?, :repl_eval_buffer, :repl_eval_mini_buffer, :repl_file_name, :repl_instructions, :repl_labels, :repl_line_numbers, :repl_load, :repl_ordinal_cursor, :repl_save, :repl_set_cursor, :repl_shown, :repl_text_color, :repl_text_font, :repl_tick, :respond_to?, :right_aligned, :send, :set_buffer, :set_current_repl_code, :set_key, :set_mini_buffer_code, :set_repl_code, :show_cursor?, :show_repl, :singleton_class, :singleton_methods, :sounds, :sprintf, :sprites, :srand, :stop_music, :tap, :target, :text_color, :text_font, :textures, :textures=, :then, :tick, :tick_flashes, :time_per_tick, :to_enum, :to_s, :white, :yield_self]
:array = []; ObjectSpace.each_object {|obj| array << obj.to_s if obj.is_a? Class}; puts array.sort.join(', ')
ArgumentError, Array, BasicObject, Border, Class, Controller, ControllerKeys, DragonRuby, DragonRubyArgs, EOFError, Enumerator, Enumerator::Generator, Enumerator::Lazy, Enumerator::Yielder, Exception, FFI::File, FFI::MRB, FalseClass, Fiber, FiberError, File, File::FileError, File::NoFileError, File::PermissionError, File::UnableToStat, FileTest, Fixnum, Float, FloatDomainError, FrozenError, GameView, Grid, Hash, IO, IOError, IndexError, Inputs, Integer, KeyError, Keyboard, KeyboardKeys, Label, Layout, Line, LocalJumpError, Math::DomainError, Module, Mouse, NameError, NilClass, NoMemoryError, NoMethodError, NotImplementedError, Numeric, Object, ObjectMetadata, OpenStructLite, Outputs, Primitive, Proc, Random, Range, RangeError, RegexpError, RuntimeError, ScriptError, Solid, Sound, Sprite, StandardError, StopIteration, String, Struct, Symbol, SyntaxError, SystemStackError, Time, TrueClass, TypeError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment