Sha256: a8bcba18c938c305808e7e281c0e5fffc2d4d4db76e204f0aaf0ef836d2deb59

Contents?: true

Size: 1.69 KB

Versions: 3

Compression:

Stored size: 1.69 KB

Contents

module AssMaintainer
  class InfoBase
    # Mixins for file deployed infobase
    module FileIb
      # Default destroyer for file infobase
      class FileBaseDestroyer
        include Interfaces::IbDestroyer
        def entry_point
          FileUtils.rm_r infobase.connection_string.path.to_s
        end
      end

      # True if infobase exists
      def exists?
        File.file?("#{connection_string.path}/1Cv8.1CD")
      end

      def maker
        options[:maker] || InfoBase::DefaultMaker.new
      end
      private :maker

      def destroyer
        options[:destroyer] || FileBaseDestroyer.new
      end
      private :destroyer

      # Connection string fore createinfobase
      def make_connection_string
        connection_string
      end

      # Dummy infobase wrupper
      # @return [InfoBaseWrapper]
      def infobase_wrapper
        @infobase_wrapper = InfoBaseWrapper.new(self)
      end

      # (see Interfaces::InfoBaseWrapper)
      class InfoBaseWrapper
        include Interfaces::InfoBaseWrapper
        attr_accessor :infobase
        def initialize(infobase)
          self.infobase = infobase
        end

        # (see Interfaces::InfoBaseWrapper#sessions)
        def sessions
          []
        end

        # (see Interfaces::InfoBaseWrapper#lock)
        def lock
        end

        # (see Interfaces::InfoBaseWrapper#unlock)
        def unlock
        end

        # (see Interfaces::InfoBaseWrapper#unlock!)
        def unlock!
        end

        # (see Interfaces::InfoBaseWrapper#locked?)
        def locked?
          false
        end

        # (see Interfaces::InfoBaseWrapper#locked_we?)
        def locked_we?
          false
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ass_maintainer-info_base-0.1.2 lib/ass_maintainer/info_base/file_ib.rb
ass_maintainer-info_base-0.1.1 lib/ass_maintainer/info_base/file_ib.rb
ass_maintainer-info_base-0.1.0 lib/ass_maintainer/info_base/file_ib.rb