Module: AdventureRL

Defined in:
lib/AdventureRL/misc/require_files.rb,
lib/adventure_rl.rb,
lib/AdventureRL/Clip.rb,
lib/AdventureRL/Mask.rb,
lib/AdventureRL/Menu.rb,
lib/AdventureRL/Audio.rb,
lib/AdventureRL/Image.rb,
lib/AdventureRL/Layer.rb,
lib/AdventureRL/Point.rb,
lib/AdventureRL/Button.rb,
lib/AdventureRL/Window.rb,
lib/AdventureRL/Textbox.rb,
lib/AdventureRL/version.rb,
lib/AdventureRL/Quadtree.rb,
lib/AdventureRL/Settings.rb,
lib/AdventureRL/Animation.rb,
lib/AdventureRL/Deltatime.rb,
lib/AdventureRL/FileGroup.rb,
lib/AdventureRL/Rectangle.rb,
lib/AdventureRL/ClipPlayer.rb,
lib/AdventureRL/AudioPlayer.rb,
lib/AdventureRL/Events/Event.rb,
lib/AdventureRL/Events/Mouse.rb,
lib/AdventureRL/Helpers/Error.rb,
lib/AdventureRL/SolidsManager.rb,
lib/AdventureRL/TimingHandler.rb,
lib/AdventureRL/FileGroupPlayer.rb,
lib/AdventureRL/Modifiers/Solid.rb,
lib/AdventureRL/Modifiers/Pusher.rb,
lib/AdventureRL/Modifiers/Gravity.rb,
lib/AdventureRL/Modifiers/Velocity.rb,
lib/AdventureRL/Helpers/PipeMethods.rb,
lib/AdventureRL/Modifiers/Inventory.rb,
lib/AdventureRL/Helpers/MethodHelper.rb,
lib/AdventureRL/EventHandlers/Buttons.rb,
lib/AdventureRL/EventHandlers/EventHandler.rb,
lib/AdventureRL/EventHandlers/MouseButtons.rb

Overview

This file purely requires code files.

Defined Under Namespace

Modules: EventHandlers, Events, Extensions, Helpers, Modifiers Classes: Animation, Audio, AudioPlayer, Button, Clip, ClipPlayer, Deltatime, FileGroup, FileGroupPlayer, Image, Layer, Mask, Menu, Point, Quadtree, Rectangle, Settings, SolidsManager, Textbox, TimingHandler, Window

Constant Summary collapse

ROOT =

The root directory of the gem. Used for requiring ruby files.

entry.dirname
DIR =

A constant containing a bunch of directories or files.

{
  entry:    entry,
  src:      ROOT.join('AdventureRL'),
  helpers:  ROOT.join('AdventureRL/Helpers'),
  misc:     ROOT.join('AdventureRL/misc'),
  settings: ROOT.join('default_settings.yml')
}
DEFAULT_SETTINGS =

Default gem settings defined in default_settings.yml.

Settings.new DIR[:settings]
VERSION =
'0.0.2'

Class Method Summary collapse

Class Method Details

.require_dir(dir, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/AdventureRL/misc/require_files.rb', line 3

def self.require_dir dir, options = {}
  directory = Pathname.new dir.to_s
  Helpers::Error.error_no_directory directory  unless (Helpers::Error.directory_exists? directory)
  options[:priority] = [options[:priority]].flatten.compact
  options[:priority].map! do |filename|
    next directory.join("#{filename.sub(/\.rb\z/,'')}.rb")
  end
  directory.children.sort_by_array(options[:priority]).each do |file|
    filepath = file.to_path
    require filepath  if (filepath.match?(/\.rb\z/))
  end
end