Sha256: 6e872a16882f64d38711a83f2c555458836d58264bca2d30042fb198be8b0055

Contents?: true

Size: 827 Bytes

Versions: 6

Compression:

Stored size: 827 Bytes

Contents

module Pione
  module System
    # `DomainDump` is a class that dumps domain environment as a file for
    # exporting the environment from PIONE world to externals.
    class DomainDump < StructX
      FILENAME = ".domain.dump"

      # Load the domain dump file.
      #
      # @param location [Location::DataLocation]
      #   the domain dump file
      # @return [DomainDump]
      #   domain dump object
      def self.load(location)
        if location.directory?
          location = location + FILENAME
        end

        new(Marshal.load(location.read))
      end

      member :env

      # Write a domain dump file.
      def write(location)
        if location.directory?
          location = location + ".domain.dump"
        end

        location.write(Marshal.dump(env.dumpable))
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pione-0.5.0 lib/pione/system/domain-dump.rb
pione-0.5.0.alpha.2 lib/pione/system/domain-dump.rb
pione-0.5.0.alpha.1 lib/pione/system/domain-dump.rb
pione-0.4.2 lib/pione/system/domain-dump.rb
pione-0.4.1 lib/pione/system/domain-dump.rb
pione-0.4.0 lib/pione/system/domain-dump.rb