Sha256: e382e824c1655a7db0dbe70c34536d9429e4a8a038e4e0d5610ca1627a25391d

Contents?: true

Size: 667 Bytes

Versions: 12

Compression:

Stored size: 667 Bytes

Contents

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

      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

12 entries across 12 versions & 1 rubygems

Version Path
serverspec-0.6.24 lib/serverspec/helper/type.rb
serverspec-0.6.23 lib/serverspec/helper/type.rb
serverspec-0.6.22 lib/serverspec/helper/type.rb
serverspec-0.6.21 lib/serverspec/helper/type.rb
serverspec-0.6.20 lib/serverspec/helper/type.rb
serverspec-0.6.19 lib/serverspec/helper/type.rb
serverspec-0.6.18 lib/serverspec/helper/type.rb
serverspec-0.6.17 lib/serverspec/helper/type.rb
serverspec-0.6.16 lib/serverspec/helper/type.rb
serverspec-0.6.15 lib/serverspec/helper/type.rb
serverspec-0.6.13 lib/serverspec/helper/type.rb
serverspec-0.6.12 lib/serverspec/helper/type.rb