diff options
author | Kazuki Yamaguchi <[email protected]> | 2020-02-19 04:44:31 +0000 |
---|---|---|
committer | Kazuki Yamaguchi <[email protected]> | 2021-03-16 19:16:10 +0900 |
commit | 67f5847c617e49a314400cb8f1ff1d559492682c (patch) | |
tree | 59c50892caf1500941bc71ee4a9eeb9b71110f89 /ext/openssl/lib | |
parent | 4d8bce227c85ef4d1f8b794a8c96a7b23e4cf357 (diff) |
[ruby/openssl] config: remove deprecated methods
Remove 4 deprecated methods.
The following two methods have been marked as deprecated since 2003,
by r4531 (ruby.git commit 78ff3833fb67c8005a9b851037e74b3eea940aa3).
- OpenSSL::Config#value
- OpenSSL::Config#section
Other two methods are removed because the corresponding functions
disappeared in OpenSSL 1.1.0.
- OpenSSL::Config#add_value
- OpenSSL::Config#[]=
https://github.com/ruby/openssl/commit/9783d7f21c
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4275
Diffstat (limited to 'ext/openssl/lib')
-rw-r--r-- | ext/openssl/lib/openssl/config.rb | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/ext/openssl/lib/openssl/config.rb b/ext/openssl/lib/openssl/config.rb index 9a0b787420..46e1711d28 100644 --- a/ext/openssl/lib/openssl/config.rb +++ b/ext/openssl/lib/openssl/config.rb @@ -298,50 +298,6 @@ module OpenSSL end ## - # - # *Deprecated* - # - # Use #get_value instead - def value(arg1, arg2 = nil) # :nodoc: - warn('Config#value is deprecated; use Config#get_value') - if arg2.nil? - section, key = 'default', arg1 - else - section, key = arg1, arg2 - end - section ||= 'default' - section = 'default' if section.empty? - get_key_string(section, key) - end - - ## - # *Deprecated in v2.2.0*. This method will be removed in a future release. - # - # Set the target _key_ with a given _value_ under a specific _section_. - # - # Given the following configurating file being loaded: - # - # config = OpenSSL::Config.load('foo.cnf') - # #=> #<OpenSSL::Config sections=["default"]> - # puts config.to_s - # #=> [ default ] - # # foo=bar - # - # You can set the value of _foo_ under the _default_ section to a new - # value: - # - # config.add_value('default', 'foo', 'buzz') - # #=> "buzz" - # puts config.to_s - # #=> [ default ] - # # foo=buzz - # - def add_value(section, key, value) - check_modify - (@data[section] ||= {})[key] = value - end - - ## # Get a specific _section_ from the current configuration # # Given the following configurating file being loaded: @@ -361,46 +317,6 @@ module OpenSSL @data[section] || {} end - ## - # Deprecated - # - # Use #[] instead - def section(name) # :nodoc: - warn('Config#section is deprecated; use Config#[]') - @data[name] || {} - end - - ## - # *Deprecated in v2.2.0*. This method will be removed in a future release. - # - # Sets a specific _section_ name with a Hash _pairs_. - # - # Given the following configuration being created: - # - # config = OpenSSL::Config.new - # #=> #<OpenSSL::Config sections=[]> - # config['default'] = {"foo"=>"bar","baz"=>"buz"} - # #=> {"foo"=>"bar", "baz"=>"buz"} - # puts config.to_s - # #=> [ default ] - # # foo=bar - # # baz=buz - # - # It's important to note that this will essentially merge any of the keys - # in _pairs_ with the existing _section_. For example: - # - # config['default'] - # #=> {"foo"=>"bar", "baz"=>"buz"} - # config['default'] = {"foo" => "changed"} - # #=> {"foo"=>"changed"} - # config['default'] - # #=> {"foo"=>"changed", "baz"=>"buz"} - # - def []=(section, pairs) - check_modify - set_section(section, pairs) - end - def set_section(section, pairs) # :nodoc: hash = @data[section] ||= {} pairs.each do |key, value| @@ -488,12 +404,6 @@ module OpenSSL @data = other.data.dup end - def check_modify - warn "#{caller(2, 1)[0]}: warning: do not modify OpenSSL::Config; this " \ - "method is deprecated and will be removed in a future release." - raise TypeError.new("Insecure: can't modify OpenSSL config") if frozen? - end - def get_key_string(section, key) Config.get_key_string(@data, section, key) end |