Sha256: d52745a48a2d8a264a616f5d9a7d702a0c48caad93c09c0f102a08a4d5c6354e

Contents?: true

Size: 849 Bytes

Versions: 12

Compression:

Stored size: 849 Bytes

Contents

module SpecInfra
  module Configuration
    class << self
      VALID_OPTIONS_KEYS = [
        :path,
        :pre_command,
        :stdout,
        :stderr,
        :sudo_path,
        :disable_sudo,
        :pass_prompt,
        :sudo_options,
        :docker_image
      ].freeze

      def defaults
        VALID_OPTIONS_KEYS.inject({}) { |o, k| o.merge!(k => send(k)) }
      end

      def method_missing(meth, val=nil)
        key = meth.to_s
        key.gsub!(/=$/, '')
        if val
          instance_variable_set("@#{key}", val)
          RSpec.configuration.send(:"#{key}=", val) if defined?(RSpec)
        end

        ret = instance_variable_get("@#{key}")
        if ret.nil? && defined?(RSpec) && RSpec.configuration.respond_to?(key)
          ret = RSpec.configuration.send(key)
        end
        ret
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
specinfra-0.5.9 lib/specinfra/configuration.rb
specinfra-0.5.8 lib/specinfra/configuration.rb
specinfra-0.5.7 lib/specinfra/configuration.rb
specinfra-0.5.6 lib/specinfra/configuration.rb
specinfra-0.5.5 lib/specinfra/configuration.rb
specinfra-0.5.4 lib/specinfra/configuration.rb
specinfra-0.5.3 lib/specinfra/configuration.rb
specinfra-0.5.2 lib/specinfra/configuration.rb
specinfra-0.5.1 lib/specinfra/configuration.rb
specinfra-0.5.0 lib/specinfra/configuration.rb
specinfra-0.4.1 lib/specinfra/configuration.rb
specinfra-0.4.0 lib/specinfra/configuration.rb