Sha256: 6c47b62e43068e9daa73bd1d586688848bc1729133eca82105e32fbbf22764b3

Contents?: true

Size: 1.33 KB

Versions: 10

Compression:

Stored size: 1.33 KB

Contents

class TestLab

  class Provider

    # Local Provider Error Class
    class LocalError < ProviderError; end

    # Local Provider Class
    #
    # @author Zachary Patten <zachary AT jovelabs DOT com>
    class Local

      def initialize(config={}, ui=nil)
        @config = (config || Hash.new)
        @ui     = (ui     || TestLab.ui)

        # ensure our local key is there
        @config[:local] ||= Hash.new
      end

      # This is a NO-OP
      def create
        true
      end

      # This is a NO-OP
      def destroy
        true
      end

      # This is a NO-OP
      def up
        true
      end

      # This is a NO-OP
      def down
        true
      end

      # This is a NO-OP
      def reload
        self.down
        self.up

        true
      end

      # This is a NO-OP
      def state
        :running
      end

      # This is a NO-OP
      def exists?
        true
      end

      # This is a NO-OP
      def alive?
        true
      end

      # This is a NO-OP
      def dead?
        false
      end

      def instance_id
        TestLab.hostname
      end

      def user
        ENV['USER']
      end

      def identity
        File.join(ENV['HOME'], ".ssh", "id_rsa")
      end

      def ip
        "127.0.0.1"
      end

      def port
        (@config[:local][:port] || 22)
      end

    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
testlab-0.9.1 lib/testlab/providers/local.rb
testlab-0.9.0 lib/testlab/providers/local.rb
testlab-0.8.6 lib/testlab/providers/local.rb
testlab-0.8.5 lib/testlab/providers/local.rb
testlab-0.8.4 lib/testlab/providers/local.rb
testlab-0.8.3 lib/testlab/providers/local.rb
testlab-0.8.2 lib/testlab/providers/local.rb
testlab-0.8.1 lib/testlab/providers/local.rb
testlab-0.8.0 lib/testlab/providers/local.rb
testlab-0.7.6 lib/testlab/providers/local.rb