Class: IRB::DeprecatedConf

Inherits:
Object
  • Object
show all
Defined in:
lib/irb/deprecated.rb

Constant Summary collapse

DEFAULT_MESSAGE =
"please create a patch/ticket"

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



24
25
26
27
# File 'lib/irb/deprecated.rb', line 24

def [](key)
  IRB.deprecated("Usage of the IRB.conf hash for configuration is, currently, not supported", caller)
  nil
end

#[]=(key, value) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/irb/deprecated.rb', line 29

def []=(key, value)
  message = nil
  case key
  when :PROMPT_MODE
    message = "use `IRB.formatter.prompt = :#{value.downcase}'"
    IRB.formatter.prompt = "#{value.to_s.downcase}".to_sym
  when :AUTO_INDENT
    message = "use `IRB.formatter.auto_indent = #{value}'"
    IRB.formatter.auto_indent = value
  when :USE_READLINE
    message = "for now DietRB only has a readline module"
  when :SAVE_HISTORY
    message = "history is always saved"
  end
  deprecated_conf key, message, caller
  value
end

#deprecated_conf(key, message, caller) ⇒ Object



19
20
21
22
# File 'lib/irb/deprecated.rb', line 19

def deprecated_conf(key, message, caller)
  message ||= DEFAULT_MESSAGE
  IRB.deprecated_feature("IRB.conf[:#{key}]", message, caller)
end