Module: MacSetup
- Defined in:
- lib/mac_setup.rb,
lib/mac_setup/shell.rb,
lib/mac_setup/plugin.rb,
lib/mac_setup/secrets.rb,
lib/mac_setup/version.rb,
lib/mac_setup/configuration.rb,
lib/mac_setup/system_status.rb,
lib/mac_setup/homebrew_runner.rb,
lib/mac_setup/plugins/keybase.rb,
lib/mac_setup/plugins/dotfiles.rb,
lib/mac_setup/script_installer.rb,
lib/mac_setup/secrets_installer.rb,
lib/mac_setup/symlink_installer.rb,
lib/mac_setup/brewfile_installer.rb,
lib/mac_setup/git_repo_installer.rb,
lib/mac_setup/homebrew_installer.rb,
lib/mac_setup/services_installer.rb,
lib/mac_setup/symlink_path_builder.rb,
lib/mac_setup/plugins/mac_app_store.rb,
lib/mac_setup/command_line_tools_installer.rb
Defined Under Namespace
Modules: Plugins
Classes: BrewfileInstaller, CommandLineToolsInstaller, Configuration, GitRepoInstaller, HomebrewInstaller, HomebrewRunner, Plugin, ScriptInstaller, Secrets, SecretsInstaller, ServicesInstaller, Shell, Symlink, SymlinkInstaller, SymlinkPathBuilder, SystemStatus
Constant Summary
collapse
- DEFAULT_DOTFILES_PATH =
File.expand_path("~/.dotfiles")
- DEFAULT_CONFIG_PATH =
File.join(DEFAULT_DOTFILES_PATH, "mac_setup/config.yml")
- INSTALLERS =
[
GitRepoInstaller,
SymlinkInstaller,
HomebrewRunner
]
- DEFAULT_PLUGINS =
[
Plugins::MacAppStore,
Plugins::Keybase,
Plugins::Dotfiles
]
- VERSION =
"0.8.4"
Class Method Summary
collapse
Class Method Details
.bootstrap(dotfiles_repo) ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'lib/mac_setup.rb', line 35
def bootstrap(dotfiles_repo)
HomebrewInstaller.run
GitRepoInstaller.install_repo(dotfiles_repo, dotfiles_path)
config = Configuration.new(DEFAULT_CONFIG_PATH)
plugins(config).each { |plugin| plugin.bootstrap(config) }
end
|
.dotfiles_path ⇒ Object
75
76
77
|
# File 'lib/mac_setup.rb', line 75
def dotfiles_path
DEFAULT_DOTFILES_PATH
end
|
.encrypt ⇒ Object
57
58
59
|
# File 'lib/mac_setup.rb', line 57
def encrypt
Secrets.encrypt(dotfiles_path)
end
|
.install ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/mac_setup.rb', line 44
def install
config = Configuration.new(DEFAULT_CONFIG_PATH)
GitRepoInstaller.install_repo(config.dotfiles_repo, dotfiles_path)
config = Configuration.new(DEFAULT_CONFIG_PATH)
plugins(config).each { |plugin| plugin.add_requirements(config) }
config.validate!
status = SystemStatus.new
INSTALLERS.each { |installer| installer.run(config, status) }
end
|
.log(message) ⇒ Object
65
66
67
68
69
70
71
72
73
|
# File 'lib/mac_setup.rb', line 65
def log(message)
if block_given?
print "#{message}..."
yield
puts "Ok."
else
puts message
end
end
|
.plugins(config) ⇒ Object
81
82
83
84
|
# File 'lib/mac_setup.rb', line 81
def plugins(config)
DEFAULT_PLUGINS + config.plugins.map { |plugin_name| Plugin.load(plugin_name) }
end
|
.shorten_path(path) ⇒ Object
61
62
63
|
# File 'lib/mac_setup.rb', line 61
def shorten_path(path)
path.to_s.sub(/#{ENV['HOME']}/, "~")
end
|