class FSSM::Path

Public Class Methods

new(path=nil, glob=nil, options={}, &block) click to toggle source
# File lib/fssm/path.rb, line 2
def initialize(path=nil, glob=nil, options={}, &block)
  @options = options
  set_path(path || '.')
  set_glob(glob || '**/*')
  init_callbacks

  if block_given?
    if block.arity == 1
      block.call(self)
    else
      self.instance_eval(&block)
    end
  end
end

Public Instance Methods

create(*args, &block) click to toggle source
# File lib/fssm/path.rb, line 30
def create(*args, &block)
  callback_action(:create, (block_given? ? block : args))
end
delete(*args, &block) click to toggle source
# File lib/fssm/path.rb, line 38
def delete(*args, &block)
  callback_action(:delete, (block_given? ? block : args))
end
glob(value=nil) click to toggle source
# File lib/fssm/path.rb, line 25
def glob(value=nil)
  return @glob if value.nil?
  set_glob(value)
end
to_pathname() click to toggle source
# File lib/fssm/path.rb, line 21
def to_pathname
  @path
end
to_s() click to toggle source
# File lib/fssm/path.rb, line 17
def to_s
  @path.to_s
end
update(*args, &block) click to toggle source
# File lib/fssm/path.rb, line 34
def update(*args, &block)
  callback_action(:update, (block_given? ? block : args))
end