Sha256: 4ad459dc66ce4bef1586950be7e9340908278b99afd8f31f852c697f87f22734

Contents?: true

Size: 953 Bytes

Versions: 17

Compression:

Stored size: 953 Bytes

Contents

module JsTestCore
  class Configuration
    class << self
      attr_accessor :instance

      def method_missing(method_name, *args, &block)
        if Configuration.instance.respond_to?(method_name)
          Configuration.instance.send(method_name, *args, &block)
        else
          super
        end
      end
    end

    attr_accessor :host, :port, :spec_root_path, :public_path, :core_path

    def initialize(params={})
      params = {
        :spec_root_path => File.expand_path("./specs/javascripts"),
        :public_path => File.expand_path("./public"),
        :host => DEFAULT_HOST,
        :port => DEFAULT_PORT,
      }.merge(params)
      @spec_root_path = ::File.expand_path(params[:spec_root_path])
      @public_path = ::File.expand_path(params[:public_path])
      @host = params[:host]
      @port = params[:port]
      @core_path = params[:core_path]
    end

    def root_url
      "http://#{host}:#{port}"
    end
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
pivotal-screw-unit-0.5.0 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-0.5.1 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-0.5.2 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-0.5.3 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.10 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.11 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.12 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.3 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.4 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.5 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.6 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.7 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.8 vendor/js-test-core/lib/js_test_core/configuration.rb
pivotal-screw-unit-server-0.5.9 vendor/js-test-core/lib/js_test_core/configuration.rb
screw-unit-0.5.1 vendor/js-test-core/lib/js_test_core/configuration.rb
screw-unit-0.5.2 vendor/js-test-core/lib/js_test_core/configuration.rb
screw-unit-server-0.5.3 vendor/js-test-core/lib/js_test_core/configuration.rb