Sha256: aa5801b193ce7700a6c014df24dec93171caac5f54046f15d7e7536b5ae15dcb

Contents?: true

Size: 636 Bytes

Versions: 32

Compression:

Stored size: 636 Bytes

Contents

class Jets::Controller
  class Stage
    def initialize(host, url)
      @host, @url = host, url
    end

    def add
      return @url unless add_stage?

      stage_name = Jets::Resource::ApiGateway::Deployment.stage_name
      "/#{stage_name}#{@url}"
    end

    def add_stage?
      return false if on_cloud9?
      @host.include?("amazonaws.com") && @url.starts_with?('/')
    end

    def on_cloud9?
      self.class.on_cloud9?(@host)
    end

    class << self
      def add(host, url)
        new(host, url).add
      end

      def on_cloud9?(host)
        !!(host =~ /cloud9\..*\.amazonaws\.com/)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
jets_bb_fork-0.0.4 lib/jets/controller/stage.rb
jets-1.9.32 lib/jets/controller/stage.rb
jets-1.9.31 lib/jets/controller/stage.rb
jets-1.9.30 lib/jets/controller/stage.rb
jets-1.9.29 lib/jets/controller/stage.rb
jets-1.9.28 lib/jets/controller/stage.rb
jets-1.9.27 lib/jets/controller/stage.rb
jets-1.9.26 lib/jets/controller/stage.rb
jets-1.9.25 lib/jets/controller/stage.rb
jets-1.9.24 lib/jets/controller/stage.rb
jets-1.9.23 lib/jets/controller/stage.rb
jets-1.9.22 lib/jets/controller/stage.rb
jets-1.9.21 lib/jets/controller/stage.rb
jets-1.9.20 lib/jets/controller/stage.rb
jets-1.9.19 lib/jets/controller/stage.rb
jets-1.9.18 lib/jets/controller/stage.rb
jets-1.9.17 lib/jets/controller/stage.rb
jets-1.9.16 lib/jets/controller/stage.rb
jets-1.9.15 lib/jets/controller/stage.rb
jets-1.9.14 lib/jets/controller/stage.rb