Sha256: 36709c66d5476521e4f4d100af793391d11184d0e8451563a2af378dfe90e206

Contents?: true

Size: 768 Bytes

Versions: 10

Compression:

Stored size: 768 Bytes

Contents

module Picky

  module Backends

    class Memory

      # 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
          create_directory cache_path
          hash.dump_marshal 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

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
picky-3.5.1 lib/picky/backends/memory/marshal.rb
picky-3.5.0 lib/picky/backends/memory/marshal.rb
picky-3.4.3 lib/picky/backends/memory/marshal.rb
picky-3.4.2 lib/picky/backends/memory/marshal.rb
picky-3.4.1 lib/picky/backends/memory/marshal.rb
picky-3.4.0 lib/picky/backends/memory/marshal.rb
picky-3.3.3 lib/picky/backends/memory/marshal.rb
picky-3.3.2 lib/picky/backends/memory/marshal.rb
picky-3.3.1 lib/picky/backends/memory/marshal.rb
picky-3.3.0 lib/picky/backends/memory/marshal.rb