Sha256: 541ec89bce0cfd7e25ec83ad31b43959e3d5264d65b54198441c9c4ac394c137

Contents?: true

Size: 829 Bytes

Versions: 25

Compression:

Stored size: 829 Bytes

Contents

module Serverspec
  module Helper
    module Type
      types = %w(
        base cgroup command cron default_gateway file group host iis_website iis_app_pool interface
        ipfilter ipnat iptables kernel_module linux_kernel_parameter lxc mail_alias
        package php_config port ppa process routing_table selinux service user yumrepo
        windows_feature windows_hot_fix windows_registry_key windows_scheduled_task zfs
      )

      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

25 entries across 25 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta19 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta18 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta17 lib/serverspec/helper/type.rb
serverspec-1.14.0 lib/serverspec/helper/type.rb
serverspec-1.13.0 lib/serverspec/helper/type.rb
serverspec-1.12.0 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta16 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta15 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta14 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta13 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta12 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta11 lib/serverspec/helper/type.rb
serverspec-1.11.0 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta10 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta9 lib/serverspec/helper/type.rb
serverspec-1.10.0 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta8 lib/serverspec/helper/type.rb
serverspec-2.0.0.beta7 lib/serverspec/helper/type.rb
serverspec-1.9.1 lib/serverspec/helper/type.rb
serverspec-1.9.0 lib/serverspec/helper/type.rb