Sha256: 896b5f5fc8cf8d84959922f4529e3c592ba3982b51f7a1c2f56e0b42abd89485

Contents?: true

Size: 438 Bytes

Versions: 13

Compression:

Stored size: 438 Bytes

Contents

module Serverspec
  module Type
    class Base
      def initialize(name=nil)
        @name   = name
        @runner = Specinfra::Runner.instance
      end

      def to_s
        type = self.class.name.split(':')[-1]
        type.gsub!(/([a-z\d])([A-Z])/, '\1 \2')
        type.capitalize!
        %Q!#{type} "#{@name}"!
      end

      alias_method :inspect, :to_s

      def to_ary
        to_s.split(" ")
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta15 lib/serverspec/type/base.rb
serverspec-2.0.0.beta14 lib/serverspec/type/base.rb
serverspec-2.0.0.beta13 lib/serverspec/type/base.rb
serverspec-2.0.0.beta12 lib/serverspec/type/base.rb
serverspec-2.0.0.beta11 lib/serverspec/type/base.rb
serverspec-2.0.0.beta10 lib/serverspec/type/base.rb
serverspec-2.0.0.beta9 lib/serverspec/type/base.rb
serverspec-2.0.0.beta8 lib/serverspec/type/base.rb
serverspec-2.0.0.beta7 lib/serverspec/type/base.rb
serverspec-2.0.0.beta6 lib/serverspec/type/base.rb
serverspec-2.0.0.beta5 lib/serverspec/type/base.rb
serverspec-2.0.0.beta4 lib/serverspec/type/base.rb
serverspec-2.0.0.beta3 lib/serverspec/type/base.rb