Class: Textmate::Source::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/textmate/source/base.rb

Direct Known Subclasses

Github, Macromates

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.name(name = nil) ⇒ Object



3
4
5
6
# File 'lib/textmate/source/base.rb', line 3

def self.name(name = nil)
  @name = name if name
  @name
end

Instance Method Details

#<=>(other) ⇒ Object



12
13
14
# File 'lib/textmate/source/base.rb', line 12

def <=>(other)
  name <=> other.name
end

#around_install(bundle, &block) ⇒ Object



24
25
26
27
28
29
# File 'lib/textmate/source/base.rb', line 24

def around_install(bundle, &block)
  clear_existing(bundle)
  yield
  puts "#{bundle} bundle installed"
  puts
end

#clear_existing(bundle) ⇒ Object



16
17
18
# File 'lib/textmate/source/base.rb', line 16

def clear_existing(bundle)
  FileUtils.rm_rf(local_path_for(bundle))
end

#local_path_for(bundle) ⇒ Object



20
21
22
# File 'lib/textmate/source/base.rb', line 20

def local_path_for(bundle)
  File.join(Textmate::Local.bundle_install_path, "#{bundle}.tmbundle")
end

#nameObject



8
9
10
# File 'lib/textmate/source/base.rb', line 8

def name
  self.class.name
end