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
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([:skeleton] || "default") || [:skeleton], target) ? cleanup(target) : say_status(:error, clone_error(target)) end |
#list ⇒ Object
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 |