Module: Iated

Defined in:
lib/iated/server.rb,
lib/iated.rb,
lib/iated/mcp.rb,
lib/iated/version.rb,
lib/iated/edit_session.rb,
lib/iated/browser_token_db.rb

Overview

The various URLs pages_dir = File.expand_path ‘../pages’, __FILE__ Dir.each do |path| require path.to_s end

Defined Under Namespace

Classes: Application, BrowserTokenDB, EditSession, MCP, Server

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.environmentSymbol

The current environment

Returns:

  • (Symbol)

    Returns one of: ‘:test`, `:development`, `:production`



74
75
76
# File 'lib/iated.rb', line 74

def self.environment
  @environment ||= :development
end

.environment=(env) ⇒ Symbol

Set the current environment

Returns:

  • (Symbol)

    The symbol set.



80
81
82
83
84
85
86
87
# File 'lib/iated.rb', line 80

def self.environment= env
  if [:test, :development, :production].include? env
    @environment = env
    @mcp.prefs.reset unless @mcp.nil?
  else
    raise "Invalid Iated::environment specified: #{env.inspect}"
  end
end

.mcpIated::MCP

Access to the Master Control Program

Returns:



106
107
108
# File 'lib/iated.rb', line 106

def self.mcp
  @mcp ||= Iated::MCP.new
end

.purgenil

Deletes all state from the system

Returns:

  • (nil)


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

def self.purge
  dir = self.mcp.prefs.config_dir
  dir.rmtree if dir.directory?
end

.resetnil

Resets the Master Control Program, Preferences, and Sessions

Returns:

  • (nil)


91
92
93
94
95
# File 'lib/iated.rb', line 91

def self.reset
  @mcp.prefs.reset unless @mcp.nil?
  @mcp = nil
  @sessions = nil
end

.sessionsHash

Returns Sessions.

Returns:

  • (Hash)

    Sessions



67
68
69
70
# File 'lib/iated.rb', line 67

def self.sessions
  # TODO This needs to be replaced with a real persistant data store.
  @sessions ||= {}
end