Sha256: 0be7af95c65643e40f110696624e079716ea4566030a4e3ecb03748ddd2589c2

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

module Kirk
  class Server::ApplicationConfig
    include Native::ApplicationConfig

    attr_accessor :env,
                  :hosts,
                  :listen,
                  :watch,
                  :rackup,
                  :application_path,
                  :bootstrap_path

    def initialize
      @env    = {}
      @hosts  = []
      @listen = listen
    end

    def application_path
      @application_path || File.dirname(rackup)
    end

    # Handle the java interface
    alias getApplicationPath    application_path
    alias getRackupPath         rackup
    alias getBootstrapPath      bootstrap_path

    def getEnvironment
      map = java.util.HashMap.new
      env = ENV.dup

      self.env.each do |key, val|
        env[key.to_s] = val
      end

      env.each do |key, val|
        next unless val

        key = key.to_java_string
        val = val.to_s.to_java_string

        map.put(key, val)
      end

      map
    end

    def getKirkVersionStamper
      <<-RUBY
        module Kirk
          PARENT_VERSION = #{VERSION.inspect}.freeze
        end
      RUBY
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kirk-0.2.0.beta.7-java lib/kirk/server/application_config.rb
kirk-0.2.0.beta.6-java lib/kirk/server/application_config.rb
kirk-0.2.0.beta.5-java lib/kirk/server/application_config.rb
kirk-0.2.0.beta.4-java lib/kirk/server/application_config.rb
kirk-0.2.0.beta.3-java lib/kirk/server/application_config.rb
kirk-0.2.0.beta.2-java lib/kirk/server/application_config.rb
kirk-0.2.0.beta.1-java lib/kirk/server/application_config.rb