Sha256: ca6647fa605ea44f48feee4fdffde11a56785da8452765a816a3db91cc1d2ae8

Contents?: true

Size: 625 Bytes

Versions: 34

Compression:

Stored size: 625 Bytes

Contents

module Inch
  module Codebase
    class Serializer
      INCH_DB_DIR = File.join('.inch', 'db')

      def self.filename(revision)
        File.join(INCH_DB_DIR, revision)
      end

      def self.save(codebase, filename)
        content = Marshal.dump(codebase)
        FileUtils.mkdir_p(File.dirname(filename))
        File.open(filename, 'wb') { |file| file.write(content) }
      end

      def self.load(filename)
        codebase = Marshal.load(File.binread(filename))
        codebase.objects.each do |object|
          object.object_lookup = codebase.objects
        end
        codebase
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
inch-0.9.0.rc1 lib/inch/codebase/serializer.rb
inch-0.8.0 lib/inch/codebase/serializer.rb
inch-0.8.0.rc2 lib/inch/codebase/serializer.rb
inch-0.8.0.rc1 lib/inch/codebase/serializer.rb
inch-0.7.1 lib/inch/codebase/serializer.rb
inch-0.7.0 lib/inch/codebase/serializer.rb
inch-0.6.4 lib/inch/codebase/serializer.rb
inch-0.6.3 lib/inch/codebase/serializer.rb
inch-0.6.2 lib/inch/codebase/serializer.rb
inch-0.6.1 lib/inch/codebase/serializer.rb
inch-0.6.0 lib/inch/codebase/serializer.rb
inch-0.6.0.rc6 lib/inch/codebase/serializer.rb
inch-0.6.0.rc5 lib/inch/codebase/serializer.rb
inch-0.6.0.rc4 lib/inch/codebase/serializer.rb
inch-0.6.0.rc3 lib/inch/codebase/serializer.rb
inch-0.6.0.rc2 lib/inch/codebase/serializer.rb
inch-0.6.0.rc1 lib/inch/codebase/serializer.rb
inch-0.5.10 lib/inch/codebase/serializer.rb
inch-0.5.9 lib/inch/codebase/serializer.rb
inch-0.5.8 lib/inch/codebase/serializer.rb