Sha256: c7ad9154baf75da49fc8d79e044b7296457e9fae183adf787f1cb22b65acab38

Contents?: true

Size: 569 Bytes

Versions: 2

Compression:

Stored size: 569 Bytes

Contents

require 'exogenesis/support/passenger'

# Links all files in the given directory to your home directory
class Dotfile < Passenger
  register_as :dotfile
  needs :directory_name
  with_emoji :house

  def up
    each_dotfile do |source, destination|
      ln_s source, destination
    end
  end

  def down
    each_dotfile do |_source, destination|
      rm_rf destination
    end
  end

  private

  def each_dotfile
    get_path_in_working_directory(directory_name).each_child do |source|
      yield source, get_path_in_home(".#{source.basename}")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exogenesis-1.0.0 lib/exogenesis/passengers/dotfile.rb
exogenesis-0.2.0 lib/exogenesis/passengers/dotfile.rb