Class: PlatformSH
- Inherits:
-
Object
- Object
- PlatformSH
- Defined in:
- lib/platform_sh.rb,
lib/platform_sh/version.rb
Constant Summary collapse
- VERSION =
"0.1.2"
Class Method Summary collapse
-
.config ⇒ Object
Reads Platform.sh configuration from environment and returns a single object.
Class Method Details
.config ⇒ Object
Reads Platform.sh configuration from environment and returns a single object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/platform_sh.rb', line 8 def self.config if ENV.has_key? "PLATFORM_PROJECT" then conf = {} conf["application"] = read_base64_json('PLATFORM_APPLICATION') conf["relationships"] = read_base64_json('PLATFORM_RELATIONSHIPS') conf["variables"] = read_base64_json('PLATFORM_VARIABLES') conf["application_name"] =ENV["PLATFORM_APPLICATION_NAME"] || nil conf["app_dir"] =ENV["PLATFORM_APP_DIR"] || nil conf["document_root"] =ENV["PLATFORM_DOCUMENT_ROOT"] || nil conf["environment"] =ENV["PLATFORM_ENVIRONMENT"] || nil conf["project_entropy"] =ENV["PLATFORM_PROJECT_ENTROPY"] || nil conf["project"] =ENV["PLATFORM_PROJECT"] || nil conf["port"] =ENV["PORT"] || nil conf["socket"] =ENV["SOCKET"] || nil else $stderr.puts "This is not running on platform.sh" return nil end return conf; end |