Module: Mooncell

Defined in:
lib/mooncell.rb,
lib/mooncell/cli.rb,
lib/mooncell/env.rb,
lib/mooncell/entity.rb,
lib/mooncell/loader.rb,
lib/mooncell/router.rb,
lib/mooncell/command.rb,
lib/mooncell/respond.rb,
lib/mooncell/version.rb,
lib/mooncell/protocol.rb,
lib/mooncell/connection.rb,
lib/mooncell/application.rb,
lib/mooncell/environment.rb,
lib/mooncell/cli/commands.rb,
lib/mooncell/configuration.rb,
lib/mooncell/connection_pool.rb,
lib/mooncell/cli/commands/base.rb,
lib/mooncell/protocol/registry.rb,
lib/mooncell/protocol/websocket.rb,
lib/mooncell/cli/commands/server.rb,
lib/mooncell/cli/commands/console.rb,
lib/mooncell/cli/commands/version.rb,
lib/mooncell/cli/commands/registry.rb,
lib/mooncell/application_configuration.rb,
lib/mooncell/protocol/websocket/server.rb

Overview

A online game server framework for Ruby

Since:

  • 0.1.0

Defined Under Namespace

Modules: Command, Protocol, Respond Classes: Application, ApplicationConfiguration, CLI, Configuration, Connection, ConnectionPool, Entity, Env, Environment, Loader, Router

Constant Summary collapse

VERSION =

Since:

  • 0.1.0

'0.1.0'

Class Method Summary collapse

Class Method Details

.code_reloading?TrueClass, FalseClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check if enable code reloading

Returns:

  • (TrueClass, FalseClass)

    the result of check

Since:

  • 0.1.0



99
100
101
# File 'lib/mooncell.rb', line 99

def self.code_reloading?
  environment.code_reloading?
end

.configurationMooncell::Configuration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Mooncell Configuration

Returns:

See Also:

Since:

  • 0.1.0



75
76
77
78
79
80
81
# File 'lib/mooncell.rb', line 75

def self.configuration
  @_mutex.synchronize do
    raise 'Mooncell not configured' unless defined?(@_configuration)

    @_configuration
  end
end

.configure(&block) ⇒ Object

Configure the Mooncell

Examples:

# config/environment.rb

# ...

Mooncell.configure do
  protocol :websocket
end

Parameters:

  • block (Proc)

    the configuration block

Since:

  • 0.1.0



61
62
63
64
65
# File 'lib/mooncell.rb', line 61

def self.configure(&block)
  @_mutex.synchronize do
    @_configuration = Mooncell::Configuration.new(&block)
  end
end

.envString

Return current environment

Examples:

Mooncell.env => "development"

Returns:

  • (String)

    the current environment

See Also:

Since:

  • 0.3.1



36
37
38
# File 'lib/mooncell.rb', line 36

def self.env
  environment.environment
end

.environmentMooncell::Environment

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Current environment

Returns:

Since:

  • 0.1.0



89
90
91
# File 'lib/mooncell.rb', line 89

def self.environment
  @environment ||= Environment.new
end

.rootObject

Return application root

Since:

  • 0.1.0



43
44
45
# File 'lib/mooncell.rb', line 43

def self.root
  environment.root
end