Sha256: 9be8b9e9b3761b657f6deaa37b765aee3a893e904067ee5e23fb4716292147bf

Contents?: true

Size: 737 Bytes

Versions: 19

Compression:

Stored size: 737 Bytes

Contents

module Serverspec
  module Helper
    module Type
      types = %w(
        base cgroup command cron default_gateway file group host interface
        ipfilter ipnat iptables kernel_module linux_kernel_parameter lxc mail_alias
        package php_config port routing_table selinux service user yumrepo
        windows_registry_key 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

19 entries across 19 versions & 1 rubygems

Version Path
serverspec-0.13.7 lib/serverspec/helper/type.rb
serverspec-0.13.6 lib/serverspec/helper/type.rb
serverspec-0.13.5 lib/serverspec/helper/type.rb
serverspec-0.13.4 lib/serverspec/helper/type.rb
serverspec-0.13.3 lib/serverspec/helper/type.rb
serverspec-0.13.2 lib/serverspec/helper/type.rb
serverspec-0.13.1 lib/serverspec/helper/type.rb
serverspec-0.13.0 lib/serverspec/helper/type.rb
serverspec-0.12.0 lib/serverspec/helper/type.rb
serverspec-0.11.5 lib/serverspec/helper/type.rb
serverspec-0.11.4 lib/serverspec/helper/type.rb
serverspec-0.11.3 lib/serverspec/helper/type.rb
serverspec-0.11.2 lib/serverspec/helper/type.rb
serverspec-0.11.1 lib/serverspec/helper/type.rb
serverspec-0.11.0 lib/serverspec/helper/type.rb
serverspec-0.10.13 lib/serverspec/helper/type.rb
serverspec-0.10.12 lib/serverspec/helper/type.rb
serverspec-0.10.11 lib/serverspec/helper/type.rb
serverspec-0.10.10 lib/serverspec/helper/type.rb