method

set_key

Importance_0
v2_6_3 - Show latest stable - 0 notes - Class: Settings
  • 1_8_6_287
  • 1_8_7_72
  • 1_8_7_330
  • 1_9_1_378
  • 1_9_2_180
  • 1_9_3_125
  • 1_9_3_392
  • 2_1_10
  • 2_2_9
  • 2_4_6
  • 2_5_5
  • 2_6_3 (0)
  • What's this?
set_key(raw_key, value, hash, file) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/bundler/settings.rb, line 358
    def set_key(raw_key, value, hash, file)
      raw_key = raw_key.to_s
      value = array_to_s(value) if is_array(raw_key)

      key = key_for(raw_key)

      return if hash[key] == value

      hash[key] = value
      hash.delete(key) if value.nil?

      Validator.validate!(raw_key, converted_value(value, raw_key), hash)

      return unless file
      SharedHelpers.filesystem_access(file) do |p|
        FileUtils.mkdir_p(p.dirname)
        require "bundler/yaml_serializer"
        p.open("w") {|f| f.write(YAMLSerializer.dump(hash)) }
      end
    end
Register or log in to add new notes.