Class: Itamae::Plugin::Resource::Ghq
- Inherits:
-
Resource::Base
- Object
- Resource::Base
- Itamae::Plugin::Resource::Ghq
- Defined in:
- lib/itamae/plugin/resource/ghq.rb
Instance Method Summary collapse
Instance Method Details
#action_create(options) ⇒ Object
18 19 20 21 22 |
# File 'lib/itamae/plugin/resource/ghq.rb', line 18 def action_create() unless current.exist run_command(["ghq", "get", attributes.repository]) end end |
#action_update(options) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/itamae/plugin/resource/ghq.rb', line 24 def action_update() result = run_command(["ghq", "get", "-u", attributes.repository]) unless result.stdout.match(/is up to date/) updated! end end |
#set_current_attributes ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/itamae/plugin/resource/ghq.rb', line 10 def set_current_attributes super ensure_ghq_availability result = run_command("ghq list | grep '#{attributes.repository}$'", error: false) current.exist = result.exit_status == 0 end |