Sha256: 43dceb89a1761a3bee536ad2e81e82fb16a842f0a7c8ae6922108018b2763964

Contents?: true

Size: 635 Bytes

Versions: 20

Compression:

Stored size: 635 Bytes

Contents

module Serverspec
  module Helper
    module Type
      types = %w(
        base service package port file cron command linux_kernel_parameter iptables host
        routing_table default_gateway selinux user group zfs ipnat ipfilter
      )

      types.each {|type| require "serverspec/type/#{type}" }

      types.each do |type|
        define_method type do |*args|
          name = args.first
          self.class.const_get('Serverspec').const_get('Type').const_get(camelize(type)).new(name)
        end
      end

      def camelize(string)
        string.split("_").each {|s| s.capitalize! }.join("")
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
serverspec-0.6.0 lib/serverspec/helper/type.rb
serverspec-0.5.8 lib/serverspec/helper/type.rb
serverspec-0.5.7 lib/serverspec/helper/type.rb
serverspec-0.5.6 lib/serverspec/helper/type.rb
serverspec-0.5.5 lib/serverspec/helper/type.rb
serverspec-0.5.4 lib/serverspec/helper/type.rb
serverspec-0.5.3 lib/serverspec/helper/type.rb
serverspec-0.5.2 lib/serverspec/helper/type.rb
serverspec-0.5.1 lib/serverspec/helper/type.rb
serverspec-0.5.0 lib/serverspec/helper/type.rb
serverspec-0.4.14 lib/serverspec/helper/type.rb
serverspec-0.4.13 lib/serverspec/helper/type.rb
serverspec-0.4.12 lib/serverspec/helper/type.rb
serverspec-0.4.11 lib/serverspec/helper/type.rb
serverspec-0.4.10 lib/serverspec/helper/type.rb
serverspec-0.4.9 lib/serverspec/helper/type.rb
serverspec-0.4.8 lib/serverspec/helper/type.rb
serverspec-0.4.7 lib/serverspec/helper/type.rb
serverspec-0.4.6 lib/serverspec/helper/type.rb
serverspec-0.4.5 lib/serverspec/helper/type.rb