Class: Monk
Instance Method Summary collapse
- #add(name, repository) ⇒ Object
- #init(target = ".") ⇒ Object
- #list ⇒ Object
- #rm(name) ⇒ Object
- #show(name) ⇒ Object
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([:skeleton] || "default"), target) ? cleanup(target) : say_status(:error, clone_error(target)) end |
#list ⇒ Object
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 |