Method: Azuki::Plugin.load!

Defined in:
lib/azuki/plugin.rb

.load!Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/azuki/plugin.rb', line 43

def self.load!
  list.each do |plugin|
    check_for_deprecation(plugin)
    next if skip_plugins.include?(plugin)
    load_plugin(plugin)
  end
  # check to see if we are using ddollar/azuki-accounts
  if list.include?('azuki-accounts') && Azuki::Auth.methods.include?(:fetch_from_account)
    # setup netrc to match the default, if one exists
    if  = %x{ git config azuki.account }.chomp
       = Azuki::Auth. rescue nil
      if  && Azuki::Auth.read_credentials != [Azuki::Auth.user, Azuki::Auth.password]
        Azuki::Auth.credentials = [Azuki::Auth.user, Azuki::Auth.password]
        Azuki::Auth.write_credentials
        load("#{File.dirname(__FILE__)}/command/accounts.rb")
        # kill memoization in case '--account' was passed
        Azuki::Auth.instance_variable_set(:@account, nil)
      end
    end
  end
end