Class: Monk

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

Instance Method Summary collapse

Instance Method Details

#add(name, repository) ⇒ Object



29
30
31
32
# File 'lib/monk.rb', line 29

def add(name, repository)
  monk_config[name] = repository
  write_monk_config_file
end

#init(target = ".") ⇒ Object



10
11
12
13
14
# File 'lib/monk.rb', line 10

def init(target = ".")
  clone(source(options[:skeleton] || "default"), target) ?
    cleanup(target) :
    say_status(:error, clone_error(target))
end

#listObject



22
23
24
25
26
# File 'lib/monk.rb', line 22

def list
  monk_config.keys.sort.each do |key|
    show(key)
  end
end

#rm(name) ⇒ Object



35
36
37
38
# File 'lib/monk.rb', line 35

def rm(name)
  monk_config.delete(name)
  write_monk_config_file
end

#show(name) ⇒ Object



17
18
19
# File 'lib/monk.rb', line 17

def show(name)
  say_status name, source(name) || "repository not found"
end