Class: Cloudfuji::Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudfuji/platform.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.claimed?Boolean

Returns:

  • (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_sourceObject



42
43
44
# File 'lib/cloudfuji/platform.rb', line 42

def cloudfuji_js_source
  "#{Cloudfuji::Platform.host}/api/cloudfuji.js"
end

.hostObject



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

.keyObject



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

def key
  ENV['CLOUDFUJI_APP_KEY']
end

.metrics_tokenObject



38
39
40
# File 'lib/cloudfuji/platform.rb', line 38

def metrics_token
  ENV['CLOUDFUJI_METRICS_TOKEN']
end

.nameObject



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

def name
  ENV['CLOUDFUJI_NAME']
end

.on_cloudfuji?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/cloudfuji/platform.rb', line 30

def on_cloudfuji?
  ENV['HOSTING_PLATFORM']=="cloudfuji"
end

.portObject



20
21
22
# File 'lib/cloudfuji/platform.rb', line 20

def port
  ENV['CLOUDFUJI_PORT']
end

.protocolObject



16
17
18
# File 'lib/cloudfuji/platform.rb', line 16

def protocol
  ENV['CLOUDFUJI_PROTOCOL'] || "https"
end

.publish_urlObject



12
13
14
# File 'lib/cloudfuji/platform.rb', line 12

def publish_url
  "#{host}/apps/#{name}/bus"
end