Class: Pvim::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/pvim/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



8
9
10
# File 'lib/pvim/cli.rb', line 8

def self.source_root
  File.expand_path File.join('..', '..', '..', 'config'), __FILE__
end

Instance Method Details

#pathogen(dir = Dir.pwd) ⇒ Object



18
19
20
21
# File 'lib/pvim/cli.rb', line 18

def pathogen(dir=Dir.pwd)
  get "https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim",
      File.join(dir, 'autoload/pathogen.vim')
end

#setup(dir = File.join(Dir.pwd, 'pvim')) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/pvim/cli.rb', line 24

def setup(dir=File.join(Dir.pwd, 'pvim'))
  dir = empty_directory(dir)
  inside dir do
    empty_directory 'autoload'
    empty_directory 'bundle'
    pathogen dir
    copy_file File.join(self.class.source_root, 'vimrc'), 'vimrc'
    run "git init"
  end
end

#versionObject



13
14
15
# File 'lib/pvim/cli.rb', line 13

def version
  puts Pvim::VERSION
end