Module: Specinfra::Configuration
- Defined in:
- lib/specinfra/configuration.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
[ :backend, :env, :path, :shell, :interactive_shell, :login_shell, :pre_command, :stdout, :stderr, :exit_status, :sudo_path, :disable_sudo, :sudo_options, :docker_container_create_options, :docker_container_exec_options, :docker_image, :docker_url, :lxc, :lxd_remote, :lxd_instance, :request_pty, :ssh_options, :ssh_without_env, :dockerfile_finalizer, :telnet_options, :jail_name, ].freeze
Class Method Summary collapse
- .defaults ⇒ Object
- .method_missing(meth, val = nil) ⇒ Object
-
.os(value = nil) ⇒ Object
Define os method explicitly to avoid stack level too deep caused by Helper::DetectOS#os.
Class Method Details
.defaults ⇒ Object
33 34 35 |
# File 'lib/specinfra/configuration.rb', line 33 def defaults VALID_OPTIONS_KEYS.inject({}) { |o, k| o.merge!(k => send(k)) } end |
.method_missing(meth, val = nil) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/specinfra/configuration.rb', line 47 def method_missing(meth, val=nil) key = meth.to_s.gsub(/=$/, '') ret = nil begin if ! val.nil? instance_variable_set("@#{key}", val) RSpec.configuration.send(:"#{key}=", val) if defined?(RSpec) end if instance_variable_defined?("@#{key}") ret = instance_variable_get("@#{key}") end rescue NameError ret = nil ensure if ret.nil? && defined?(RSpec) && RSpec.configuration.respond_to?(key) ret = RSpec.configuration.send(key) end end ret end |
.os(value = nil) ⇒ Object
Define os method explicitly to avoid stack level too deep caused by Helper::DetectOS#os
39 40 41 42 43 44 45 |
# File 'lib/specinfra/configuration.rb', line 39 def os(value=nil) @os = value if value if @os.nil? && defined?(RSpec) && RSpec.configuration.respond_to?(:os) @os = RSpec.configuration.os end @os end |