Class: CloneGitFile::Cloner

Inherits:
Object
  • Object
show all
Defined in:
lib/clone_git_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Cloner

Returns a new instance of Cloner.



6
7
8
# File 'lib/clone_git_file.rb', line 6

def initialize(file)
  @file = file
end

Instance Method Details

#open_fileObject



10
11
12
13
14
15
16
17
18
# File 'lib/clone_git_file.rb', line 10

def open_file
  if Dir.exists?(File.expand_path(local_repo_path))
    update_repo
  else
    clone_repo
  end

  launch_editor
end