Class: Bushido::Platform
- Inherits:
-
Object
- Object
- Bushido::Platform
- Defined in:
- lib/bushido/platform.rb
Overview
:nodoc:
Class Method Summary collapse
- .bushido_js_source ⇒ Object
- .claimed? ⇒ Boolean
- .host ⇒ Object
- .key ⇒ Object
- .metrics_token ⇒ Object
- .name ⇒ Object
- .on_bushido? ⇒ Boolean
- .port ⇒ Object
- .protocol ⇒ Object
- .publish_url ⇒ Object
Class Method Details
.bushido_js_source ⇒ Object
42 43 44 |
# File 'lib/bushido/platform.rb', line 42 def bushido_js_source "#{Bushido::Platform.host}/api/bushido.js" end |
.claimed? ⇒ 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 |
.host ⇒ Object
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 |
.key ⇒ Object
8 9 10 |
# File 'lib/bushido/platform.rb', line 8 def key ENV['BUSHIDO_APP_KEY'] end |
.metrics_token ⇒ Object
38 39 40 |
# File 'lib/bushido/platform.rb', line 38 def metrics_token ENV['BUSHIDO_METRICS_TOKEN'] end |
.name ⇒ Object
4 5 6 |
# File 'lib/bushido/platform.rb', line 4 def name ENV['BUSHIDO_NAME'] end |
.on_bushido? ⇒ Boolean
30 31 32 |
# File 'lib/bushido/platform.rb', line 30 def on_bushido? ENV['HOSTING_PLATFORM']=="bushido" end |
.port ⇒ Object
20 21 22 |
# File 'lib/bushido/platform.rb', line 20 def port ENV['BUSHIDO_PORT'] end |
.protocol ⇒ Object
16 17 18 |
# File 'lib/bushido/platform.rb', line 16 def protocol ENV['BUSHIDO_PROTOCOL'] || "https" end |
.publish_url ⇒ Object
12 13 14 |
# File 'lib/bushido/platform.rb', line 12 def publish_url "#{host}/apps/#{name}/bus" end |