Sha256: 2bfd89ea45cfaec8512c1232ee45874047f1ee4277cb74ebe1f3aa74f07ba300

Contents?: true

Size: 580 Bytes

Versions: 2

Compression:

Stored size: 580 Bytes

Contents

module Rsh
  module Marks
    def mark key
      ensure_mark_requrements!
      bash "touch #{marks_dir}/#{key}"
    end

    def has_mark? key
      ensure_mark_requrements!
      file_exist? "#{marks_dir}/#{key}"
    end
    
    def clear_marks
      bash "rm -r #{marks_dir}"
    end
    
    protected
      def marks_dir
        home "/.marks"
      end

      def ensure_mark_requrements!
        unless @ensure_mark_requrements
          create_directory marks_dir unless directory_exist? marks_dir
          @ensure_mark_requrements = true
        end
      end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
vos-0.0.4 lib/rsh/box/marks.rb
vfs-0.0.4 lib/rsh/box/marks.rb