class DTK::Client::Operation::Service::Edit

Public Class Methods

execute(args = Args.new) click to toggle source
# File lib/client/operation/service/edit.rb, line 21
def self.execute(args = Args.new)
  ret = nil
  wrap_operation(args) do |args|
    service_instance   = args.required(:service_instance)
    absolute_file_path = args.required(:absolute_file_path)
    push_after_edit    = args[:push_after_edit]
    commit_message     = args[:commit_message]

    response = Pull.execute(:service_instance => service_instance)
    repo = response.required(:repo)

    OsUtil.edit(absolute_file_path)
    return ret unless push_after_edit and repo.changed?

    commit_message ||= Internal.prompt_for_commit_message

    # TODO: do commit

    Push.execute(:service_instance => service_instance)
    ret
  end
end