Module: Octopus

Defined in:
lib/octopus.rb

Defined Under Namespace

Modules: Association, Controller, Migration, Model, Persistence Classes: Proxy, ScopeProxy

Class Method Summary collapse

Class Method Details

.configObject



8
9
10
# File 'lib/octopus.rb', line 8

def self.config()
  @config ||= YAML.load_file(Octopus.directory() + "/config/shards.yml") 
end

.directoryObject

Returns the Rails.root_to_s when you are using rails Running the current directory in a generic Ruby process



14
15
16
# File 'lib/octopus.rb', line 14

def self.directory()
  @directory ||= defined?(Rails) ?  Rails.root.to_s : Dir.pwd     
end

.envObject



4
5
6
# File 'lib/octopus.rb', line 4

def self.env()
  @env ||= defined?(Rails) ? Rails.env.to_s : "production"      
end