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



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

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

#init(target = ".") ⇒ Object



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

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

#listObject



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

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

#rm(name) ⇒ Object



40
41
42
43
# File 'lib/monk.rb', line 40

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

#show(name) ⇒ Object



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

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