Module: Wolverine

Defined in:
lib/wolverine.rb,
lib/wolverine/script.rb,
lib/wolverine/version.rb,
lib/wolverine/lua_error.rb,
lib/wolverine/configuration.rb,
lib/wolverine/path_component.rb

Defined Under Namespace

Classes: Configuration, LuaError, PathComponent, Script

Constant Summary

VERSION =
"0.2.3"

Class Method Summary (collapse)

Class Method Details

+ (Wolverine::Configuration) config

Returns the configuration object for reading and writing configuration values.

Returns:



15
16
17
# File 'lib/wolverine.rb', line 15

def self.config
  @config ||= Configuration.new
end

+ (PathComponent, Object) method_missing(sym, *args)

Used to handle dynamic accesses to scripts. Successful lookups will be cached on the PathComponent object. See Wolverine::PathComponent#method_missing for more detail on how this works.

Returns:

  • (PathComponent, Object)

    a PathComponent if the method maps to a directory, or an execution result if the the method maps to a lua file.



41
42
43
44
45
# File 'lib/wolverine.rb', line 41

def self.method_missing sym, *args
  root_directory.send(sym, *args)
rescue PathComponent::MissingTemplate
  super
end

+ (Redis) redis

Provides access to the redis connection currently in use by Wolverine.

Returns:

  • (Redis)

    the redis connection used by Wolverine



22
23
24
# File 'lib/wolverine.rb', line 22

def self.redis
  config.redis
end

+ (void) reset!

This method returns an undefined value.

Resets all the scripts cached by Wolverine. Scripts are lazy-loaded and cached in-memory, so if a file changes on disk, it will be necessary to manually reset the cache using reset!.



31
32
33
# File 'lib/wolverine.rb', line 31

def self.reset!
  @root_directory = nil
end