Sha256: 3f200f66df725c44f65931195a89b426e482c50a1b2f38989ae45aa9acf111c6

Contents?: true

Size: 718 Bytes

Versions: 14

Compression:

Stored size: 718 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 php_config
        mail_alias windows_registry_key
      )

      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

14 entries across 14 versions & 1 rubygems

Version Path
serverspec-0.10.4 lib/serverspec/helper/type.rb
serverspec-0.10.3 lib/serverspec/helper/type.rb
serverspec-0.10.2 lib/serverspec/helper/type.rb
serverspec-0.10.1 lib/serverspec/helper/type.rb
serverspec-0.10.0 lib/serverspec/helper/type.rb
serverspec-0.9.8 lib/serverspec/helper/type.rb
serverspec-0.9.7 lib/serverspec/helper/type.rb
serverspec-0.9.6 lib/serverspec/helper/type.rb
serverspec-0.9.5 lib/serverspec/helper/type.rb
serverspec-0.9.4 lib/serverspec/helper/type.rb
serverspec-0.9.3 lib/serverspec/helper/type.rb
serverspec-0.9.2 lib/serverspec/helper/type.rb
serverspec-0.9.1 lib/serverspec/helper/type.rb
serverspec-0.9.0 lib/serverspec/helper/type.rb