Sha256: d6da545850128f3b5b0927e9788e1c992b282f3e9d2cd7b40a0bfbaa3384a63c

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

require_relative "env"

module CypressRails
  class Config
    attr_accessor :dir, :host, :port, :base_path, :transactional_server, :cypress_cli_opts

    def initialize(
      dir: Env.fetch("CYPRESS_RAILS_DIR", default: Dir.pwd),
      host: Env.fetch("CYPRESS_RAILS_HOST", default: "127.0.0.1"),
      port: Env.fetch("CYPRESS_RAILS_PORT"),
      base_path: Env.fetch("CYPRESS_RAILS_BASE_PATH", default: "/"),
      transactional_server: Env.fetch("CYPRESS_RAILS_TRANSACTIONAL_SERVER", type: :boolean, default: true),
      cypress_cli_opts: Env.fetch("CYPRESS_RAILS_CYPRESS_OPTS", default: "")
    )
      @dir = dir
      @host = host
      @port = port
      @base_path = base_path
      @transactional_server = transactional_server
      @cypress_cli_opts = cypress_cli_opts
    end

    def to_s
      <<~DESC

        cypress-rails configuration:
        ============================
         CYPRESS_RAILS_DIR.....................#{dir.inspect}
         CYPRESS_RAILS_HOST....................#{host.inspect}
         CYPRESS_RAILS_PORT....................#{port.inspect}
         CYPRESS_RAILS_BASE_PATH...............#{base_path.inspect}
         CYPRESS_RAILS_TRANSACTIONAL_SERVER....#{transactional_server.inspect}
         CYPRESS_RAILS_CYPRESS_OPTS............#{cypress_cli_opts.inspect}

      DESC
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cypress-rails-0.6.1 lib/cypress-rails/config.rb
cypress-rails-0.6.0 lib/cypress-rails/config.rb
cypress-rails-0.5.5 lib/cypress-rails/config.rb
cypress-rails-0.5.4 lib/cypress-rails/config.rb
cypress-rails-0.5.3 lib/cypress-rails/config.rb
cypress-rails-0.5.2 lib/cypress-rails/config.rb
cypress-rails-0.5.1 lib/cypress-rails/config.rb
cypress-rails-0.5.0 lib/cypress-rails/config.rb
cypress-rails-0.4.2 lib/cypress-rails/config.rb
cypress-rails-0.4.1 lib/cypress-rails/config.rb