Class: MovePathogenFile
- Inherits:
-
Object
- Object
- MovePathogenFile
- Defined in:
- lib/vpm/tasks/move_pathogen_file.rb
Instance Method Summary collapse
-
#initialize(base_dir) ⇒ MovePathogenFile
constructor
A new instance of MovePathogenFile.
- #perform ⇒ Object
- #undo ⇒ Object
Constructor Details
#initialize(base_dir) ⇒ MovePathogenFile
Returns a new instance of MovePathogenFile.
2 3 4 5 |
# File 'lib/vpm/tasks/move_pathogen_file.rb', line 2 def initialize(base_dir) @source_file = File.join(base_dir, "pathogen", "autoload", "pathogen.vim") @destination = File.join(VPM.vim_dir_path, "autoload", "pathogen.vim") end |
Instance Method Details
#perform ⇒ Object
7 8 9 10 11 |
# File 'lib/vpm/tasks/move_pathogen_file.rb', line 7 def perform @file_already_exists = File.exists? @destination return true if @file_already_exists FileUtils.mv(@source_file, @destination) end |
#undo ⇒ Object
13 14 15 16 |
# File 'lib/vpm/tasks/move_pathogen_file.rb', line 13 def undo return if @file_already_exists FileUtils.rm @destination end |