File: type.rb

package info (click to toggle)
ruby-serverspec 2.43.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 984 kB
  • sloc: ruby: 4,847; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 921 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Serverspec
  module Helper
    module Type
      types = %w(
        base bridge bond cgroup command cron default_gateway file fstab
        group host iis_website iis_app_pool interface ipfilter ipnat
        iptables ip6tables json_file kernel_module kvm linux_kernel_parameter lxc
        mail_alias mysql_config package php_config port ppa process
        routing_table selinux selinux_module service user yumrepo
        windows_feature windows_hot_fix windows_registry_key
        windows_scheduled_task zfs docker_base docker_image
        docker_container x509_certificate x509_private_key
        linux_audit_system hadoop_config php_extension windows_firewall
      )

      types.each {|type| require "serverspec/type/#{type}" }

      types.each do |type|
        define_method type do |*args|
          eval "Serverspec::Type::#{type.to_camel_case}.new(*args)"
        end
      end
    end
  end
end