Class: Cloudfuji::Platform
- Inherits:
-
Object
- Object
- Cloudfuji::Platform
- Defined in:
- lib/cloudfuji/platform.rb
Overview
:nodoc:
Class Method Summary collapse
- .claimed? ⇒ Boolean
- .cloudfuji_js_source ⇒ Object
- .host ⇒ Object
- .key ⇒ Object
- .metrics_token ⇒ Object
- .name ⇒ Object
- .on_cloudfuji? ⇒ Boolean
- .port ⇒ Object
- .protocol ⇒ Object
- .publish_url ⇒ Object
Class Method Details
.claimed? ⇒ Boolean
34 35 36 |
# File 'lib/cloudfuji/platform.rb', line 34 def claimed? (ENV['CLOUDFUJI_CLAIMED'].nil? or ENV['CLOUDFUJI_CLAIMED'].blank?) ? false : true end |
.cloudfuji_js_source ⇒ Object
42 43 44 |
# File 'lib/cloudfuji/platform.rb', line 42 def cloudfuji_js_source "#{Cloudfuji::Platform.host}/api/cloudfuji.js" end |
.host ⇒ Object
24 25 26 27 28 |
# File 'lib/cloudfuji/platform.rb', line 24 def host cloudfuji_port = port ? ":#{port}" : "" cloudfuji_host = ENV['CLOUDFUJI_HOST'] || 'cloudfuji.com' "#{protocol}://#{cloudfuji_host}#{cloudfuji_port}" end |
.key ⇒ Object
8 9 10 |
# File 'lib/cloudfuji/platform.rb', line 8 def key ENV['CLOUDFUJI_APP_KEY'] end |
.metrics_token ⇒ Object
38 39 40 |
# File 'lib/cloudfuji/platform.rb', line 38 def metrics_token ENV['CLOUDFUJI_METRICS_TOKEN'] end |
.name ⇒ Object
4 5 6 |
# File 'lib/cloudfuji/platform.rb', line 4 def name ENV['CLOUDFUJI_NAME'] end |
.on_cloudfuji? ⇒ Boolean
30 31 32 |
# File 'lib/cloudfuji/platform.rb', line 30 def on_cloudfuji? ENV['HOSTING_PLATFORM']=="cloudfuji" end |
.port ⇒ Object
20 21 22 |
# File 'lib/cloudfuji/platform.rb', line 20 def port ENV['CLOUDFUJI_PORT'] end |
.protocol ⇒ Object
16 17 18 |
# File 'lib/cloudfuji/platform.rb', line 16 def protocol ENV['CLOUDFUJI_PROTOCOL'] || "https" end |
.publish_url ⇒ Object
12 13 14 |
# File 'lib/cloudfuji/platform.rb', line 12 def publish_url "#{host}/apps/#{name}/bus" end |