class EmberCli::Deploy::Redis

Constants

VERSION

Attributes

app[R]

Public Class Methods

new(app) click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 7
def initialize(app)
  @app = app
end

Public Instance Methods

index_html() click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 11
def index_html
  redis_client.get(deploy_key).presence || index_html_missing!
end

Private Instance Methods

current_key() click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 27
def current_key
  "#{namespace}:current"
end
deploy_key() click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 31
def deploy_key
  key = redis_client.get(current_key).presence ||
        deployment_not_activated!

  "#{namespace}:#{key}"
end
deployment_not_activated!() click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 46
      def deployment_not_activated!
        raise KeyError.new <<-FAIL
        #{current_key} is empty.

        Did you forget to call `ember deploy:activate`?
        FAIL
      end
index_html_missing!() click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 38
      def index_html_missing!
        raise KeyError.new <<-FAIL
        HTML for #{deploy_key} is missing.

        Did you forget to call `ember deploy`?
        FAIL
      end
namespace() click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 23
def namespace
  app.name
end
redis_client() click to toggle source
# File lib/ember_cli/deploy/redis.rb, line 19
def redis_client
  @redis_client ||= ::Redis.new(url: ENV.fetch("REDIS_URL"))
end