Class: Bushido::Platform

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

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.bushido_js_sourceObject



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

def bushido_js_source
  "#{Bushido::Platform.host}/api/bushido.js"
end

.claimed?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/bushido/platform.rb', line 34

def claimed?
  (ENV['BUSHIDO_CLAIMED'].nil? or ENV['BUSHIDO_CLAIMED'].blank?) ? false : true
end

.hostObject



24
25
26
27
28
# File 'lib/bushido/platform.rb', line 24

def host
  bushido_port = port ? ":#{port}" : ""
  bushido_host = ENV['BUSHIDO_HOST'] || 'bushi.do'
  "#{protocol}://#{bushido_host}#{bushido_port}"
end

.keyObject



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

def key
  ENV['BUSHIDO_APP_KEY']
end

.metrics_tokenObject



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

def metrics_token
  ENV['BUSHIDO_METRICS_TOKEN']
end

.nameObject



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

def name
  ENV['BUSHIDO_NAME']
end

.on_bushido?Boolean

Returns:

  • (Boolean)


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

def on_bushido?
  ENV['HOSTING_PLATFORM']=="bushido"
end

.portObject



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

def port
  ENV['BUSHIDO_PORT']
end

.protocolObject



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

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

.publish_urlObject



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

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