Sha256: c3da74a3539ac79257a8ef742e27e41532fd4930c3e54b6eb2de28c6d00e2fef

Contents?: true

Size: 1.34 KB

Versions: 22

Compression:

Stored size: 1.34 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
        self.state
      end

      # This is a NO-OP
      def down
        self.state
      end

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

        self.state
      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
        %x(hostname).strip
      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

22 entries across 22 versions & 1 rubygems

Version Path
testlab-0.7.5 lib/testlab/providers/local.rb
testlab-0.7.4 lib/testlab/providers/local.rb
testlab-0.7.3 lib/testlab/providers/local.rb
testlab-0.7.2 lib/testlab/providers/local.rb
testlab-0.7.1 lib/testlab/providers/local.rb
testlab-0.6.17 lib/testlab/providers/local.rb
testlab-0.6.16 lib/testlab/providers/local.rb
testlab-0.6.15 lib/testlab/providers/local.rb
testlab-0.6.14 lib/testlab/providers/local.rb
testlab-0.6.12 lib/testlab/providers/local.rb
testlab-0.6.11 lib/testlab/providers/local.rb
testlab-0.6.10 lib/testlab/providers/local.rb
testlab-0.6.9 lib/testlab/providers/local.rb
testlab-0.6.8 lib/testlab/providers/local.rb
testlab-0.6.7 lib/testlab/providers/local.rb
testlab-0.6.6 lib/testlab/providers/local.rb
testlab-0.6.5 lib/testlab/providers/local.rb
testlab-0.6.4 lib/testlab/providers/local.rb
testlab-0.6.3 lib/testlab/providers/local.rb
testlab-0.6.2 lib/testlab/providers/local.rb