Sha256: a11f2d9f92f43602ceac5b4226c7486ffdfa485e7f4c8d7d840ec1fd56e45a71

Contents?: true

Size: 678 Bytes

Versions: 20

Compression:

Stored size: 678 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
      )

      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.7.13 lib/serverspec/helper/type.rb
serverspec-0.7.12 lib/serverspec/helper/type.rb
serverspec-0.7.11 lib/serverspec/helper/type.rb
serverspec-0.7.10 lib/serverspec/helper/type.rb
serverspec-0.7.9 lib/serverspec/helper/type.rb
serverspec-0.7.8 lib/serverspec/helper/type.rb
serverspec-0.7.7 lib/serverspec/helper/type.rb
serverspec-0.7.6 lib/serverspec/helper/type.rb
serverspec-0.7.5 lib/serverspec/helper/type.rb
serverspec-0.7.4 lib/serverspec/helper/type.rb
serverspec-0.7.3 lib/serverspec/helper/type.rb
serverspec-0.7.2 lib/serverspec/helper/type.rb
serverspec-0.7.1 lib/serverspec/helper/type.rb
serverspec-0.7.0 lib/serverspec/helper/type.rb
serverspec-0.6.30 lib/serverspec/helper/type.rb
serverspec-0.6.29 lib/serverspec/helper/type.rb
serverspec-0.6.28 lib/serverspec/helper/type.rb
serverspec-0.6.27 lib/serverspec/helper/type.rb
serverspec-0.6.26 lib/serverspec/helper/type.rb
serverspec-0.6.25 lib/serverspec/helper/type.rb