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
-
.environment ⇒ Symbol
The current environment.
-
.environment=(env) ⇒ Symbol
Set the current environment.
-
.mcp ⇒ Iated::MCP
Access to the Master Control Program.
-
.purge ⇒ nil
Deletes all state from the system.
-
.reset ⇒ nil
Resets the Master Control Program, Preferences, and Sessions.
-
.sessions ⇒ Hash
Sessions.
Class Method Details
.environment ⇒ Symbol
The current environment
74 75 76 |
# File 'lib/iated.rb', line 74 def self.environment @environment ||= :development end |
.environment=(env) ⇒ Symbol
Set the current environment
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 |
.mcp ⇒ Iated::MCP
Access to the Master Control Program
106 107 108 |
# File 'lib/iated.rb', line 106 def self.mcp @mcp ||= Iated::MCP.new end |
.purge ⇒ nil
Deletes all state from the system
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 |
.reset ⇒ nil
Resets the Master Control Program, Preferences, and Sessions
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 |
.sessions ⇒ Hash
Returns 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 |