Sha256: cffeb81bee3dd33d0e29ef599e974cf931d50b2b233bca3f6a441f5e4a8fb2c4

Contents?: true

Size: 675 Bytes

Versions: 25

Compression:

Stored size: 675 Bytes

Contents

module Index
  
  module File
    
    # Index data in the Ruby Marshal format.
    #
    class Marshal < Basic
      
      # Uses the extension "dump".
      #
      def extension
        :dump
      end
      # Loads the index hash from marshal format.
      #
      def load
        ::Marshal.load ::File.open(cache_path, 'r:binary')
      end
      # Dumps the index hash in marshal format.
      #
      def dump hash
        hash.dump_marshalled cache_path
      end
      # A marshal file does not provide retrieve functionality.
      #
      def retrieve
        raise "Can't retrieve from marshalled file. Use text file."
      end
      
    end
    
  end
  
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
picky-1.4.1 lib/picky/index/file/marshal.rb
picky-1.4.0 lib/picky/index/file/marshal.rb
picky-1.3.4 lib/picky/index/file/marshal.rb
picky-1.3.3 lib/picky/index/file/marshal.rb
picky-1.3.2 lib/picky/index/file/marshal.rb
picky-1.3.1 lib/picky/index/file/marshal.rb
picky-1.3.0 lib/picky/index/file/marshal.rb
picky-1.2.4 lib/picky/index/file/marshal.rb
picky-1.2.3 lib/picky/index/file/marshal.rb
picky-1.2.2 lib/picky/index/file/marshal.rb
picky-1.2.1 lib/picky/index/file/marshal.rb
picky-1.2.0 lib/picky/index/file/marshal.rb
picky-1.1.7 lib/picky/index/file/marshal.rb
picky-1.1.6 lib/picky/index/file/marshal.rb
picky-1.1.5 lib/picky/index/file/marshal.rb
picky-1.1.4 lib/picky/index/file/marshal.rb
picky-1.1.3 lib/picky/index/file/marshal.rb
picky-1.1.2 lib/picky/index/file/marshal.rb
picky-1.1.1 lib/picky/index/file/marshal.rb
picky-1.1.0 lib/picky/index/file/marshal.rb