-module Vagrant
- module Provisioners
- class CopyMyConf < Base
- class Config < Vagrant::Config::Base
- def self.all_attributes
- [:ssh, :vim, :git]
- end
- attr_accessor *all_attributes
- attr_accessor :user_home
+require_relative "git"
+require_relative "ssh"
+require_relative "vim"
- def all_true
- self.class.all_attributes.collect do |attr|
- self.send(attr) ? attr : nil
- end.compact
- end
- end
+module CopyMyConf
+ class Config < Vagrant.plugin("2", :config)
+ attr_accessor :user_home
+
+ def git
+ @git ||= CopyMyConf::Git.new
+ end
+
+ def vim
+ @vim ||= CopyMyConf::Vim.new
+ end
+
+ def ssh
+ @ssh ||=CopyMyConf::Ssh.new
+ end
+
+ def all_enabled_attributes
+ [@ssh, @vim, @git].compact
end
end
end