Sha256: 401ee91988979cb7cc24a2215d5e84dc07611056fa21a865ae67deb7ac3c9a4c

Contents?: true

Size: 713 Bytes

Versions: 1

Compression:

Stored size: 713 Bytes

Contents

require 'toolshed'
require 'toolshed/client'

module Toolshed
  # Password module looks up password from configuration file if its found
  module Password
    def password_from_config(password)
      return '' if password.nil? || password.empty?

      translated_password = Toolshed.configuration
      password_parts = password.split(':')
      password_parts.each do |password_part|
        return password if translated_password[password_part].nil?
        translated_password = translated_password[password_part]
      end
      return translated_password
    rescue => e
      Toolshed::Logger.instance.fatal e.message
      Toolshed::Logger.instance.fatal e.inspect
      return password
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
toolshed-1.0.6 lib/toolshed/password.rb