Class: MacSetup::SymlinkInstaller
- Inherits:
-
Object
- Object
- MacSetup::SymlinkInstaller
- Defined in:
- lib/mac_setup/symlink_installer.rb
Class Method Summary collapse
- .dotfiles ⇒ Object
- .install_dotfile(name) ⇒ Object
- .install_dotfiles ⇒ Object
- .install_symlinks(config) ⇒ Object
- .run(config, _status) ⇒ Object
Class Method Details
.dotfiles ⇒ Object
117 118 119 |
# File 'lib/mac_setup/symlink_installer.rb', line 117 def self.dotfiles Dir.entries(DOTFILES_PATH).reject { |entry| entry.start_with?(".") } end |
.install_dotfile(name) ⇒ Object
110 111 112 113 114 115 |
# File 'lib/mac_setup/symlink_installer.rb', line 110 def self.install_dotfile(name) dotfile = dotfiles.find { |file| file =~ /#{Regexp.escape(name)}/ } source = Symlink.new(name: dotfile) source.link end |
.install_dotfiles ⇒ Object
96 97 98 99 100 101 |
# File 'lib/mac_setup/symlink_installer.rb', line 96 def self.install_dotfiles dotfiles.each do |file_name| source = Symlink.new(name: file_name) source.link end end |
.install_symlinks(config) ⇒ Object
103 104 105 106 107 108 |
# File 'lib/mac_setup/symlink_installer.rb', line 103 def self.install_symlinks(config) config.symlinks.each do |source_path| source = Symlink.new(source_path: File.(source_path)) source.link end end |
.run(config, _status) ⇒ Object
91 92 93 94 |
# File 'lib/mac_setup/symlink_installer.rb', line 91 def self.run(config, _status) install_dotfiles install_symlinks(config) end |