Sha256: ca0c47cc64058814017dde2c1253fd9be76b3da248c7d04c2006eb87256ba6ba
Contents?: true
Size: 849 Bytes
Versions: 64
Compression:
Stored size: 849 Bytes
Contents
require 'itamae' module Itamae module Resource class Link < Base define_attribute :action, default: :create define_attribute :link, type: String, default_name: true define_attribute :to, type: String, required: true def pre_action case @current_action when :create attributes.exist = true end end def set_current_attributes current.exist = run_specinfra(:check_file_is_link, attributes.link) if current.exist current.to = run_specinfra(:get_file_link_target, attributes.link).stdout.strip end end def action_create(options) unless run_specinfra(:check_file_is_linked_to, attributes.link, attributes.to) run_specinfra(:link_file_to, attributes.link, attributes.to) end end end end end
Version data entries
64 entries across 64 versions & 1 rubygems