facter 3.12.2.cfacter.20181217 → 4.0.7.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +56 -0
- data/.jrubyrc +2 -0
- data/.rspec +3 -0
- data/.rubocop.yml +122 -0
- data/.rubycritic.yml +4 -0
- data/.travis.yml +39 -0
- data/CODEOWNERS +2 -0
- data/Gemfile +7 -0
- data/LICENSE +21 -0
- data/README.md +47 -0
- data/Rakefile +9 -0
- data/VERSION +1 -0
- data/agent/facter-ng.gemspec +48 -0
- data/agent/lib/facter-ng.rb +7 -0
- data/bin/facter +6 -0
- data/block_groups.conf +14 -0
- data/check.sh +12 -0
- data/config/config.rb +6 -0
- data/custom_facts/my_custom_fact.rb +9 -0
- data/custom_facts/my_custom_os_fact.rb +8 -0
- data/docs/diagrams/facter_user_interaction.png +0 -0
- data/external_facts/my_external_fact.txt +1 -0
- data/facter.conf +21 -0
- data/facter.gemspec +48 -0
- data/lib/custom_facts/core/aggregate.rb +208 -0
- data/lib/custom_facts/core/directed_graph.rb +47 -0
- data/lib/custom_facts/core/execution.rb +122 -0
- data/lib/custom_facts/core/execution/base.rb +87 -0
- data/lib/custom_facts/core/execution/posix.rb +55 -0
- data/lib/custom_facts/core/execution/windows.rb +63 -0
- data/lib/custom_facts/core/file_loader.rb +30 -0
- data/lib/custom_facts/core/legacy_facter.rb +260 -0
- data/lib/custom_facts/core/logging.rb +200 -0
- data/lib/custom_facts/core/resolvable.rb +99 -0
- data/lib/custom_facts/core/suitable.rb +109 -0
- data/lib/custom_facts/util/collection.rb +179 -0
- data/lib/custom_facts/util/composite_loader.rb +18 -0
- data/lib/custom_facts/util/config.rb +82 -0
- data/lib/custom_facts/util/confine.rb +70 -0
- data/lib/custom_facts/util/directory_loader.rb +85 -0
- data/lib/custom_facts/util/fact.rb +210 -0
- data/lib/custom_facts/util/loader.rb +153 -0
- data/lib/custom_facts/util/normalization.rb +95 -0
- data/lib/custom_facts/util/nothing_loader.rb +12 -0
- data/lib/custom_facts/util/parser.rb +174 -0
- data/lib/custom_facts/util/resolution.rb +147 -0
- data/lib/custom_facts/util/unix_root.rb +11 -0
- data/lib/custom_facts/util/values.rb +109 -0
- data/lib/custom_facts/util/windows_root.rb +11 -0
- data/lib/custom_facts/version.rb +85 -0
- data/lib/facter.rb +159 -0
- data/lib/facts/aix/augeas/version.rb +14 -0
- data/lib/facts/aix/facterversion.rb +15 -0
- data/lib/facts/aix/hypervisors/lpar.rb +18 -0
- data/lib/facts/aix/hypervisors/wpar.rb +16 -0
- data/lib/facts/aix/kernel.rb +15 -0
- data/lib/facts/aix/kernelmajversion.rb +16 -0
- data/lib/facts/aix/kernelrelease.rb +15 -0
- data/lib/facts/aix/kernelversion.rb +16 -0
- data/lib/facts/aix/load_averages.rb +14 -0
- data/lib/facts/aix/networking/domain.rb +15 -0
- data/lib/facts/aix/networking/fqdn.rb +15 -0
- data/lib/facts/aix/networking/hostname.rb +15 -0
- data/lib/facts/aix/networking/ip.rb +16 -0
- data/lib/facts/aix/networking/primary.rb +15 -0
- data/lib/facts/aix/os/architecture.rb +16 -0
- data/lib/facts/aix/os/family.rb +16 -0
- data/lib/facts/aix/os/hardware.rb +15 -0
- data/lib/facts/aix/os/name.rb +16 -0
- data/lib/facts/aix/os/release.rb +19 -0
- data/lib/facts/aix/path.rb +14 -0
- data/lib/facts/aix/ruby/platform.rb +14 -0
- data/lib/facts/aix/ruby/sitedir.rb +14 -0
- data/lib/facts/aix/ruby/version.rb +15 -0
- data/lib/facts/aix/ssh.rb +34 -0
- data/lib/facts/base/network_interface.rb +9 -0
- data/lib/facts/debian/facterversion.rb +15 -0
- data/lib/facts/debian/kernel.rb +15 -0
- data/lib/facts/debian/kernelmajversion.rb +24 -0
- data/lib/facts/debian/kernelrelease.rb +14 -0
- data/lib/facts/debian/kernelversion.rb +15 -0
- data/lib/facts/debian/memory/swap/available.rb +15 -0
- data/lib/facts/debian/memory/swap/available_bytes.rb +14 -0
- data/lib/facts/debian/memory/swap/capacity.rb +14 -0
- data/lib/facts/debian/memory/swap/used.rb +15 -0
- data/lib/facts/debian/memory/swap/used_bytes.rb +14 -0
- data/lib/facts/debian/networking/domain.rb +15 -0
- data/lib/facts/debian/networking/fqdn.rb +15 -0
- data/lib/facts/debian/networking/hostname.rb +15 -0
- data/lib/facts/debian/networking/interfaces.rb +14 -0
- data/lib/facts/debian/networking/ip.rb +16 -0
- data/lib/facts/debian/networking/primary.rb +15 -0
- data/lib/facts/debian/os/architecture.rb +17 -0
- data/lib/facts/debian/os/distro.rb +29 -0
- data/lib/facts/debian/os/family.rb +17 -0
- data/lib/facts/debian/os/hardware.rb +15 -0
- data/lib/facts/debian/os/name.rb +16 -0
- data/lib/facts/debian/os/release.rb +24 -0
- data/lib/facts/debian/os/selinux.rb +21 -0
- data/lib/facts/debian/path.rb +15 -0
- data/lib/facts/debian/ruby/platform.rb +15 -0
- data/lib/facts/debian/ruby/sitedir.rb +15 -0
- data/lib/facts/debian/ruby/version.rb +16 -0
- data/lib/facts/debian/system_uptime/system_uptime_days.rb +15 -0
- data/lib/facts/debian/system_uptime/system_uptime_hours.rb +15 -0
- data/lib/facts/debian/system_uptime/system_uptime_minutes.rb +15 -0
- data/lib/facts/debian/system_uptime/system_uptime_uptime.rb +15 -0
- data/lib/facts/debian/timezone.rb +14 -0
- data/lib/facts/el/disks.rb +15 -0
- data/lib/facts/el/dmi/bios/release_date.rb +14 -0
- data/lib/facts/el/dmi/bios/vendor.rb +14 -0
- data/lib/facts/el/dmi/bios/version.rb +14 -0
- data/lib/facts/el/dmi/board/manufacturer.rb +14 -0
- data/lib/facts/el/dmi/board/product.rb +14 -0
- data/lib/facts/el/dmi/board/serial_number.rb +14 -0
- data/lib/facts/el/dmi/chassis/asset_tag.rb +14 -0
- data/lib/facts/el/dmi/chassis/type.rb +14 -0
- data/lib/facts/el/dmi/manufacturer.rb +14 -0
- data/lib/facts/el/dmi/product/name.rb +14 -0
- data/lib/facts/el/dmi/product/serial_number.rb +14 -0
- data/lib/facts/el/dmi/product/uuid.rb +14 -0
- data/lib/facts/el/facterversion.rb +14 -0
- data/lib/facts/el/filesystems.rb +14 -0
- data/lib/facts/el/fips_enabled.rb +14 -0
- data/lib/facts/el/kernel.rb +14 -0
- data/lib/facts/el/kernelmajversion.rb +23 -0
- data/lib/facts/el/kernelrelease.rb +14 -0
- data/lib/facts/el/kernelversion.rb +21 -0
- data/lib/facts/el/load_averages.rb +14 -0
- data/lib/facts/el/memory/swap/available.rb +15 -0
- data/lib/facts/el/memory/swap/available_bytes.rb +14 -0
- data/lib/facts/el/memory/swap/capacity.rb +14 -0
- data/lib/facts/el/memory/swap/total.rb +15 -0
- data/lib/facts/el/memory/swap/total_bytes.rb +14 -0
- data/lib/facts/el/memory/swap/used.rb +15 -0
- data/lib/facts/el/memory/swap/used_bytes.rb +14 -0
- data/lib/facts/el/memory/system/available.rb +15 -0
- data/lib/facts/el/memory/system/available_bytes.rb +14 -0
- data/lib/facts/el/memory/system/capacity.rb +14 -0
- data/lib/facts/el/memory/system/total.rb +15 -0
- data/lib/facts/el/memory/system/total_bytes.rb +14 -0
- data/lib/facts/el/memory/system/used.rb +15 -0
- data/lib/facts/el/memory/system/used_bytes.rb +14 -0
- data/lib/facts/el/mountpoints.rb +21 -0
- data/lib/facts/el/networking/domain.rb +15 -0
- data/lib/facts/el/networking/fqdn.rb +15 -0
- data/lib/facts/el/networking/hostname.rb +15 -0
- data/lib/facts/el/networking/interfaces.rb +14 -0
- data/lib/facts/el/networking/ip.rb +16 -0
- data/lib/facts/el/networking/primary.rb +15 -0
- data/lib/facts/el/os/architecture.rb +16 -0
- data/lib/facts/el/os/family.rb +14 -0
- data/lib/facts/el/os/hardware.rb +15 -0
- data/lib/facts/el/os/name.rb +17 -0
- data/lib/facts/el/os/release.rb +18 -0
- data/lib/facts/el/os/selinux.rb +21 -0
- data/lib/facts/el/path.rb +14 -0
- data/lib/facts/el/processors/count.rb +14 -0
- data/lib/facts/el/processors/isa.rb +23 -0
- data/lib/facts/el/processors/models.rb +14 -0
- data/lib/facts/el/processors/physicalcount.rb +14 -0
- data/lib/facts/el/ruby/platform.rb +14 -0
- data/lib/facts/el/ruby/sitedir.rb +14 -0
- data/lib/facts/el/ruby/version.rb +15 -0
- data/lib/facts/el/ssh.rb +26 -0
- data/lib/facts/el/system_uptime/days.rb +14 -0
- data/lib/facts/el/system_uptime/hours.rb +14 -0
- data/lib/facts/el/system_uptime/seconds.rb +14 -0
- data/lib/facts/el/system_uptime/uptime.rb +14 -0
- data/lib/facts/el/timezone.rb +14 -0
- data/lib/facts/macosx/augeas.rb +14 -0
- data/lib/facts/macosx/count.rb +14 -0
- data/lib/facts/macosx/dmi/product/name.rb +14 -0
- data/lib/facts/macosx/facterversion.rb +15 -0
- data/lib/facts/macosx/filesystems.rb +14 -0
- data/lib/facts/macosx/identity/gid.rb +14 -0
- data/lib/facts/macosx/identity/group.rb +14 -0
- data/lib/facts/macosx/identity/privileged.rb +14 -0
- data/lib/facts/macosx/identity/uid.rb +14 -0
- data/lib/facts/macosx/identity/user.rb +14 -0
- data/lib/facts/macosx/is_virtual.rb +30 -0
- data/lib/facts/macosx/isa.rb +14 -0
- data/lib/facts/macosx/kernel.rb +14 -0
- data/lib/facts/macosx/kernelmajversion.rb +15 -0
- data/lib/facts/macosx/kernelrelease.rb +14 -0
- data/lib/facts/macosx/kernelversion.rb +14 -0
- data/lib/facts/macosx/load_averages.rb +14 -0
- data/lib/facts/macosx/memory/swap/available.rb +16 -0
- data/lib/facts/macosx/memory/swap/available_bytes.rb +14 -0
- data/lib/facts/macosx/memory/swap/capacity.rb +14 -0
- data/lib/facts/macosx/memory/swap/encrypted.rb +14 -0
- data/lib/facts/macosx/memory/swap/total.rb +16 -0
- data/lib/facts/macosx/memory/swap/total_bytes.rb +14 -0
- data/lib/facts/macosx/memory/swap/used.rb +16 -0
- data/lib/facts/macosx/memory/swap/used_bytes.rb +14 -0
- data/lib/facts/macosx/memory/system/available.rb +16 -0
- data/lib/facts/macosx/memory/system/available_bytes.rb +14 -0
- data/lib/facts/macosx/memory/system/capacity.rb +14 -0
- data/lib/facts/macosx/memory/system/total.rb +16 -0
- data/lib/facts/macosx/memory/system/total_bytes.rb +14 -0
- data/lib/facts/macosx/memory/system/used.rb +16 -0
- data/lib/facts/macosx/memory/system/used_bytes.rb +14 -0
- data/lib/facts/macosx/models.rb +14 -0
- data/lib/facts/macosx/mountpoints.rb +16 -0
- data/lib/facts/macosx/network_ip.rb +13 -0
- data/lib/facts/macosx/networking/domain.rb +15 -0
- data/lib/facts/macosx/networking/fqdn.rb +15 -0
- data/lib/facts/macosx/networking/hostname.rb +15 -0
- data/lib/facts/macosx/networking/ipaddress.rb +14 -0
- data/lib/facts/macosx/os/architecture.rb +15 -0
- data/lib/facts/macosx/os/family.rb +16 -0
- data/lib/facts/macosx/os/hardware.rb +14 -0
- data/lib/facts/macosx/os/name.rb +16 -0
- data/lib/facts/macosx/os/release.rb +18 -0
- data/lib/facts/macosx/os/sw_vers/build.rb +15 -0
- data/lib/facts/macosx/os/sw_vers/product.rb +15 -0
- data/lib/facts/macosx/os/sw_vers/version.rb +17 -0
- data/lib/facts/macosx/path.rb +15 -0
- data/lib/facts/macosx/physicalcount.rb +14 -0
- data/lib/facts/macosx/processor_resolver.rb +71 -0
- data/lib/facts/macosx/ruby/platform.rb +15 -0
- data/lib/facts/macosx/ruby/sitedir.rb +15 -0
- data/lib/facts/macosx/ruby/version.rb +16 -0
- data/lib/facts/macosx/speed.rb +14 -0
- data/lib/facts/macosx/system_profiler/boot_mode.rb +14 -0
- data/lib/facts/macosx/system_profiler/boot_rom_version.rb +14 -0
- data/lib/facts/macosx/system_profiler/boot_volume.rb +14 -0
- data/lib/facts/macosx/system_profiler/computer_name.rb +14 -0
- data/lib/facts/macosx/system_profiler/cores.rb +14 -0
- data/lib/facts/macosx/system_profiler/hardware_uuid.rb +14 -0
- data/lib/facts/macosx/system_profiler/kernel_version.rb +14 -0
- data/lib/facts/macosx/system_profiler/l2_cache_per_core.rb +14 -0
- data/lib/facts/macosx/system_profiler/l3_cache.rb +14 -0
- data/lib/facts/macosx/system_profiler/memory.rb +14 -0
- data/lib/facts/macosx/system_profiler/model_identifier.rb +14 -0
- data/lib/facts/macosx/system_profiler/model_name.rb +14 -0
- data/lib/facts/macosx/system_profiler/processor_name.rb +14 -0
- data/lib/facts/macosx/system_profiler/processor_speed.rb +14 -0
- data/lib/facts/macosx/system_profiler/processors.rb +14 -0
- data/lib/facts/macosx/system_profiler/secure_virtual_memory.rb +14 -0
- data/lib/facts/macosx/system_profiler/serial_number.rb +14 -0
- data/lib/facts/macosx/system_profiler/smc_version.rb +14 -0
- data/lib/facts/macosx/system_profiler/system_version.rb +14 -0
- data/lib/facts/macosx/system_profiler/uptime.rb +14 -0
- data/lib/facts/macosx/system_profiler/username.rb +14 -0
- data/lib/facts/macosx/system_uptime/seconds.rb +14 -0
- data/lib/facts/macosx/system_uptime/system_uptime_days.rb +14 -0
- data/lib/facts/macosx/system_uptime/system_uptime_hours.rb +14 -0
- data/lib/facts/macosx/system_uptime/uptime.rb +14 -0
- data/lib/facts/macosx/timezone.rb +14 -0
- data/lib/facts/sles/facterversion.rb +14 -0
- data/lib/facts/sles/kernel.rb +14 -0
- data/lib/facts/sles/kernelmajversion.rb +15 -0
- data/lib/facts/sles/kernelrelease.rb +14 -0
- data/lib/facts/sles/kernelversion.rb +15 -0
- data/lib/facts/sles/memory/swap/available.rb +15 -0
- data/lib/facts/sles/memory/swap/available_bytes.rb +14 -0
- data/lib/facts/sles/memory/swap/capacity.rb +14 -0
- data/lib/facts/sles/memory/swap/total.rb +15 -0
- data/lib/facts/sles/memory/swap/total_bytes.rb +14 -0
- data/lib/facts/sles/memory/swap/used.rb +15 -0
- data/lib/facts/sles/memory/swap/used_bytes.rb +14 -0
- data/lib/facts/sles/memory/system/available.rb +15 -0
- data/lib/facts/sles/memory/system/available_bytes.rb +14 -0
- data/lib/facts/sles/memory/system/capacity.rb +14 -0
- data/lib/facts/sles/memory/system/total.rb +15 -0
- data/lib/facts/sles/memory/system/total_bytes.rb +14 -0
- data/lib/facts/sles/memory/system/used.rb +15 -0
- data/lib/facts/sles/memory/system/used_bytes.rb +14 -0
- data/lib/facts/sles/networking/domain.rb +15 -0
- data/lib/facts/sles/networking/fqdn.rb +15 -0
- data/lib/facts/sles/networking/hostname.rb +15 -0
- data/lib/facts/sles/networking/interfaces.rb +14 -0
- data/lib/facts/sles/networking/ip.rb +16 -0
- data/lib/facts/sles/networking/primary.rb +15 -0
- data/lib/facts/sles/os/architecture.rb +16 -0
- data/lib/facts/sles/os/family.rb +14 -0
- data/lib/facts/sles/os/hardware.rb +15 -0
- data/lib/facts/sles/os/name.rb +16 -0
- data/lib/facts/sles/os/release.rb +27 -0
- data/lib/facts/sles/os/selinux.rb +21 -0
- data/lib/facts/sles/path.rb +14 -0
- data/lib/facts/sles/ruby/platform.rb +14 -0
- data/lib/facts/sles/ruby/sitedir.rb +14 -0
- data/lib/facts/sles/ruby/version.rb +15 -0
- data/lib/facts/sles/ssh.rb +26 -0
- data/lib/facts/sles/timezone.rb +14 -0
- data/lib/facts/solaris/facterversion.rb +14 -0
- data/lib/facts/solaris/kernel.rb +14 -0
- data/lib/facts/solaris/kernelmajversion.rb +16 -0
- data/lib/facts/solaris/kernelrelease.rb +14 -0
- data/lib/facts/solaris/kernelversion.rb +14 -0
- data/lib/facts/solaris/networking/domain.rb +15 -0
- data/lib/facts/solaris/networking/fqdn.rb +15 -0
- data/lib/facts/solaris/networking/hostname.rb +15 -0
- data/lib/facts/solaris/networking/ipaddress.rb +14 -0
- data/lib/facts/solaris/os/architecture.rb +16 -0
- data/lib/facts/solaris/os/family.rb +14 -0
- data/lib/facts/solaris/os/hardware.rb +14 -0
- data/lib/facts/solaris/os/name.rb +17 -0
- data/lib/facts/solaris/os/release.rb +20 -0
- data/lib/facts/solaris/path.rb +14 -0
- data/lib/facts/solaris/ruby/platform.rb +14 -0
- data/lib/facts/solaris/ruby/sitedir.rb +14 -0
- data/lib/facts/solaris/ruby/version.rb +15 -0
- data/lib/facts/solaris/solaris_zones/current.rb +14 -0
- data/lib/facts/solaris/solaris_zones/zone.rb +25 -0
- data/lib/facts/windows/dhcp_servers.rb +23 -0
- data/lib/facts/windows/dmi/manufacturer.rb +16 -0
- data/lib/facts/windows/dmi/product/name.rb +16 -0
- data/lib/facts/windows/dmi/product/serial_number.rb +16 -0
- data/lib/facts/windows/dmi/product/uuid.rb +16 -0
- data/lib/facts/windows/facterversion.rb +15 -0
- data/lib/facts/windows/fips_enabled.rb +15 -0
- data/lib/facts/windows/hypervisors/hyperv.rb +22 -0
- data/lib/facts/windows/hypervisors/kvm.rb +34 -0
- data/lib/facts/windows/hypervisors/virtualbox.rb +35 -0
- data/lib/facts/windows/hypervisors/vmware.rb +22 -0
- data/lib/facts/windows/hypervisors/xen.rb +21 -0
- data/lib/facts/windows/identity/privileged.rb +15 -0
- data/lib/facts/windows/identity/user.rb +16 -0
- data/lib/facts/windows/interfaces.rb +15 -0
- data/lib/facts/windows/ipaddress6_interfaces.rb +19 -0
- data/lib/facts/windows/ipaddress_interfaces.rb +19 -0
- data/lib/facts/windows/kernel/kernel.rb +15 -0
- data/lib/facts/windows/kernel/kernel_maj_version.rb +15 -0
- data/lib/facts/windows/kernel/kernel_release.rb +15 -0
- data/lib/facts/windows/kernel/kernel_version.rb +15 -0
- data/lib/facts/windows/macaddress_interfaces.rb +19 -0
- data/lib/facts/windows/memory/system/available.rb +17 -0
- data/lib/facts/windows/memory/system/available_bytes.rb +17 -0
- data/lib/facts/windows/memory/system/capacity.rb +15 -0
- data/lib/facts/windows/memory/system/total.rb +17 -0
- data/lib/facts/windows/memory/system/total_bytes.rb +17 -0
- data/lib/facts/windows/memory/system/used.rb +16 -0
- data/lib/facts/windows/memory/system/used_bytes.rb +15 -0
- data/lib/facts/windows/mtu_interfaces.rb +19 -0
- data/lib/facts/windows/netmask6_interfaces.rb +19 -0
- data/lib/facts/windows/netmask_interfaces.rb +19 -0
- data/lib/facts/windows/network6_interfaces.rb +19 -0
- data/lib/facts/windows/network_interfaces.rb +19 -0
- data/lib/facts/windows/networking/dhcp.rb +15 -0
- data/lib/facts/windows/networking/domain.rb +16 -0
- data/lib/facts/windows/networking/fqdn.rb +20 -0
- data/lib/facts/windows/networking/hostname.rb +16 -0
- data/lib/facts/windows/networking/interfaces.rb +15 -0
- data/lib/facts/windows/networking/ip.rb +16 -0
- data/lib/facts/windows/networking/ip6.rb +16 -0
- data/lib/facts/windows/networking/mac.rb +16 -0
- data/lib/facts/windows/networking/mtu.rb +15 -0
- data/lib/facts/windows/networking/netmask.rb +16 -0
- data/lib/facts/windows/networking/netmask6.rb +16 -0
- data/lib/facts/windows/networking/network.rb +16 -0
- data/lib/facts/windows/networking/network6.rb +16 -0
- data/lib/facts/windows/networking/primary.rb +15 -0
- data/lib/facts/windows/networking/scope6.rb +15 -0
- data/lib/facts/windows/os/architecture.rb +16 -0
- data/lib/facts/windows/os/family.rb +16 -0
- data/lib/facts/windows/os/hardware.rb +16 -0
- data/lib/facts/windows/os/name.rb +16 -0
- data/lib/facts/windows/os/release.rb +33 -0
- data/lib/facts/windows/os/windows/edition_id.rb +16 -0
- data/lib/facts/windows/os/windows/installation_type.rb +16 -0
- data/lib/facts/windows/os/windows/product_name.rb +16 -0
- data/lib/facts/windows/os/windows/release_id.rb +16 -0
- data/lib/facts/windows/os/windows/system32.rb +16 -0
- data/lib/facts/windows/path.rb +15 -0
- data/lib/facts/windows/processor.rb +19 -0
- data/lib/facts/windows/processors/count.rb +16 -0
- data/lib/facts/windows/processors/isa.rb +16 -0
- data/lib/facts/windows/processors/models.rb +15 -0
- data/lib/facts/windows/processors/physicalcount.rb +16 -0
- data/lib/facts/windows/ruby/platform.rb +16 -0
- data/lib/facts/windows/ruby/sitedir.rb +16 -0
- data/lib/facts/windows/ruby/version.rb +16 -0
- data/lib/facts/windows/scope6_interfaces.rb +19 -0
- data/lib/facts/windows/system_uptime/system_uptime_days.rb +16 -0
- data/lib/facts/windows/system_uptime/system_uptime_hours.rb +16 -0
- data/lib/facts/windows/system_uptime/system_uptime_seconds.rb +16 -0
- data/lib/facts/windows/system_uptime/system_uptime_uptime.rb +16 -0
- data/lib/facts/windows/timezone.rb +15 -0
- data/lib/facts/windows/virtualization/is_virtual.rb +15 -0
- data/lib/facts/windows/virtualization/virtual.rb +15 -0
- data/lib/facts_utils/bytes_to_human_readable.rb +38 -0
- data/lib/facts_utils/uptime_parser.rb +121 -0
- data/lib/facts_utils/windows_release_finder.rb +51 -0
- data/lib/framework/cli/cli.rb +132 -0
- data/lib/framework/cli/cli_launcher.rb +17 -0
- data/lib/framework/config/block_list.rb +35 -0
- data/lib/framework/config/config_reader.rb +44 -0
- data/lib/framework/core/cache_manager.rb +19 -0
- data/lib/framework/core/fact/external/external_fact_manager.rb +31 -0
- data/lib/framework/core/fact/internal/core_fact.rb +15 -0
- data/lib/framework/core/fact/internal/internal_fact_manager.rb +45 -0
- data/lib/framework/core/fact_augmenter.rb +37 -0
- data/lib/framework/core/fact_filter.rb +36 -0
- data/lib/framework/core/fact_loaders/class_discoverer.rb +21 -0
- data/lib/framework/core/fact_loaders/external_fact_loader.rb +54 -0
- data/lib/framework/core/fact_loaders/fact_loader.rb +72 -0
- data/lib/framework/core/fact_loaders/internal_fact_loader.rb +52 -0
- data/lib/framework/core/fact_manager.rb +55 -0
- data/lib/framework/core/file_loader.rb +60 -0
- data/lib/framework/core/options.rb +68 -0
- data/lib/framework/core/options/config_file_options.rb +65 -0
- data/lib/framework/core/options/default_options.rb +32 -0
- data/lib/framework/core/options/helper_options.rb +40 -0
- data/lib/framework/core/options/options_validator.rb +42 -0
- data/lib/framework/core/options/priority_options.rb +12 -0
- data/lib/framework/detector/os_detector.rb +67 -0
- data/lib/framework/formatters/formatter_factory.rb +13 -0
- data/lib/framework/formatters/formatter_helper.rb +39 -0
- data/lib/framework/formatters/hocon_fact_formatter.rb +50 -0
- data/lib/framework/formatters/json_fact_formatter.rb +35 -0
- data/lib/framework/formatters/legacy_fact_formatter.rb +90 -0
- data/lib/framework/formatters/yaml_fact_formatter.rb +16 -0
- data/lib/framework/logging/legacy_logger.rb +31 -0
- data/lib/framework/logging/logger.rb +65 -0
- data/lib/framework/logging/multilogger.rb +115 -0
- data/lib/framework/parsers/query_parser.rb +99 -0
- data/lib/framework/utils/utils.rb +24 -0
- data/lib/models/fact_collection.rb +31 -0
- data/lib/models/loaded_fact.rb +13 -0
- data/lib/models/resolved_fact.rb +22 -0
- data/lib/models/searched_fact.rb +15 -0
- data/lib/resolvers/agent_resolver.rb +23 -0
- data/lib/resolvers/aix/architecture_resolver.rb +39 -0
- data/lib/resolvers/aix/ffi/ffi_helper.rb +35 -0
- data/lib/resolvers/aix/hardware_resolver.rb +39 -0
- data/lib/resolvers/aix/load_averages_resolver.rb +28 -0
- data/lib/resolvers/aix/networking_resolver.rb +34 -0
- data/lib/resolvers/aix/os_level_resolver.rb +26 -0
- data/lib/resolvers/aix/utils/odm_query.rb +41 -0
- data/lib/resolvers/augeas_resolver.rb +24 -0
- data/lib/resolvers/base_resolver.rb +33 -0
- data/lib/resolvers/debian_version_resolver.rb +34 -0
- data/lib/resolvers/disk_resolver.rb +47 -0
- data/lib/resolvers/dmi_resolver.rb +59 -0
- data/lib/resolvers/eos_release_resolver.rb +31 -0
- data/lib/resolvers/facterversion_resolver.rb +23 -0
- data/lib/resolvers/filesystems_resolver.rb +32 -0
- data/lib/resolvers/fips_enabled_resolver.rb +27 -0
- data/lib/resolvers/hostname_resolver.rb +46 -0
- data/lib/resolvers/identity_resolver.rb +31 -0
- data/lib/resolvers/load_averages_resolver.rb +27 -0
- data/lib/resolvers/lpar_resolver.rb +32 -0
- data/lib/resolvers/lsb_release_resolver.rb +34 -0
- data/lib/resolvers/macosx/dmi_resolver.rb +29 -0
- data/lib/resolvers/macosx/filesystems_resolver.rb +33 -0
- data/lib/resolvers/macosx/ipaddress_resolver.rb +40 -0
- data/lib/resolvers/macosx/load_averages_resolver.rb +27 -0
- data/lib/resolvers/macosx/mountpoints_resolver.rb +62 -0
- data/lib/resolvers/macosx/swap_memory_resolver.rb +43 -0
- data/lib/resolvers/macosx/system_memory_resolver.rb +46 -0
- data/lib/resolvers/macosx/system_profiler_resolver.rb +62 -0
- data/lib/resolvers/memory_resolver.rb +57 -0
- data/lib/resolvers/mountpoints_resolver.rb +62 -0
- data/lib/resolvers/networking_linux_resolver.rb +97 -0
- data/lib/resolvers/os_level_resolver.rb +28 -0
- data/lib/resolvers/os_release_resolver.rb +65 -0
- data/lib/resolvers/path_resolver.rb +22 -0
- data/lib/resolvers/processors_resolver.rb +56 -0
- data/lib/resolvers/redhat_release_resolver.rb +54 -0
- data/lib/resolvers/ruby_resolver.rb +25 -0
- data/lib/resolvers/selinux_resolver.rb +37 -0
- data/lib/resolvers/solaris/ipaddress_resolver.rb +40 -0
- data/lib/resolvers/solaris/solaris_os_release_resolver.rb +52 -0
- data/lib/resolvers/solaris/solaris_zone_name.rb +32 -0
- data/lib/resolvers/solaris/zone_resolver.rb +52 -0
- data/lib/resolvers/ssh_resolver.rb +76 -0
- data/lib/resolvers/suse_release_resolver.rb +33 -0
- data/lib/resolvers/sw_vers_resolver.rb +30 -0
- data/lib/resolvers/timezone_resolver.rb +22 -0
- data/lib/resolvers/uname_resolver.rb +42 -0
- data/lib/resolvers/uptime_resolver.rb +57 -0
- data/lib/resolvers/utils/filesystem_helper.rb +29 -0
- data/lib/resolvers/utils/fingerprint.rb +11 -0
- data/lib/resolvers/utils/ssh.rb +13 -0
- data/lib/resolvers/windows/dmi_bios_resolver.rb +41 -0
- data/lib/resolvers/windows/dmi_computersystem_resolver.rb +40 -0
- data/lib/resolvers/windows/ffi/ffi.rb +68 -0
- data/lib/resolvers/windows/ffi/hardware_ffi.rb +17 -0
- data/lib/resolvers/windows/ffi/identity_ffi.rb +15 -0
- data/lib/resolvers/windows/ffi/ip_adapter_addresses_lh.rb +161 -0
- data/lib/resolvers/windows/ffi/kernel_ffi.rb +14 -0
- data/lib/resolvers/windows/ffi/memory_ffi.rb +12 -0
- data/lib/resolvers/windows/ffi/network_utils.rb +64 -0
- data/lib/resolvers/windows/ffi/networking_ffi.rb +34 -0
- data/lib/resolvers/windows/ffi/os_version_info_ex.rb +17 -0
- data/lib/resolvers/windows/ffi/performance_information.rb +20 -0
- data/lib/resolvers/windows/ffi/system32_ffi.rb +18 -0
- data/lib/resolvers/windows/ffi/system_info.rb +30 -0
- data/lib/resolvers/windows/fips_resolver.rb +32 -0
- data/lib/resolvers/windows/hardware_architecture_resolver.rb +64 -0
- data/lib/resolvers/windows/identity_resolver.rb +57 -0
- data/lib/resolvers/windows/kernel_resolver.rb +42 -0
- data/lib/resolvers/windows/memory_resolver.rb +60 -0
- data/lib/resolvers/windows/netkvm_resolver.rb +31 -0
- data/lib/resolvers/windows/networking_resolver.rb +179 -0
- data/lib/resolvers/windows/processors_resolver.rb +65 -0
- data/lib/resolvers/windows/product_release_resolver.rb +36 -0
- data/lib/resolvers/windows/system32_resolver.rb +45 -0
- data/lib/resolvers/windows/uptime_resolver.rb +77 -0
- data/lib/resolvers/windows/utils/win32ole.rb +24 -0
- data/lib/resolvers/windows/virtualization_resolver.rb +65 -0
- data/lib/resolvers/windows/win_os_description_resolver.rb +31 -0
- data/lib/resolvers/wpar_resolver.rb +34 -0
- data/lib/util/fact.rb +14 -0
- data/tasks/create_fact.rake +19 -0
- data/tasks/fact_generator/fact.erb +14 -0
- data/tasks/fact_generator/fact_creator.rb +105 -0
- data/tasks/fact_generator/fact_spec.erb +18 -0
- data/tasks/fact_generator/facts.json +358 -0
- data/tasks/fact_generator/path.rb +10 -0
- metadata +659 -1065
- data/ext/facter/Makefile.erb +0 -31
- data/ext/facter/cpp-hocon/CMakeLists.txt +0 -67
- data/ext/facter/cpp-hocon/CONTRIBUTING.md +0 -9
- data/ext/facter/cpp-hocon/LICENSE +0 -17
- data/ext/facter/cpp-hocon/MAINTAINERS +0 -33
- data/ext/facter/cpp-hocon/README.md +0 -81
- data/ext/facter/cpp-hocon/acceptance/Gemfile +0 -18
- data/ext/facter/cpp-hocon/acceptance/Rakefile +0 -7
- data/ext/facter/cpp-hocon/acceptance/tests/fake.rb +0 -0
- data/ext/facter/cpp-hocon/appveyor.yml +0 -48
- data/ext/facter/cpp-hocon/lib/CMakeLists.txt +0 -94
- data/ext/facter/cpp-hocon/lib/Doxyfile.in +0 -2312
- data/ext/facter/cpp-hocon/lib/inc/hocon/config.hpp +0 -734
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_exception.hpp +0 -184
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_include_context.hpp +0 -51
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_includer.hpp +0 -53
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_includer_file.hpp +0 -30
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_list.hpp +0 -51
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_mergeable.hpp +0 -72
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_object.hpp +0 -81
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_origin.hpp +0 -98
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_parse_options.hpp +0 -139
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_parseable.hpp +0 -47
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_render_options.hpp +0 -128
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_resolve_options.hpp +0 -83
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_syntax.hpp +0 -24
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_value.hpp +0 -267
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_value_factory.hpp +0 -48
- data/ext/facter/cpp-hocon/lib/inc/hocon/functional_list.hpp +0 -318
- data/ext/facter/cpp-hocon/lib/inc/hocon/parser/config_document.hpp +0 -95
- data/ext/facter/cpp-hocon/lib/inc/hocon/parser/config_document_factory.hpp +0 -39
- data/ext/facter/cpp-hocon/lib/inc/hocon/parser/config_node.hpp +0 -32
- data/ext/facter/cpp-hocon/lib/inc/hocon/path.hpp +0 -60
- data/ext/facter/cpp-hocon/lib/inc/hocon/program_options.hpp +0 -84
- data/ext/facter/cpp-hocon/lib/inc/hocon/types.hpp +0 -63
- data/ext/facter/cpp-hocon/lib/inc/internal/config_document_parser.hpp +0 -83
- data/ext/facter/cpp-hocon/lib/inc/internal/config_parser.hpp +0 -55
- data/ext/facter/cpp-hocon/lib/inc/internal/config_util.hpp +0 -17
- data/ext/facter/cpp-hocon/lib/inc/internal/container.hpp +0 -28
- data/ext/facter/cpp-hocon/lib/inc/internal/default_transformer.hpp +0 -12
- data/ext/facter/cpp-hocon/lib/inc/internal/full_includer.hpp +0 -13
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/abstract_config_node.hpp +0 -16
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/abstract_config_node_value.hpp +0 -12
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_array.hpp +0 -17
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_comment.hpp +0 -14
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_complex_value.hpp +0 -25
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_concatenation.hpp +0 -16
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_field.hpp +0 -29
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_include.hpp +0 -26
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_object.hpp +0 -45
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_path.hpp +0 -25
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_root.hpp +0 -24
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_simple_value.hpp +0 -21
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_single_token.hpp +0 -20
- data/ext/facter/cpp-hocon/lib/inc/internal/parseable.hpp +0 -128
- data/ext/facter/cpp-hocon/lib/inc/internal/path_builder.hpp +0 -20
- data/ext/facter/cpp-hocon/lib/inc/internal/path_parser.hpp +0 -55
- data/ext/facter/cpp-hocon/lib/inc/internal/replaceable_merge_stack.hpp +0 -14
- data/ext/facter/cpp-hocon/lib/inc/internal/resolve_context.hpp +0 -53
- data/ext/facter/cpp-hocon/lib/inc/internal/resolve_result.hpp +0 -21
- data/ext/facter/cpp-hocon/lib/inc/internal/resolve_source.hpp +0 -55
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_config_document.hpp +0 -28
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_config_origin.hpp +0 -67
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_include_context.hpp +0 -22
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_includer.hpp +0 -79
- data/ext/facter/cpp-hocon/lib/inc/internal/substitution_expression.hpp +0 -28
- data/ext/facter/cpp-hocon/lib/inc/internal/token.hpp +0 -45
- data/ext/facter/cpp-hocon/lib/inc/internal/tokenizer.hpp +0 -143
- data/ext/facter/cpp-hocon/lib/inc/internal/tokens.hpp +0 -135
- data/ext/facter/cpp-hocon/lib/inc/internal/unmergeable.hpp +0 -20
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_boolean.hpp +0 -26
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_concatenation.hpp +0 -59
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_delayed_merge.hpp +0 -53
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_delayed_merge_object.hpp +0 -59
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_double.hpp +0 -28
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_int.hpp +0 -25
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_long.hpp +0 -28
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_null.hpp +0 -33
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_number.hpp +0 -38
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_reference.hpp +0 -38
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_string.hpp +0 -32
- data/ext/facter/cpp-hocon/lib/inc/internal/values/simple_config_list.hpp +0 -75
- data/ext/facter/cpp-hocon/lib/inc/internal/values/simple_config_object.hpp +0 -107
- data/ext/facter/cpp-hocon/lib/namespaces.dox.in +0 -6
- data/ext/facter/cpp-hocon/lib/src/config.cc +0 -573
- data/ext/facter/cpp-hocon/lib/src/config_document_factory.cc +0 -24
- data/ext/facter/cpp-hocon/lib/src/config_document_parser.cc +0 -620
- data/ext/facter/cpp-hocon/lib/src/config_parse_options.cc +0 -101
- data/ext/facter/cpp-hocon/lib/src/config_parser.cc +0 -399
- data/ext/facter/cpp-hocon/lib/src/config_render_options.cc +0 -44
- data/ext/facter/cpp-hocon/lib/src/config_resolve_options.cc +0 -24
- data/ext/facter/cpp-hocon/lib/src/config_util.cc +0 -95
- data/ext/facter/cpp-hocon/lib/src/config_value_factory.cc +0 -68
- data/ext/facter/cpp-hocon/lib/src/default_transformer.cc +0 -94
- data/ext/facter/cpp-hocon/lib/src/nodes/abstract_config_node.cc +0 -19
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_array.cc +0 -13
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_comment.cc +0 -15
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_complex_value.cc +0 -50
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_concatenation.cc +0 -14
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_field.cc +0 -80
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_include.cc +0 -38
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_object.cc +0 -318
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_path.cc +0 -47
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_root.cc +0 -70
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_simple_value.cc +0 -50
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_single_token.cc +0 -18
- data/ext/facter/cpp-hocon/lib/src/parseable.cc +0 -328
- data/ext/facter/cpp-hocon/lib/src/path.cc +0 -219
- data/ext/facter/cpp-hocon/lib/src/path_builder.cc +0 -38
- data/ext/facter/cpp-hocon/lib/src/path_parser.cc +0 -253
- data/ext/facter/cpp-hocon/lib/src/resolve_context.cc +0 -139
- data/ext/facter/cpp-hocon/lib/src/resolve_source.cc +0 -216
- data/ext/facter/cpp-hocon/lib/src/simple_config_document.cc +0 -69
- data/ext/facter/cpp-hocon/lib/src/simple_config_origin.cc +0 -246
- data/ext/facter/cpp-hocon/lib/src/simple_include_context.cc +0 -18
- data/ext/facter/cpp-hocon/lib/src/simple_includer.cc +0 -186
- data/ext/facter/cpp-hocon/lib/src/substitution_expression.cc +0 -35
- data/ext/facter/cpp-hocon/lib/src/token.cc +0 -52
- data/ext/facter/cpp-hocon/lib/src/tokenizer.cc +0 -568
- data/ext/facter/cpp-hocon/lib/src/tokens.cc +0 -257
- data/ext/facter/cpp-hocon/lib/src/values/config_boolean.cc +0 -34
- data/ext/facter/cpp-hocon/lib/src/values/config_concatenation.cc +0 -260
- data/ext/facter/cpp-hocon/lib/src/values/config_delayed_merge.cc +0 -223
- data/ext/facter/cpp-hocon/lib/src/values/config_delayed_merge_object.cc +0 -190
- data/ext/facter/cpp-hocon/lib/src/values/config_double.cc +0 -35
- data/ext/facter/cpp-hocon/lib/src/values/config_int.cc +0 -35
- data/ext/facter/cpp-hocon/lib/src/values/config_long.cc +0 -35
- data/ext/facter/cpp-hocon/lib/src/values/config_null.cc +0 -35
- data/ext/facter/cpp-hocon/lib/src/values/config_number.cc +0 -78
- data/ext/facter/cpp-hocon/lib/src/values/config_object.cc +0 -97
- data/ext/facter/cpp-hocon/lib/src/values/config_reference.cc +0 -85
- data/ext/facter/cpp-hocon/lib/src/values/config_string.cc +0 -47
- data/ext/facter/cpp-hocon/lib/src/values/config_value.cc +0 -289
- data/ext/facter/cpp-hocon/lib/src/values/simple_config_list.cc +0 -219
- data/ext/facter/cpp-hocon/lib/src/values/simple_config_object.cc +0 -515
- data/ext/facter/cpp-hocon/lib/tests/CMakeLists.txt +0 -42
- data/ext/facter/cpp-hocon/lib/tests/concatenation_test.cc +0 -401
- data/ext/facter/cpp-hocon/lib/tests/conf_parser_test.cc +0 -720
- data/ext/facter/cpp-hocon/lib/tests/config_document_parser_test.cc +0 -208
- data/ext/facter/cpp-hocon/lib/tests/config_document_tests.cc +0 -110
- data/ext/facter/cpp-hocon/lib/tests/config_node_test.cc +0 -338
- data/ext/facter/cpp-hocon/lib/tests/config_substitution_test.cc +0 -893
- data/ext/facter/cpp-hocon/lib/tests/config_test.cc +0 -151
- data/ext/facter/cpp-hocon/lib/tests/config_value_factory_test.cc +0 -60
- data/ext/facter/cpp-hocon/lib/tests/config_value_test.cc +0 -111
- data/ext/facter/cpp-hocon/lib/tests/fixtures.hpp.in +0 -3
- data/ext/facter/cpp-hocon/lib/tests/fixtures/test01.conf +0 -91
- data/ext/facter/cpp-hocon/lib/tests/fixtures/test01.json +0 -4
- data/ext/facter/cpp-hocon/lib/tests/main.cc +0 -8
- data/ext/facter/cpp-hocon/lib/tests/path_test.cc +0 -129
- data/ext/facter/cpp-hocon/lib/tests/program_options.cc +0 -63
- data/ext/facter/cpp-hocon/lib/tests/test.conf +0 -1
- data/ext/facter/cpp-hocon/lib/tests/test_utils.cc +0 -452
- data/ext/facter/cpp-hocon/lib/tests/test_utils.hpp +0 -140
- data/ext/facter/cpp-hocon/lib/tests/token_test.cc +0 -108
- data/ext/facter/cpp-hocon/lib/tests/tokenizer_test.cc +0 -694
- data/ext/facter/cpp-hocon/lib/version.h.in +0 -28
- data/ext/facter/cpp-hocon/locales/CMakeLists.txt +0 -4
- data/ext/facter/cpp-hocon/locales/cpp-hocon.pot +0 -767
- data/ext/facter/extconf.rb +0 -22
- data/ext/facter/facter/CMakeLists.txt +0 -183
- data/ext/facter/facter/CONTRIBUTING.md +0 -99
- data/ext/facter/facter/Extensibility.md +0 -133
- data/ext/facter/facter/Gemfile +0 -13
- data/ext/facter/facter/LICENSE +0 -17
- data/ext/facter/facter/MAINTAINERS +0 -28
- data/ext/facter/facter/README.md +0 -295
- data/ext/facter/facter/Rakefile +0 -17
- data/ext/facter/facter/acceptance/Gemfile +0 -24
- data/ext/facter/facter/acceptance/Rakefile +0 -2
- data/ext/facter/facter/acceptance/bin/ci-bootstrap-from-artifacts.sh +0 -55
- data/ext/facter/facter/acceptance/config/aio/options.rb +0 -3
- data/ext/facter/facter/acceptance/config/git/options.rb +0 -3
- data/ext/facter/facter/acceptance/config/nodes/aix-53-power.yaml +0 -7
- data/ext/facter/facter/acceptance/config/nodes/aix-61-power.yaml +0 -7
- data/ext/facter/facter/acceptance/config/nodes/aix-71-power.yaml +0 -7
- data/ext/facter/facter/acceptance/config/nodes/huaweios-6-powerpc.yaml +0 -7
- data/ext/facter/facter/acceptance/config/nodes/solaris-10-sparc.yaml +0 -9
- data/ext/facter/facter/acceptance/config/nodes/solaris-11-sparc.yaml +0 -9
- data/ext/facter/facter/acceptance/lib/facter/acceptance/base_fact_utils.rb +0 -565
- data/ext/facter/facter/acceptance/lib/facter/acceptance/user_fact_utils.rb +0 -132
- data/ext/facter/facter/acceptance/lib/helper.rb +0 -3
- data/ext/facter/facter/acceptance/lib/puppet/acceptance/common_utils.rb +0 -10
- data/ext/facter/facter/acceptance/lib/puppet/acceptance/git_utils.rb +0 -19
- data/ext/facter/facter/acceptance/lib/puppet/acceptance/install_utils.rb +0 -58
- data/ext/facter/facter/acceptance/tests/custom_facts/conflicts_with_builtin_fact.rb +0 -106
- data/ext/facter/facter/acceptance/tests/custom_facts/custom_fact_with_10001_weight_overrides_external_fact.rb +0 -30
- data/ext/facter/facter/acceptance/tests/custom_facts/having_multiple_facts_in_one_file.rb +0 -40
- data/ext/facter/facter/acceptance/tests/custom_facts/using_win32ole_should_not_hang.rb +0 -33
- data/ext/facter/facter/acceptance/tests/external_facts/env_var_overrides_external_fact.rb +0 -46
- data/ext/facter/facter/acceptance/tests/external_facts/external_dir_overrides_default_external_fact.rb +0 -34
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_overrides_custom_fact.rb +0 -29
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_10000_weight_or_less.rb +0 -30
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_confine.rb +0 -35
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_stderr_messages_output_to_stderr.rb +0 -49
- data/ext/facter/facter/acceptance/tests/external_facts/external_facts_only_run_once.rb +0 -43
- data/ext/facter/facter/acceptance/tests/external_facts/fact_directory_precedence.rb +0 -109
- data/ext/facter/facter/acceptance/tests/external_facts/non_root_users_default_external_fact_directory.rb +0 -142
- data/ext/facter/facter/acceptance/tests/external_facts/root_uses_default_external_fact_dir.rb +0 -34
- data/ext/facter/facter/acceptance/tests/external_facts/structured_executable_facts.rb +0 -139
- data/ext/facter/facter/acceptance/tests/facter_returns_success_on_non_existent_fact.rb +0 -9
- data/ext/facter/facter/acceptance/tests/facts/dmi.rb +0 -51
- data/ext/facter/facter/acceptance/tests/facts/facterversion.rb +0 -11
- data/ext/facter/facter/acceptance/tests/facts/identity.rb +0 -52
- data/ext/facter/facter/acceptance/tests/facts/networking_facts.rb +0 -76
- data/ext/facter/facter/acceptance/tests/facts/non_root_users_without_errors.rb +0 -32
- data/ext/facter/facter/acceptance/tests/facts/operatingsystem_detection_after_clear_on_ubuntu.rb +0 -26
- data/ext/facter/facter/acceptance/tests/facts/os_processors_and_kernel.rb +0 -20
- data/ext/facter/facter/acceptance/tests/facts/partitions.rb +0 -37
- data/ext/facter/facter/acceptance/tests/facts/productname.rb +0 -15
- data/ext/facter/facter/acceptance/tests/facts/ruby.rb +0 -59
- data/ext/facter/facter/acceptance/tests/facts/validate_file_system_size_bytes.rb +0 -37
- data/ext/facter/facter/acceptance/tests/facts/verify_tmpfs_file_system.rb +0 -54
- data/ext/facter/facter/acceptance/tests/load_libfacter.rb +0 -66
- data/ext/facter/facter/acceptance/tests/no_errors_on_stderr.rb +0 -10
- data/ext/facter/facter/acceptance/tests/options/color.rb +0 -16
- data/ext/facter/facter/acceptance/tests/options/config.rb +0 -27
- data/ext/facter/facter/acceptance/tests/options/config_file/blocklist.rb +0 -35
- data/ext/facter/facter/acceptance/tests/options/config_file/blocklist_from_puppet_facts.rb +0 -40
- data/ext/facter/facter/acceptance/tests/options/config_file/custom_dir_overridden_by_cli_custom_dir.rb +0 -56
- data/ext/facter/facter/acceptance/tests/options/config_file/custom_facts.rb +0 -42
- data/ext/facter/facter/acceptance/tests/options/config_file/custom_facts_list.rb +0 -56
- data/ext/facter/facter/acceptance/tests/options/config_file/debug.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/config_file/default_file_location.rb +0 -37
- data/ext/facter/facter/acceptance/tests/options/config_file/external_dir_conflicts_with_cli_no_external_facts.rb +0 -37
- data/ext/facter/facter/acceptance/tests/options/config_file/external_dir_overridden_by_cli_external_dir.rb +0 -40
- data/ext/facter/facter/acceptance/tests/options/config_file/external_facts.rb +0 -37
- data/ext/facter/facter/acceptance/tests/options/config_file/external_facts_list.rb +0 -43
- data/ext/facter/facter/acceptance/tests/options/config_file/load_from_ruby.rb +0 -73
- data/ext/facter/facter/acceptance/tests/options/config_file/log_level.rb +0 -35
- data/ext/facter/facter/acceptance/tests/options/config_file/no_custom_facts_and_custom_dir.rb +0 -43
- data/ext/facter/facter/acceptance/tests/options/config_file/no_custom_facts_and_facterlib.rb +0 -43
- data/ext/facter/facter/acceptance/tests/options/config_file/no_custom_facts_and_load_path.rb +0 -49
- data/ext/facter/facter/acceptance/tests/options/config_file/no_external_facts.rb +0 -38
- data/ext/facter/facter/acceptance/tests/options/config_file/no_external_facts_and_external_dir.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_custom_facts.rb +0 -52
- data/ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/config_file/trace.rb +0 -48
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_clear_by_empty_ttls_cache_list.rb +0 -71
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_creates_json_cache_file.rb +0 -48
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_do_not_read_the_old_cached_value.rb +0 -58
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_refresh_the_cached_value.rb +0 -61
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_read_from_the_cached_value.rb +0 -57
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_that_are_corrupt_are_refreshed.rb +0 -53
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_that_are_empty_return_an_empty_value.rb +0 -53
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_puppet_facts_creates_json_for_cached_facts.rb +0 -45
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_puppet_facts_honors_cached_facts.rb +0 -54
- data/ext/facter/facter/acceptance/tests/options/config_file/verbose.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/custom_facts.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/custom_facts_facterlib.rb +0 -33
- data/ext/facter/facter/acceptance/tests/options/custom_facts_list.rb +0 -48
- data/ext/facter/facter/acceptance/tests/options/custom_facts_load_path.rb +0 -42
- data/ext/facter/facter/acceptance/tests/options/debug.rb +0 -12
- data/ext/facter/facter/acceptance/tests/options/external_facts.rb +0 -28
- data/ext/facter/facter/acceptance/tests/options/external_facts_list.rb +0 -35
- data/ext/facter/facter/acceptance/tests/options/help.rb +0 -13
- data/ext/facter/facter/acceptance/tests/options/json.rb +0 -43
- data/ext/facter/facter/acceptance/tests/options/list_block_groups.rb +0 -16
- data/ext/facter/facter/acceptance/tests/options/list_cache_groups.rb +0 -16
- data/ext/facter/facter/acceptance/tests/options/log_level.rb +0 -13
- data/ext/facter/facter/acceptance/tests/options/no_block.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/no_cache_should_not_cache_facts.rb +0 -43
- data/ext/facter/facter/acceptance/tests/options/no_cache_should_not_load_cached_facts.rb +0 -58
- data/ext/facter/facter/acceptance/tests/options/no_cache_should_not_refresh_cached_facts.rb +0 -63
- data/ext/facter/facter/acceptance/tests/options/no_color.rb +0 -16
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts_and_custom_dir.rb +0 -19
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts_and_facterlib.rb +0 -34
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts_and_load_path.rb +0 -43
- data/ext/facter/facter/acceptance/tests/options/no_external_facts.rb +0 -28
- data/ext/facter/facter/acceptance/tests/options/no_external_facts_and_external_dir.rb +0 -19
- data/ext/facter/facter/acceptance/tests/options/no_ruby.rb +0 -44
- data/ext/facter/facter/acceptance/tests/options/puppet_facts.rb +0 -35
- data/ext/facter/facter/acceptance/tests/options/show_legacy.rb +0 -18
- data/ext/facter/facter/acceptance/tests/options/strict.rb +0 -11
- data/ext/facter/facter/acceptance/tests/options/trace.rb +0 -36
- data/ext/facter/facter/acceptance/tests/options/verbose.rb +0 -12
- data/ext/facter/facter/acceptance/tests/options/version.rb +0 -12
- data/ext/facter/facter/acceptance/tests/options/yaml.rb +0 -43
- data/ext/facter/facter/acceptance/tests/ticket_1123_facter_with_invalid_locale.rb +0 -22
- data/ext/facter/facter/acceptance/tests/ticket_1238_hostname_fqdn.rb +0 -57
- data/ext/facter/facter/appveyor.yml +0 -40
- data/ext/facter/facter/cmake/FindBLKID.cmake +0 -6
- data/ext/facter/facter/cmake/FindCPPHOCON.cmake +0 -6
- data/ext/facter/facter/cmake/FindDependency.cmake +0 -54
- data/ext/facter/facter/cmake/FindOPENSSL.cmake +0 -10
- data/ext/facter/facter/cmake/FindRuby.cmake +0 -286
- data/ext/facter/facter/cmake/FindWHEREAMI.cmake +0 -6
- data/ext/facter/facter/cmake/FindYAMLCPP.cmake +0 -17
- data/ext/facter/facter/contrib/dockerfiles/travis-cpp-builder/Dockerfile +0 -56
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-builder/Dockerfile +0 -23
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-coverity/Dockerfile +0 -40
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-coverity/_coverity-submit.erb +0 -12
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-coverity/fix_curl_command.patch +0 -32
- data/ext/facter/facter/exe/CMakeLists.txt +0 -39
- data/ext/facter/facter/exe/facter.cc +0 -378
- data/ext/facter/facter/ext/build_defaults.yaml +0 -14
- data/ext/facter/facter/ext/debian/changelog.erb +0 -11
- data/ext/facter/facter/ext/debian/compat +0 -1
- data/ext/facter/facter/ext/debian/control +0 -14
- data/ext/facter/facter/ext/debian/copyright +0 -19
- data/ext/facter/facter/ext/debian/docs +0 -2
- data/ext/facter/facter/ext/debian/facter.install +0 -4
- data/ext/facter/facter/ext/debian/lintian-overrides +0 -0
- data/ext/facter/facter/ext/debian/rules +0 -39
- data/ext/facter/facter/ext/debian/source/format +0 -1
- data/ext/facter/facter/ext/project_data.yaml +0 -30
- data/ext/facter/facter/ext/redhat/facter.spec.erb +0 -113
- data/ext/facter/facter/ext/windows/facter.bat +0 -8
- data/ext/facter/facter/ext/windows/facter_interactive.bat +0 -6
- data/ext/facter/facter/ext/windows/run_facter_interactive.bat +0 -9
- data/ext/facter/facter/factergo/example/main.go +0 -17
- data/ext/facter/facter/factergo/facter.go +0 -42
- data/ext/facter/facter/factergo/facter_test.go +0 -25
- data/ext/facter/facter/lib/CMakeLists.txt +0 -427
- data/ext/facter/facter/lib/Doxyfile +0 -2313
- data/ext/facter/facter/lib/Facter.java.in +0 -110
- data/ext/facter/facter/lib/Gemfile +0 -11
- data/ext/facter/facter/lib/Rakefile +0 -8
- data/ext/facter/facter/lib/docs/generate.rb +0 -25
- data/ext/facter/facter/lib/docs/namespaces.dox +0 -129
- data/ext/facter/facter/lib/docs/template.erb +0 -43
- data/ext/facter/facter/lib/facter.rb.in +0 -45
- data/ext/facter/facter/lib/gemspec.in +0 -21
- data/ext/facter/facter/lib/inc/facter/cwrapper.hpp +0 -18
- data/ext/facter/facter/lib/inc/facter/facts/array_value.hpp +0 -125
- data/ext/facter/facter/lib/inc/facter/facts/collection.hpp +0 -339
- data/ext/facter/facter/lib/inc/facter/facts/external/resolver.hpp +0 -49
- data/ext/facter/facter/lib/inc/facter/facts/fact.hpp +0 -669
- data/ext/facter/facter/lib/inc/facter/facts/map_value.hpp +0 -127
- data/ext/facter/facter/lib/inc/facter/facts/os.hpp +0 -210
- data/ext/facter/facter/lib/inc/facter/facts/os_family.hpp +0 -58
- data/ext/facter/facter/lib/inc/facter/facts/resolver.hpp +0 -126
- data/ext/facter/facter/lib/inc/facter/facts/scalar_value.hpp +0 -152
- data/ext/facter/facter/lib/inc/facter/facts/value.hpp +0 -164
- data/ext/facter/facter/lib/inc/facter/facts/vm.hpp +0 -157
- data/ext/facter/facter/lib/inc/facter/logging/logging.hpp +0 -192
- data/ext/facter/facter/lib/inc/facter/ruby/ruby.hpp +0 -73
- data/ext/facter/facter/lib/inc/facter/util/config.hpp +0 -84
- data/ext/facter/facter/lib/inc/facter/util/string.hpp +0 -72
- data/ext/facter/facter/lib/inc/internal/facts/aix/disk_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/aix/filesystem_resolver.hpp +0 -41
- data/ext/facter/facter/lib/inc/internal/facts/aix/kernel_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/aix/load_average_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/aix/memory_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/aix/networking_resolver.hpp +0 -56
- data/ext/facter/facter/lib/inc/internal/facts/aix/operating_system_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/aix/processor_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/aix/serial_number_resolver.hpp +0 -27
- data/ext/facter/facter/lib/inc/internal/facts/bsd/filesystem_resolver.hpp +0 -30
- data/ext/facter/facter/lib/inc/internal/facts/bsd/networking_resolver.hpp +0 -61
- data/ext/facter/facter/lib/inc/internal/facts/bsd/uptime_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/cache.hpp +0 -71
- data/ext/facter/facter/lib/inc/internal/facts/external/execution_resolver.hpp +0 -31
- data/ext/facter/facter/lib/inc/internal/facts/external/json_resolver.hpp +0 -31
- data/ext/facter/facter/lib/inc/internal/facts/external/text_resolver.hpp +0 -31
- data/ext/facter/facter/lib/inc/internal/facts/external/windows/powershell_resolver.hpp +0 -34
- data/ext/facter/facter/lib/inc/internal/facts/external/yaml_resolver.hpp +0 -31
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/disk_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/dmi_resolver.hpp +0 -28
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/filesystem_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/memory_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp +0 -49
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/operating_system_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/processor_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/virtualization_resolver.hpp +0 -27
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/zfs_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/zpool_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/glib/load_average_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/linux/disk_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/linux/dmi_resolver.hpp +0 -37
- data/ext/facter/facter/lib/inc/internal/facts/linux/filesystem_resolver.hpp +0 -40
- data/ext/facter/facter/lib/inc/internal/facts/linux/fips_resolver.hpp +0 -31
- data/ext/facter/facter/lib/inc/internal/facts/linux/kernel_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/linux/memory_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/linux/networking_resolver.hpp +0 -85
- data/ext/facter/facter/lib/inc/internal/facts/linux/operating_system_resolver.hpp +0 -28
- data/ext/facter/facter/lib/inc/internal/facts/linux/os_cisco.hpp +0 -114
- data/ext/facter/facter/lib/inc/internal/facts/linux/os_linux.hpp +0 -72
- data/ext/facter/facter/lib/inc/internal/facts/linux/os_osrelease.hpp +0 -98
- data/ext/facter/facter/lib/inc/internal/facts/linux/processor_resolver.hpp +0 -60
- data/ext/facter/facter/lib/inc/internal/facts/linux/release_file.hpp +0 -124
- data/ext/facter/facter/lib/inc/internal/facts/linux/uptime_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp +0 -50
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/dmi_resolver.hpp +0 -28
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/memory_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/networking_resolver.hpp +0 -49
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/processor_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/virtualization_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/osx/dmi_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/osx/memory_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/osx/networking_resolver.hpp +0 -67
- data/ext/facter/facter/lib/inc/internal/facts/osx/operating_system_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/osx/processor_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/osx/system_profiler_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/osx/virtualization_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/posix/identity_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/posix/kernel_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/posix/networking_resolver.hpp +0 -55
- data/ext/facter/facter/lib/inc/internal/facts/posix/operating_system_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/posix/processor_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/posix/ssh_resolver.hpp +0 -28
- data/ext/facter/facter/lib/inc/internal/facts/posix/timezone_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/posix/uptime_resolver.hpp +0 -32
- data/ext/facter/facter/lib/inc/internal/facts/posix/xen_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/augeas_resolver.hpp +0 -35
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/disk_resolver.hpp +0 -81
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/dmi_resolver.hpp +0 -115
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ec2_resolver.hpp +0 -30
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/filesystem_resolver.hpp +0 -166
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/fips_resolver.hpp +0 -46
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/gce_resolver.hpp +0 -28
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/hypervisors_resolver.hpp +0 -69
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/identity_resolver.hpp +0 -73
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp +0 -66
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ldom_resolver.hpp +0 -64
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/load_average_resolver.hpp +0 -37
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/memory_resolver.hpp +0 -99
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/networking_resolver.hpp +0 -156
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/operating_system_resolver.hpp +0 -235
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/path_resolver.hpp +0 -28
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/processor_resolver.hpp +0 -80
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ruby_resolver.hpp +0 -56
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ssh_resolver.hpp +0 -105
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/system_profiler_resolver.hpp +0 -127
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/timezone_resolver.hpp +0 -36
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/uptime_resolver.hpp +0 -36
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/virtualization_resolver.hpp +0 -95
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/xen_resolver.hpp +0 -55
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/zfs_resolver.hpp +0 -59
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/zone_resolver.hpp +0 -95
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/zpool_resolver.hpp +0 -63
- data/ext/facter/facter/lib/inc/internal/facts/solaris/disk_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/dmi_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/filesystem_resolver.hpp +0 -29
- data/ext/facter/facter/lib/inc/internal/facts/solaris/kernel_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/ldom_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/memory_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/networking_resolver.hpp +0 -55
- data/ext/facter/facter/lib/inc/internal/facts/solaris/operating_system_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/processor_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/virtualization_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/zfs_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/solaris/zone_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/solaris/zpool_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/windows/dmi_resolver.hpp +0 -38
- data/ext/facter/facter/lib/inc/internal/facts/windows/identity_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/windows/kernel_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/windows/memory_resolver.hpp +0 -25
- data/ext/facter/facter/lib/inc/internal/facts/windows/networking_resolver.hpp +0 -74
- data/ext/facter/facter/lib/inc/internal/facts/windows/operating_system_resolver.hpp +0 -36
- data/ext/facter/facter/lib/inc/internal/facts/windows/processor_resolver.hpp +0 -36
- data/ext/facter/facter/lib/inc/internal/facts/windows/timezone_resolver.hpp +0 -24
- data/ext/facter/facter/lib/inc/internal/facts/windows/uptime_resolver.hpp +0 -32
- data/ext/facter/facter/lib/inc/internal/facts/windows/virtualization_resolver.hpp +0 -37
- data/ext/facter/facter/lib/inc/internal/ruby/aggregate_resolution.hpp +0 -77
- data/ext/facter/facter/lib/inc/internal/ruby/chunk.hpp +0 -83
- data/ext/facter/facter/lib/inc/internal/ruby/confine.hpp +0 -60
- data/ext/facter/facter/lib/inc/internal/ruby/fact.hpp +0 -108
- data/ext/facter/facter/lib/inc/internal/ruby/module.hpp +0 -165
- data/ext/facter/facter/lib/inc/internal/ruby/resolution.hpp +0 -126
- data/ext/facter/facter/lib/inc/internal/ruby/ruby_value.hpp +0 -119
- data/ext/facter/facter/lib/inc/internal/ruby/simple_resolution.hpp +0 -56
- data/ext/facter/facter/lib/inc/internal/util/agent.hpp +0 -29
- data/ext/facter/facter/lib/inc/internal/util/aix/odm.hpp +0 -392
- data/ext/facter/facter/lib/inc/internal/util/aix/vmount.hpp +0 -139
- data/ext/facter/facter/lib/inc/internal/util/bsd/scoped_ifaddrs.hpp +0 -33
- data/ext/facter/facter/lib/inc/internal/util/freebsd/geom.hpp +0 -149
- data/ext/facter/facter/lib/inc/internal/util/posix/scoped_addrinfo.hpp +0 -45
- data/ext/facter/facter/lib/inc/internal/util/posix/scoped_bio.hpp +0 -34
- data/ext/facter/facter/lib/inc/internal/util/posix/scoped_descriptor.hpp +0 -27
- data/ext/facter/facter/lib/inc/internal/util/posix/utmpx_file.hpp +0 -57
- data/ext/facter/facter/lib/inc/internal/util/scoped_file.hpp +0 -36
- data/ext/facter/facter/lib/inc/internal/util/solaris/k_stat.hpp +0 -176
- data/ext/facter/facter/lib/inc/internal/util/solaris/scoped_kstat.hpp +0 -45
- data/ext/facter/facter/lib/inc/internal/util/versions.hpp +0 -34
- data/ext/facter/facter/lib/inc/internal/util/windows/wsa.hpp +0 -92
- data/ext/facter/facter/lib/inc/internal/util/yaml.hpp +0 -25
- data/ext/facter/facter/lib/schema/core_facts.pot +0 -2017
- data/ext/facter/facter/lib/schema/facter.yaml +0 -1947
- data/ext/facter/facter/lib/schema/translation_tooling.rb +0 -67
- data/ext/facter/facter/lib/spec/unit/facter_spec.rb +0 -136
- data/ext/facter/facter/lib/spec_helper.rb.in +0 -27
- data/ext/facter/facter/lib/src/cwrapper.cc +0 -45
- data/ext/facter/facter/lib/src/facts/aix/collection.cc +0 -34
- data/ext/facter/facter/lib/src/facts/aix/disk_resolver.cc +0 -75
- data/ext/facter/facter/lib/src/facts/aix/filesystem_resolver.cc +0 -132
- data/ext/facter/facter/lib/src/facts/aix/kernel_resolver.cc +0 -27
- data/ext/facter/facter/lib/src/facts/aix/load_average_resolver.cc +0 -50
- data/ext/facter/facter/lib/src/facts/aix/memory_resolver.cc +0 -63
- data/ext/facter/facter/lib/src/facts/aix/networking_resolver.cc +0 -250
- data/ext/facter/facter/lib/src/facts/aix/operating_system_resolver.cc +0 -99
- data/ext/facter/facter/lib/src/facts/aix/processor_resolver.cc +0 -106
- data/ext/facter/facter/lib/src/facts/aix/serial_number_resolver.cc +0 -43
- data/ext/facter/facter/lib/src/facts/array_value.cc +0 -111
- data/ext/facter/facter/lib/src/facts/bsd/collection.cc +0 -27
- data/ext/facter/facter/lib/src/facts/bsd/filesystem_resolver.cc +0 -92
- data/ext/facter/facter/lib/src/facts/bsd/networking_resolver.cc +0 -231
- data/ext/facter/facter/lib/src/facts/bsd/uptime_resolver.cc +0 -23
- data/ext/facter/facter/lib/src/facts/cache.cc +0 -117
- data/ext/facter/facter/lib/src/facts/collection.cc +0 -663
- data/ext/facter/facter/lib/src/facts/external/execution_resolver.cc +0 -89
- data/ext/facter/facter/lib/src/facts/external/json_resolver.cc +0 -219
- data/ext/facter/facter/lib/src/facts/external/resolver.cc +0 -12
- data/ext/facter/facter/lib/src/facts/external/text_resolver.cc +0 -45
- data/ext/facter/facter/lib/src/facts/external/windows/powershell_resolver.cc +0 -117
- data/ext/facter/facter/lib/src/facts/external/yaml_resolver.cc +0 -45
- data/ext/facter/facter/lib/src/facts/freebsd/collection.cc +0 -43
- data/ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc +0 -34
- data/ext/facter/facter/lib/src/facts/freebsd/dmi_resolver.cc +0 -43
- data/ext/facter/facter/lib/src/facts/freebsd/filesystem_resolver.cc +0 -37
- data/ext/facter/facter/lib/src/facts/freebsd/memory_resolver.cc +0 -76
- data/ext/facter/facter/lib/src/facts/freebsd/networking_resolver.cc +0 -64
- data/ext/facter/facter/lib/src/facts/freebsd/operating_system_resolver.cc +0 -17
- data/ext/facter/facter/lib/src/facts/freebsd/processor_resolver.cc +0 -63
- data/ext/facter/facter/lib/src/facts/freebsd/virtualization_resolver.cc +0 -41
- data/ext/facter/facter/lib/src/facts/freebsd/zfs_resolver.cc +0 -12
- data/ext/facter/facter/lib/src/facts/freebsd/zpool_resolver.cc +0 -12
- data/ext/facter/facter/lib/src/facts/glib/load_average_resolver.cc +0 -22
- data/ext/facter/facter/lib/src/facts/linux/collection.cc +0 -44
- data/ext/facter/facter/lib/src/facts/linux/disk_resolver.cc +0 -80
- data/ext/facter/facter/lib/src/facts/linux/dmi_resolver.cc +0 -208
- data/ext/facter/facter/lib/src/facts/linux/filesystem_resolver.cc +0 -282
- data/ext/facter/facter/lib/src/facts/linux/fips_resolver.cc +0 -31
- data/ext/facter/facter/lib/src/facts/linux/kernel_resolver.cc +0 -20
- data/ext/facter/facter/lib/src/facts/linux/memory_resolver.cc +0 -50
- data/ext/facter/facter/lib/src/facts/linux/networking_resolver.cc +0 -296
- data/ext/facter/facter/lib/src/facts/linux/operating_system_resolver.cc +0 -174
- data/ext/facter/facter/lib/src/facts/linux/os_linux.cc +0 -399
- data/ext/facter/facter/lib/src/facts/linux/processor_resolver.cc +0 -200
- data/ext/facter/facter/lib/src/facts/linux/uptime_resolver.cc +0 -15
- data/ext/facter/facter/lib/src/facts/linux/virtualization_resolver.cc +0 -282
- data/ext/facter/facter/lib/src/facts/map_value.cc +0 -119
- data/ext/facter/facter/lib/src/facts/openbsd/collection.cc +0 -37
- data/ext/facter/facter/lib/src/facts/openbsd/dmi_resolver.cc +0 -47
- data/ext/facter/facter/lib/src/facts/openbsd/memory_resolver.cc +0 -76
- data/ext/facter/facter/lib/src/facts/openbsd/networking_resolver.cc +0 -64
- data/ext/facter/facter/lib/src/facts/openbsd/processor_resolver.cc +0 -59
- data/ext/facter/facter/lib/src/facts/openbsd/virtualization_resolver.cc +0 -20
- data/ext/facter/facter/lib/src/facts/osx/collection.cc +0 -39
- data/ext/facter/facter/lib/src/facts/osx/dmi_resolver.cc +0 -32
- data/ext/facter/facter/lib/src/facts/osx/memory_resolver.cc +0 -60
- data/ext/facter/facter/lib/src/facts/osx/networking_resolver.cc +0 -80
- data/ext/facter/facter/lib/src/facts/osx/operating_system_resolver.cc +0 -49
- data/ext/facter/facter/lib/src/facts/osx/processor_resolver.cc +0 -55
- data/ext/facter/facter/lib/src/facts/osx/system_profiler_resolver.cc +0 -66
- data/ext/facter/facter/lib/src/facts/osx/virtualization_resolver.cc +0 -46
- data/ext/facter/facter/lib/src/facts/posix/cache.cc +0 -9
- data/ext/facter/facter/lib/src/facts/posix/collection.cc +0 -48
- data/ext/facter/facter/lib/src/facts/posix/identity_resolver.cc +0 -79
- data/ext/facter/facter/lib/src/facts/posix/kernel_resolver.cc +0 -25
- data/ext/facter/facter/lib/src/facts/posix/networking_resolver.cc +0 -137
- data/ext/facter/facter/lib/src/facts/posix/operatingsystem_resolver.cc +0 -29
- data/ext/facter/facter/lib/src/facts/posix/processor_resolver.cc +0 -22
- data/ext/facter/facter/lib/src/facts/posix/ssh_resolver.cc +0 -116
- data/ext/facter/facter/lib/src/facts/posix/timezone_resolver.cc +0 -26
- data/ext/facter/facter/lib/src/facts/posix/uptime_resolver.cc +0 -72
- data/ext/facter/facter/lib/src/facts/posix/xen_resolver.cc +0 -43
- data/ext/facter/facter/lib/src/facts/resolver.cc +0 -105
- data/ext/facter/facter/lib/src/facts/resolvers/augeas_resolver.cc +0 -56
- data/ext/facter/facter/lib/src/facts/resolvers/disk_resolver.cc +0 -69
- data/ext/facter/facter/lib/src/facts/resolvers/dmi_resolver.cc +0 -160
- data/ext/facter/facter/lib/src/facts/resolvers/ec2_resolver.cc +0 -174
- data/ext/facter/facter/lib/src/facts/resolvers/filesystem_resolver.cc +0 -118
- data/ext/facter/facter/lib/src/facts/resolvers/fips_resolver.cc +0 -23
- data/ext/facter/facter/lib/src/facts/resolvers/gce_resolver.cc +0 -276
- data/ext/facter/facter/lib/src/facts/resolvers/hypervisors_resolver.cc +0 -76
- data/ext/facter/facter/lib/src/facts/resolvers/identity_resolver.cc +0 -50
- data/ext/facter/facter/lib/src/facts/resolvers/kernel_resolver.cc +0 -62
- data/ext/facter/facter/lib/src/facts/resolvers/ldom_resolver.cc +0 -60
- data/ext/facter/facter/lib/src/facts/resolvers/load_average_resolver.cc +0 -36
- data/ext/facter/facter/lib/src/facts/resolvers/memory_resolver.cc +0 -88
- data/ext/facter/facter/lib/src/facts/resolvers/networking_resolver.cc +0 -296
- data/ext/facter/facter/lib/src/facts/resolvers/operating_system_resolver.cc +0 -276
- data/ext/facter/facter/lib/src/facts/resolvers/path_resolver.cc +0 -25
- data/ext/facter/facter/lib/src/facts/resolvers/processor_resolver.cc +0 -70
- data/ext/facter/facter/lib/src/facts/resolvers/ruby_resolver.cc +0 -109
- data/ext/facter/facter/lib/src/facts/resolvers/ssh_resolver.cc +0 -77
- data/ext/facter/facter/lib/src/facts/resolvers/system_profiler_resolver.cc +0 -137
- data/ext/facter/facter/lib/src/facts/resolvers/timezone_resolver.cc +0 -27
- data/ext/facter/facter/lib/src/facts/resolvers/uptime_resolver.cc +0 -63
- data/ext/facter/facter/lib/src/facts/resolvers/virtualization_resolver.cc +0 -119
- data/ext/facter/facter/lib/src/facts/resolvers/xen_resolver.cc +0 -80
- data/ext/facter/facter/lib/src/facts/resolvers/zfs_resolver.cc +0 -63
- data/ext/facter/facter/lib/src/facts/resolvers/zone_resolver.cc +0 -91
- data/ext/facter/facter/lib/src/facts/resolvers/zpool_resolver.cc +0 -93
- data/ext/facter/facter/lib/src/facts/scalar_value.cc +0 -73
- data/ext/facter/facter/lib/src/facts/solaris/collection.cc +0 -51
- data/ext/facter/facter/lib/src/facts/solaris/disk_resolver.cc +0 -35
- data/ext/facter/facter/lib/src/facts/solaris/dmi_resolver.cc +0 -86
- data/ext/facter/facter/lib/src/facts/solaris/filesystem_resolver.cc +0 -92
- data/ext/facter/facter/lib/src/facts/solaris/kernel_resolver.cc +0 -24
- data/ext/facter/facter/lib/src/facts/solaris/ldom_resolver.cc +0 -87
- data/ext/facter/facter/lib/src/facts/solaris/memory_resolver.cc +0 -91
- data/ext/facter/facter/lib/src/facts/solaris/networking_resolver.cc +0 -188
- data/ext/facter/facter/lib/src/facts/solaris/operating_system_resolver.cc +0 -83
- data/ext/facter/facter/lib/src/facts/solaris/processor_resolver.cc +0 -105
- data/ext/facter/facter/lib/src/facts/solaris/virtualization_resolver.cc +0 -38
- data/ext/facter/facter/lib/src/facts/solaris/zfs_resolver.cc +0 -12
- data/ext/facter/facter/lib/src/facts/solaris/zone_resolver.cc +0 -33
- data/ext/facter/facter/lib/src/facts/solaris/zpool_resolver.cc +0 -12
- data/ext/facter/facter/lib/src/facts/windows/cache.cc +0 -11
- data/ext/facter/facter/lib/src/facts/windows/collection.cc +0 -91
- data/ext/facter/facter/lib/src/facts/windows/dmi_resolver.cc +0 -39
- data/ext/facter/facter/lib/src/facts/windows/identity_resolver.cc +0 -46
- data/ext/facter/facter/lib/src/facts/windows/kernel_resolver.cc +0 -58
- data/ext/facter/facter/lib/src/facts/windows/memory_resolver.cc +0 -25
- data/ext/facter/facter/lib/src/facts/windows/networking_resolver.cc +0 -227
- data/ext/facter/facter/lib/src/facts/windows/operating_system_resolver.cc +0 -147
- data/ext/facter/facter/lib/src/facts/windows/processor_resolver.cc +0 -99
- data/ext/facter/facter/lib/src/facts/windows/timezone_resolver.cc +0 -28
- data/ext/facter/facter/lib/src/facts/windows/uptime_resolver.cc +0 -26
- data/ext/facter/facter/lib/src/facts/windows/virtualization_resolver.cc +0 -63
- data/ext/facter/facter/lib/src/java/facter.cc +0 -185
- data/ext/facter/facter/lib/src/logging/logging.cc +0 -151
- data/ext/facter/facter/lib/src/ruby/aggregate_resolution.cc +0 -249
- data/ext/facter/facter/lib/src/ruby/chunk.cc +0 -136
- data/ext/facter/facter/lib/src/ruby/confine.cc +0 -84
- data/ext/facter/facter/lib/src/ruby/fact.cc +0 -398
- data/ext/facter/facter/lib/src/ruby/module.cc +0 -1130
- data/ext/facter/facter/lib/src/ruby/resolution.cc +0 -230
- data/ext/facter/facter/lib/src/ruby/ruby.cc +0 -182
- data/ext/facter/facter/lib/src/ruby/ruby_value.cc +0 -288
- data/ext/facter/facter/lib/src/ruby/simple_resolution.cc +0 -156
- data/ext/facter/facter/lib/src/util/bsd/scoped_ifaddrs.cc +0 -29
- data/ext/facter/facter/lib/src/util/config/config.cc +0 -83
- data/ext/facter/facter/lib/src/util/config/posix/config.cc +0 -12
- data/ext/facter/facter/lib/src/util/config/windows/config.cc +0 -14
- data/ext/facter/facter/lib/src/util/freebsd/geom.cc +0 -130
- data/ext/facter/facter/lib/src/util/posix/scoped_addrinfo.cc +0 -41
- data/ext/facter/facter/lib/src/util/posix/scoped_bio.cc +0 -29
- data/ext/facter/facter/lib/src/util/posix/scoped_descriptor.cc +0 -20
- data/ext/facter/facter/lib/src/util/posix/utmpx_file.cc +0 -36
- data/ext/facter/facter/lib/src/util/scoped_file.cc +0 -26
- data/ext/facter/facter/lib/src/util/solaris/k_stat.cc +0 -157
- data/ext/facter/facter/lib/src/util/solaris/scoped_kstat.cc +0 -31
- data/ext/facter/facter/lib/src/util/string.cc +0 -170
- data/ext/facter/facter/lib/src/util/windows/wsa.cc +0 -69
- data/ext/facter/facter/lib/src/util/yaml.cc +0 -72
- data/ext/facter/facter/lib/tasks/spec.rake +0 -26
- data/ext/facter/facter/lib/tests/CMakeLists.txt +0 -156
- data/ext/facter/facter/lib/tests/collection_fixture.cc +0 -15
- data/ext/facter/facter/lib/tests/collection_fixture.hpp +0 -19
- data/ext/facter/facter/lib/tests/cwrapper.cc +0 -22
- data/ext/facter/facter/lib/tests/facts/array_value.cc +0 -140
- data/ext/facter/facter/lib/tests/facts/boolean_value.cc +0 -67
- data/ext/facter/facter/lib/tests/facts/cache.cc +0 -100
- data/ext/facter/facter/lib/tests/facts/collection.cc +0 -576
- data/ext/facter/facter/lib/tests/facts/double_value.cc +0 -40
- data/ext/facter/facter/lib/tests/facts/external/json_resolver.cc +0 -62
- data/ext/facter/facter/lib/tests/facts/external/posix/execution_resolver.cc +0 -69
- data/ext/facter/facter/lib/tests/facts/external/text_resolver.cc +0 -46
- data/ext/facter/facter/lib/tests/facts/external/windows/execution_resolver.cc +0 -69
- data/ext/facter/facter/lib/tests/facts/external/windows/powershell_resolver.cc +0 -122
- data/ext/facter/facter/lib/tests/facts/external/yaml_resolver.cc +0 -70
- data/ext/facter/facter/lib/tests/facts/integer_value.cc +0 -69
- data/ext/facter/facter/lib/tests/facts/linux/dmi_resolver.cc +0 -116
- data/ext/facter/facter/lib/tests/facts/linux/filesystem_resolver.cc +0 -13
- data/ext/facter/facter/lib/tests/facts/linux/processor_fixture.cc +0 -259
- data/ext/facter/facter/lib/tests/facts/linux/processor_fixture.hpp +0 -77
- data/ext/facter/facter/lib/tests/facts/linux/processor_resolver.cc +0 -312
- data/ext/facter/facter/lib/tests/facts/linux/virtualization_resolver.cc +0 -48
- data/ext/facter/facter/lib/tests/facts/map_value.cc +0 -116
- data/ext/facter/facter/lib/tests/facts/posix/collection.cc +0 -39
- data/ext/facter/facter/lib/tests/facts/posix/uptime_resolver.cc +0 -52
- data/ext/facter/facter/lib/tests/facts/resolvers/augeas_resolver.cc +0 -58
- data/ext/facter/facter/lib/tests/facts/resolvers/disk_resolver.cc +0 -114
- data/ext/facter/facter/lib/tests/facts/resolvers/dmi_resolver.cc +0 -152
- data/ext/facter/facter/lib/tests/facts/resolvers/filesystem_resolver.cc +0 -206
- data/ext/facter/facter/lib/tests/facts/resolvers/identity_resolver.cc +0 -83
- data/ext/facter/facter/lib/tests/facts/resolvers/kernel_resolver.cc +0 -61
- data/ext/facter/facter/lib/tests/facts/resolvers/ldom_resolver.cc +0 -86
- data/ext/facter/facter/lib/tests/facts/resolvers/memory_resolver.cc +0 -135
- data/ext/facter/facter/lib/tests/facts/resolvers/networking_resolver.cc +0 -507
- data/ext/facter/facter/lib/tests/facts/resolvers/operating_system_resolver.cc +0 -247
- data/ext/facter/facter/lib/tests/facts/resolvers/processor_resolver.cc +0 -157
- data/ext/facter/facter/lib/tests/facts/resolvers/ruby_resolver.cc +0 -74
- data/ext/facter/facter/lib/tests/facts/resolvers/ssh_resolver.cc +0 -103
- data/ext/facter/facter/lib/tests/facts/resolvers/system_profiler_resolver.cc +0 -135
- data/ext/facter/facter/lib/tests/facts/resolvers/timezone_resolver.cc +0 -49
- data/ext/facter/facter/lib/tests/facts/resolvers/uptime_resolver.cc +0 -151
- data/ext/facter/facter/lib/tests/facts/resolvers/virtualization_resolver.cc +0 -175
- data/ext/facter/facter/lib/tests/facts/resolvers/xen_resolver.cc +0 -100
- data/ext/facter/facter/lib/tests/facts/resolvers/zfs_resolver.cc +0 -65
- data/ext/facter/facter/lib/tests/facts/resolvers/zone_resolver.cc +0 -122
- data/ext/facter/facter/lib/tests/facts/resolvers/zpool_resolver.cc +0 -69
- data/ext/facter/facter/lib/tests/facts/schema.cc +0 -796
- data/ext/facter/facter/lib/tests/facts/string_value.cc +0 -270
- data/ext/facter/facter/lib/tests/facts/windows/collection.cc +0 -60
- data/ext/facter/facter/lib/tests/facts/windows/networking_resolver.cc +0 -217
- data/ext/facter/facter/lib/tests/fixtures.cc +0 -63
- data/ext/facter/facter/lib/tests/fixtures.hpp.in +0 -27
- data/ext/facter/facter/lib/tests/fixtures/execution/with space/command_with_space.bat +0 -2
- data/ext/facter/facter/lib/tests/fixtures/facts/external/json/facts.json +0 -12
- data/ext/facter/facter/lib/tests/fixtures/facts/external/json/invalid.json +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/ordering/bar/foo.yaml +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/ordering/foo/foo.yaml +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/error_message +0 -4
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/facts +0 -5
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/failed +0 -3
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/not_executable +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/text/facts.txt +0 -4
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/error_message.bat +0 -4
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/facts.bat +0 -4
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/failed.cmd +0 -2
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/not_executable +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/ruby_script.rb +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/error_message.ps1 +0 -3
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/facts.ps1 +0 -4
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/failed.ps1 +0 -2
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/json.ps1 +0 -21
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/not_executable +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/yaml.ps1 +0 -18
- data/ext/facter/facter/lib/tests/fixtures/facts/external/yaml/facts.yaml +0 -15
- data/ext/facter/facter/lib/tests/fixtures/facts/external/yaml/invalid.yaml +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/external/z/303/266/facts.rb +0 -3
- data/ext/facter/facter/lib/tests/fixtures/facts/external/z/303/266/facts.txt +0 -1
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/cloud/azure +0 -3
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/cloud/azure-unknown +0 -3
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/cloud/not-azure +0 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/dmidecode/full.txt +0 -83
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/dmidecode/full_alternative.txt +0 -83
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/dmidecode/none.txt +0 -2
- data/ext/facter/facter/lib/tests/fixtures/ruby/100_resolutions.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/101_resolutions.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_invalid_require.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb +0 -30
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_cycle.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_invalid_merge.rb +0 -13
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_merge.rb +0 -23
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_require.rb +0 -16
- data/ext/facter/facter/lib/tests/fixtures/ruby/array_confine.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/array_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/bad_command.rb +0 -19
- data/ext/facter/facter/lib/tests/fixtures/ruby/bad_syntax.rb +0 -2
- data/ext/facter/facter/lib/tests/fixtures/ruby/bignum_fact_value.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_confine.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_false_confine.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_nil_confine.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_true_confine.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_false_confine.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_false_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_true_confine.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_true_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/command_with_space.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/confine_missing_fact.rb +0 -22
- data/ext/facter/facter/lib/tests/fixtures/ruby/confine_weight.rb +0 -20
- data/ext/facter/facter/lib/tests/fixtures/ruby/custom_dir/expect_network_init.rb +0 -15
- data/ext/facter/facter/lib/tests/fixtures/ruby/cycle.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/debug.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/debugging.rb +0 -14
- data/ext/facter/facter/lib/tests/fixtures/ruby/debugonce.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/define_aggregate_fact.rb +0 -13
- data/ext/facter/facter/lib/tests/fixtures/ruby/define_fact.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/double_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_command.rb +0 -3
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_fact.rb +0 -1
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_fact_with_value.rb +0 -1
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_setcode_command.rb +0 -3
- data/ext/facter/facter/lib/tests/fixtures/ruby/exec.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/execute_on_fail_raise.rb +0 -17
- data/ext/facter/facter/lib/tests/fixtures/ruby/execute_on_fail_value.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/execute_timeout.rb +0 -1
- data/ext/facter/facter/lib/tests/fixtures/ruby/execution_failure.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/existing_aggregate_resolution.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/existing_simple_resolution.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/fact.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/facter.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/facterversion.rb +0 -17
- data/ext/facter/facter/lib/tests/fixtures/ruby/hash_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/hash_with_non_string_key.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/integer_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/log_exception.rb +0 -21
- data/ext/facter/facter/lib/tests/fixtures/ruby/lookup.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/multi_confine.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/named_resolution.rb +0 -13
- data/ext/facter/facter/lib/tests/fixtures/ruby/negative_number.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/nil_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/nonexistent_command.rb +0 -21
- data/ext/facter/facter/lib/tests/fixtures/ruby/on_message.rb +0 -16
- data/ext/facter/facter/lib/tests/fixtures/ruby/range_confine.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/regexp_confine.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/ruby.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple.rb +0 -11
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple_command.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple_confine.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple_resolution.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/single_allocation.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/stderr_output.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/string_fact.rb +0 -5
- data/ext/facter/facter/lib/tests/fixtures/ruby/timeout.rb +0 -10
- data/ext/facter/facter/lib/tests/fixtures/ruby/trace.rb +0 -22
- data/ext/facter/facter/lib/tests/fixtures/ruby/uni/341/220/201dir/customfacts/342/204/242.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/uses_exit_code.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/value.rb +0 -6
- data/ext/facter/facter/lib/tests/fixtures/ruby/version.rb +0 -2
- data/ext/facter/facter/lib/tests/fixtures/ruby/warn.rb +0 -7
- data/ext/facter/facter/lib/tests/fixtures/ruby/warnonce.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/weight.rb +0 -20
- data/ext/facter/facter/lib/tests/fixtures/ruby/weight_option.rb +0 -17
- data/ext/facter/facter/lib/tests/fixtures/ruby/which.rb +0 -9
- data/ext/facter/facter/lib/tests/fixtures/ruby/windows/ole.rb +0 -7
- data/ext/facter/facter/lib/tests/java/facter.cc +0 -69
- data/ext/facter/facter/lib/tests/log_capture.cc +0 -29
- data/ext/facter/facter/lib/tests/log_capture.hpp +0 -35
- data/ext/facter/facter/lib/tests/logging/logging.cc +0 -69
- data/ext/facter/facter/lib/tests/main.cc +0 -20
- data/ext/facter/facter/lib/tests/mock_server.cc +0 -44
- data/ext/facter/facter/lib/tests/mock_server.hpp +0 -25
- data/ext/facter/facter/lib/tests/ruby/ruby.cc +0 -634
- data/ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc +0 -35
- data/ext/facter/facter/lib/tests/ruby/ruby_helper.cc +0 -41
- data/ext/facter/facter/lib/tests/ruby/ruby_helper.hpp +0 -8
- data/ext/facter/facter/lib/tests/ruby/windows/ruby.cc +0 -53
- data/ext/facter/facter/lib/tests/util/bsd/scoped_ifaddrs.cc +0 -10
- data/ext/facter/facter/lib/tests/util/posix/scoped_addrinfo.cc +0 -11
- data/ext/facter/facter/lib/tests/util/posix/scoped_bio.cc +0 -12
- data/ext/facter/facter/lib/tests/util/posix/scoped_descriptor.cc +0 -22
- data/ext/facter/facter/lib/tests/util/string.cc +0 -291
- data/ext/facter/facter/lib/version.h.in +0 -28
- data/ext/facter/facter/locales/CMakeLists.txt +0 -7
- data/ext/facter/facter/locales/FACTER.pot +0 -1621
- data/ext/facter/facter/man/man8/facter.8 +0 -205
- data/ext/facter/facter/scripts/cpplint.py +0 -4754
- data/ext/facter/facter/scripts/travis_target.sh +0 -83
- data/ext/facter/facter/tasks/ci.rake +0 -22
- data/ext/facter/leatherman/CHANGELOG.md +0 -439
- data/ext/facter/leatherman/CMakeLists.txt +0 -143
- data/ext/facter/leatherman/CONTRIBUTING.md +0 -98
- data/ext/facter/leatherman/LICENSE +0 -17
- data/ext/facter/leatherman/LeathermanConfig.cmake.in +0 -57
- data/ext/facter/leatherman/LeathermanConfigVersion.cmake.in +0 -11
- data/ext/facter/leatherman/MAINTAINERS +0 -28
- data/ext/facter/leatherman/README.md +0 -416
- data/ext/facter/leatherman/appveyor.yml +0 -47
- data/ext/facter/leatherman/catch/CMakeLists.txt +0 -1
- data/ext/facter/leatherman/cmake/FindICU.cmake +0 -690
- data/ext/facter/leatherman/cmake/GetGitRevisionDescription.cmake +0 -130
- data/ext/facter/leatherman/cmake/GetGitRevisionDescription.cmake.in +0 -38
- data/ext/facter/leatherman/cmake/cflags.cmake +0 -117
- data/ext/facter/leatherman/cmake/generate_translations.cmake +0 -17
- data/ext/facter/leatherman/cmake/internal.cmake +0 -241
- data/ext/facter/leatherman/cmake/leatherman.cmake.in +0 -369
- data/ext/facter/leatherman/cmake/leatherman_config.cmake +0 -80
- data/ext/facter/leatherman/cmake/normalize_pot.cmake +0 -17
- data/ext/facter/leatherman/cmake/options.cmake +0 -22
- data/ext/facter/leatherman/cmake/pod2man.cmake +0 -36
- data/ext/facter/leatherman/curl/CMakeLists.txt +0 -42
- data/ext/facter/leatherman/curl/inc/leatherman/curl/client.hpp +0 -450
- data/ext/facter/leatherman/curl/inc/leatherman/curl/request.hpp +0 -130
- data/ext/facter/leatherman/curl/inc/leatherman/curl/response.hpp +0 -80
- data/ext/facter/leatherman/curl/src/client.cc +0 -590
- data/ext/facter/leatherman/curl/src/request.cc +0 -112
- data/ext/facter/leatherman/curl/src/response.cc +0 -62
- data/ext/facter/leatherman/curl/tests/CMakeLists.txt +0 -22
- data/ext/facter/leatherman/curl/tests/client_test.cc +0 -628
- data/ext/facter/leatherman/curl/tests/fixtures.cc +0 -27
- data/ext/facter/leatherman/curl/tests/fixtures.hpp +0 -31
- data/ext/facter/leatherman/curl/tests/mock_curl.cc +0 -431
- data/ext/facter/leatherman/curl/tests/mock_curl.hpp +0 -86
- data/ext/facter/leatherman/curl/tests/request_test.cc +0 -85
- data/ext/facter/leatherman/curl/tests/response_test.cc +0 -58
- data/ext/facter/leatherman/dynamic_library/CMakeLists.txt +0 -43
- data/ext/facter/leatherman/dynamic_library/inc/leatherman/dynamic_library/dynamic_library.hpp +0 -122
- data/ext/facter/leatherman/dynamic_library/src/dynamic_library.cc +0 -57
- data/ext/facter/leatherman/dynamic_library/src/posix/dynamic_library.cc +0 -91
- data/ext/facter/leatherman/dynamic_library/src/windows/dynamic_library.cc +0 -128
- data/ext/facter/leatherman/dynamic_library/tests/dynamic_library_tests.cc +0 -94
- data/ext/facter/leatherman/dynamic_library/tests/fixtures.hpp.in +0 -3
- data/ext/facter/leatherman/dynamic_library/tests/test-lib/goodbye.cc +0 -5
- data/ext/facter/leatherman/dynamic_library/tests/test-lib/hello.cc +0 -7
- data/ext/facter/leatherman/execution/CMakeLists.txt +0 -65
- data/ext/facter/leatherman/execution/inc/leatherman/execution/execution.hpp +0 -488
- data/ext/facter/leatherman/execution/src/execution.cc +0 -510
- data/ext/facter/leatherman/execution/src/posix/execution.cc +0 -574
- data/ext/facter/leatherman/execution/src/posix/generic/platform.cc +0 -30
- data/ext/facter/leatherman/execution/src/posix/platform.hpp +0 -15
- data/ext/facter/leatherman/execution/src/posix/solaris/platform.cc +0 -197
- data/ext/facter/leatherman/execution/src/windows/execution.cc +0 -698
- data/ext/facter/leatherman/execution/tests/fixtures.hpp.in +0 -2
- data/ext/facter/leatherman/execution/tests/fixtures/echo_pid +0 -2
- data/ext/facter/leatherman/execution/tests/fixtures/error_message +0 -5
- data/ext/facter/leatherman/execution/tests/fixtures/execution/selfkill.sh +0 -3
- data/ext/facter/leatherman/execution/tests/fixtures/execution/sleep.sh +0 -3
- data/ext/facter/leatherman/execution/tests/fixtures/facts +0 -5
- data/ext/facter/leatherman/execution/tests/fixtures/failed +0 -3
- data/ext/facter/leatherman/execution/tests/fixtures/ls/crlf.txt +0 -3
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file1.txt +0 -1
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file2.txt +0 -1
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file3.txt +0 -1
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file4.txt +0 -7
- data/ext/facter/leatherman/execution/tests/fixtures/not_executable +0 -1
- data/ext/facter/leatherman/execution/tests/fixtures/windows/error_message.bat +0 -6
- data/ext/facter/leatherman/execution/tests/fixtures/windows/facts.bat +0 -4
- data/ext/facter/leatherman/execution/tests/fixtures/windows/failed.cmd +0 -2
- data/ext/facter/leatherman/execution/tests/fixtures/windows/not_executable +0 -1
- data/ext/facter/leatherman/execution/tests/fixtures/windows/ruby_script.rb +0 -1
- data/ext/facter/leatherman/execution/tests/log_capture.cc +0 -29
- data/ext/facter/leatherman/execution/tests/log_capture.hpp +0 -35
- data/ext/facter/leatherman/execution/tests/lth_cat.cc +0 -38
- data/ext/facter/leatherman/execution/tests/lth_cat.hpp +0 -9
- data/ext/facter/leatherman/execution/tests/posix/execution.cc +0 -728
- data/ext/facter/leatherman/execution/tests/posix/solaris/execution.cc +0 -54
- data/ext/facter/leatherman/execution/tests/windows/execution.cc +0 -789
- data/ext/facter/leatherman/file_util/CMakeLists.txt +0 -18
- data/ext/facter/leatherman/file_util/inc/leatherman/file_util/directory.hpp +0 -28
- data/ext/facter/leatherman/file_util/inc/leatherman/file_util/file.hpp +0 -95
- data/ext/facter/leatherman/file_util/src/directory.cc +0 -51
- data/ext/facter/leatherman/file_util/src/file.cc +0 -131
- data/ext/facter/leatherman/file_util/tests/directory_utils_test.cc +0 -87
- data/ext/facter/leatherman/file_util/tests/file_utils_test.cc +0 -195
- data/ext/facter/leatherman/file_util/tests/fixtures.cc +0 -37
- data/ext/facter/leatherman/file_util/tests/fixtures.hpp +0 -39
- data/ext/facter/leatherman/json_container/CMakeLists.txt +0 -11
- data/ext/facter/leatherman/json_container/README.md +0 -108
- data/ext/facter/leatherman/json_container/inc/leatherman/json_container/json_container.hpp +0 -443
- data/ext/facter/leatherman/json_container/src/json_container.cc +0 -655
- data/ext/facter/leatherman/json_container/tests/json_container_test.cc +0 -1129
- data/ext/facter/leatherman/locale/CMakeLists.txt +0 -46
- data/ext/facter/leatherman/locale/disabled/locale.cc +0 -38
- data/ext/facter/leatherman/locale/inc/leatherman/locale/locale.hpp +0 -263
- data/ext/facter/leatherman/locale/locales/CMakeLists.txt +0 -6
- data/ext/facter/leatherman/locale/locales/fr.po +0 -40
- data/ext/facter/leatherman/locale/locales/leatherman_locale.pot +0 -41
- data/ext/facter/leatherman/locale/src/locale.cc +0 -96
- data/ext/facter/leatherman/locale/tests/format.cc +0 -117
- data/ext/facter/leatherman/locale/tests/locale.cc +0 -190
- data/ext/facter/leatherman/locales/CMakeLists.txt +0 -7
- data/ext/facter/leatherman/locales/leatherman.pot +0 -717
- data/ext/facter/leatherman/logging/CMakeLists.txt +0 -43
- data/ext/facter/leatherman/logging/inc/leatherman/logging/logging.hpp +0 -264
- data/ext/facter/leatherman/logging/locales/CMakeLists.txt +0 -6
- data/ext/facter/leatherman/logging/locales/fr.po +0 -72
- data/ext/facter/leatherman/logging/locales/leatherman_logging.pot +0 -72
- data/ext/facter/leatherman/logging/src/logging.cc +0 -229
- data/ext/facter/leatherman/logging/src/posix/logging.cc +0 -39
- data/ext/facter/leatherman/logging/src/windows/logging.cc +0 -52
- data/ext/facter/leatherman/logging/tests/logging.cc +0 -118
- data/ext/facter/leatherman/logging/tests/logging.hpp +0 -88
- data/ext/facter/leatherman/logging/tests/logging_i18n.cc +0 -103
- data/ext/facter/leatherman/logging/tests/logging_on_message.cc +0 -61
- data/ext/facter/leatherman/logging/tests/logging_stream.cc +0 -159
- data/ext/facter/leatherman/logging/tests/logging_stream_lines.cc +0 -172
- data/ext/facter/leatherman/logging/tests/posix/logging.cc +0 -23
- data/ext/facter/leatherman/logging/tests/windows/logging.cc +0 -13
- data/ext/facter/leatherman/nowide/CMakeLists.txt +0 -7
- data/ext/facter/leatherman/rapidjson/CMakeLists.txt +0 -1
- data/ext/facter/leatherman/ruby/CMakeLists.txt +0 -26
- data/ext/facter/leatherman/ruby/inc/leatherman/ruby/api.hpp +0 -748
- data/ext/facter/leatherman/ruby/src/api.cc +0 -528
- data/ext/facter/leatherman/ruby/src/posix/api.cc +0 -14
- data/ext/facter/leatherman/ruby/src/windows/api.cc +0 -20
- data/ext/facter/leatherman/ruby/tests/api-test.cc +0 -206
- data/ext/facter/leatherman/scripts/cpplint.py +0 -6323
- data/ext/facter/leatherman/tests/CMakeLists.txt +0 -22
- data/ext/facter/leatherman/tests/main.cc +0 -17
- data/ext/facter/leatherman/util/CMakeLists.txt +0 -36
- data/ext/facter/leatherman/util/inc/leatherman/util/environment.hpp +0 -69
- data/ext/facter/leatherman/util/inc/leatherman/util/option_set.hpp +0 -228
- data/ext/facter/leatherman/util/inc/leatherman/util/posix/scoped_descriptor.hpp +0 -32
- data/ext/facter/leatherman/util/inc/leatherman/util/regex.hpp +0 -80
- data/ext/facter/leatherman/util/inc/leatherman/util/scope_exit.hpp +0 -62
- data/ext/facter/leatherman/util/inc/leatherman/util/scoped_env.hpp +0 -35
- data/ext/facter/leatherman/util/inc/leatherman/util/scoped_resource.hpp +0 -130
- data/ext/facter/leatherman/util/inc/leatherman/util/strings.hpp +0 -57
- data/ext/facter/leatherman/util/inc/leatherman/util/time.hpp +0 -36
- data/ext/facter/leatherman/util/inc/leatherman/util/timer.hpp +0 -43
- data/ext/facter/leatherman/util/inc/leatherman/util/uri.hpp +0 -23
- data/ext/facter/leatherman/util/inc/leatherman/util/windows/scoped_handle.hpp +0 -32
- data/ext/facter/leatherman/util/src/environment.cc +0 -29
- data/ext/facter/leatherman/util/src/posix/environment.cc +0 -75
- data/ext/facter/leatherman/util/src/posix/scoped_descriptor.cc +0 -23
- data/ext/facter/leatherman/util/src/posix/time.cc +0 -9
- data/ext/facter/leatherman/util/src/scope_exit.cc +0 -43
- data/ext/facter/leatherman/util/src/scoped_env.cc +0 -37
- data/ext/facter/leatherman/util/src/strings.cc +0 -41
- data/ext/facter/leatherman/util/src/time.cc +0 -49
- data/ext/facter/leatherman/util/src/uri.cc +0 -75
- data/ext/facter/leatherman/util/src/windows/environment.cc +0 -75
- data/ext/facter/leatherman/util/src/windows/scoped_handle.cc +0 -24
- data/ext/facter/leatherman/util/src/windows/time.cc +0 -10
- data/ext/facter/leatherman/util/tests/environment.cc +0 -90
- data/ext/facter/leatherman/util/tests/option_set.cc +0 -234
- data/ext/facter/leatherman/util/tests/posix/environment.cc +0 -36
- data/ext/facter/leatherman/util/tests/scoped_env.cc +0 -52
- data/ext/facter/leatherman/util/tests/strings_test.cc +0 -71
- data/ext/facter/leatherman/util/tests/timer.cc +0 -39
- data/ext/facter/leatherman/util/tests/uri.cc +0 -104
- data/ext/facter/leatherman/util/tests/windows/environment.cc +0 -30
- data/ext/facter/leatherman/vendor/Catch-1.10.0.zip +0 -0
- data/ext/facter/leatherman/vendor/nowide/build/Jamfile.v2 +0 -26
- data/ext/facter/leatherman/vendor/nowide/doc/Doxyfile +0 -1632
- data/ext/facter/leatherman/vendor/nowide/doc/LICENSE_1_0.txt +0 -23
- data/ext/facter/leatherman/vendor/nowide/doc/gendoc.sh +0 -11
- data/ext/facter/leatherman/vendor/nowide/doc/main.txt +0 -354
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/args.hpp +0 -167
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cenv.hpp +0 -126
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/config.hpp +0 -54
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/convert.hpp +0 -154
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cstdio.hpp +0 -101
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cstdlib.hpp +0 -16
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/filebuf.hpp +0 -415
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/fstream.hpp +0 -283
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/integration/filesystem.hpp +0 -28
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/iostream.hpp +0 -99
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/stackstring.hpp +0 -154
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/system.hpp +0 -46
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/utf8_codecvt.hpp +0 -499
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/windows.hpp +0 -39
- data/ext/facter/leatherman/vendor/nowide/index.html +0 -16
- data/ext/facter/leatherman/vendor/nowide/src/iostream.cpp +0 -263
- data/ext/facter/leatherman/vendor/nowide/standalone/CMakeLists.txt +0 -104
- data/ext/facter/leatherman/vendor/nowide/standalone/MinGW.cmake +0 -9
- data/ext/facter/leatherman/vendor/nowide/standalone/config.hpp +0 -37
- data/ext/facter/leatherman/vendor/nowide/standalone/convert +0 -34
- data/ext/facter/leatherman/vendor/nowide/standalone/encoding_errors.hpp +0 -58
- data/ext/facter/leatherman/vendor/nowide/standalone/encoding_utf.hpp +0 -84
- data/ext/facter/leatherman/vendor/nowide/standalone/run_convert_and_build.sh +0 -17
- data/ext/facter/leatherman/vendor/nowide/standalone/scoped_ptr.hpp +0 -93
- data/ext/facter/leatherman/vendor/nowide/standalone/utf.hpp +0 -469
- data/ext/facter/leatherman/vendor/nowide/template.hpp +0 -19
- data/ext/facter/leatherman/vendor/nowide/test/Jamfile.v2 +0 -43
- data/ext/facter/leatherman/vendor/nowide/test/test.hpp +0 -25
- data/ext/facter/leatherman/vendor/nowide/test/test_codecvt.cpp +0 -254
- data/ext/facter/leatherman/vendor/nowide/test/test_convert.cpp +0 -101
- data/ext/facter/leatherman/vendor/nowide/test/test_env.cpp +0 -49
- data/ext/facter/leatherman/vendor/nowide/test/test_fs.cpp +0 -48
- data/ext/facter/leatherman/vendor/nowide/test/test_fstream.cpp +0 -184
- data/ext/facter/leatherman/vendor/nowide/test/test_iostream.cpp +0 -52
- data/ext/facter/leatherman/vendor/nowide/test/test_stdio.cpp +0 -60
- data/ext/facter/leatherman/vendor/nowide/test/test_system.cpp +0 -91
- data/ext/facter/leatherman/vendor/rapidjson-1.0.2.zip +0 -0
- data/ext/facter/leatherman/windows/CMakeLists.txt +0 -27
- data/ext/facter/leatherman/windows/inc/leatherman/windows/file_util.hpp +0 -23
- data/ext/facter/leatherman/windows/inc/leatherman/windows/process.hpp +0 -22
- data/ext/facter/leatherman/windows/inc/leatherman/windows/registry.hpp +0 -56
- data/ext/facter/leatherman/windows/inc/leatherman/windows/system_error.hpp +0 -23
- data/ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp +0 -30
- data/ext/facter/leatherman/windows/inc/leatherman/windows/windows.hpp +0 -10
- data/ext/facter/leatherman/windows/inc/leatherman/windows/wmi.hpp +0 -193
- data/ext/facter/leatherman/windows/src/file_util.cc +0 -28
- data/ext/facter/leatherman/windows/src/process.cc +0 -42
- data/ext/facter/leatherman/windows/src/registry.cc +0 -96
- data/ext/facter/leatherman/windows/src/system_error.cc +0 -33
- data/ext/facter/leatherman/windows/src/user.cc +0 -76
- data/ext/facter/leatherman/windows/src/wmi.cc +0 -208
- data/ext/facter/leatherman/windows/tests/file_utils_test.cc +0 -13
@@ -1,398 +0,0 @@
|
|
1
|
-
#include <internal/ruby/fact.hpp>
|
2
|
-
#include <internal/ruby/aggregate_resolution.hpp>
|
3
|
-
#include <internal/ruby/module.hpp>
|
4
|
-
#include <internal/ruby/simple_resolution.hpp>
|
5
|
-
#include <internal/ruby/ruby_value.hpp>
|
6
|
-
#include <facter/facts/collection.hpp>
|
7
|
-
#include <leatherman/util/environment.hpp>
|
8
|
-
#include <leatherman/logging/logging.hpp>
|
9
|
-
#include <leatherman/locale/locale.hpp>
|
10
|
-
#include <algorithm>
|
11
|
-
|
12
|
-
// Mark string for translation (alias for leatherman::locale::format)
|
13
|
-
using leatherman::locale::_;
|
14
|
-
|
15
|
-
using namespace std;
|
16
|
-
using namespace facter::facts;
|
17
|
-
using namespace leatherman::util;
|
18
|
-
using namespace leatherman::ruby;
|
19
|
-
|
20
|
-
namespace facter { namespace ruby {
|
21
|
-
|
22
|
-
// The maximum number of resolutions allowed for a fact
|
23
|
-
static const size_t MAXIMUM_RESOLUTIONS = 100;
|
24
|
-
|
25
|
-
fact::fact() :
|
26
|
-
_resolved(false),
|
27
|
-
_resolving(false),
|
28
|
-
_weight(0)
|
29
|
-
{
|
30
|
-
auto const& ruby = api::instance();
|
31
|
-
_self = ruby.nil_value();
|
32
|
-
_name = ruby.nil_value();
|
33
|
-
_value = ruby.nil_value();
|
34
|
-
}
|
35
|
-
|
36
|
-
VALUE fact::define()
|
37
|
-
{
|
38
|
-
auto const& ruby = api::instance();
|
39
|
-
|
40
|
-
VALUE klass = ruby.rb_define_class_under(ruby.lookup({ "Facter", "Util" }), "Fact", *ruby.rb_cObject);
|
41
|
-
ruby.rb_define_alloc_func(klass, alloc);
|
42
|
-
ruby.rb_define_method(klass, "initialize", RUBY_METHOD_FUNC(ruby_initialize), 1);
|
43
|
-
ruby.rb_define_method(klass, "name", RUBY_METHOD_FUNC(ruby_name), 0);
|
44
|
-
ruby.rb_define_method(klass, "value", RUBY_METHOD_FUNC(ruby_value), 0);
|
45
|
-
ruby.rb_define_method(klass, "resolution", RUBY_METHOD_FUNC(ruby_resolution), 1);
|
46
|
-
ruby.rb_define_method(klass, "define_resolution", RUBY_METHOD_FUNC(ruby_define_resolution), -1);
|
47
|
-
ruby.rb_define_method(klass, "flush", RUBY_METHOD_FUNC(ruby_flush), 0);
|
48
|
-
return klass;
|
49
|
-
}
|
50
|
-
|
51
|
-
VALUE fact::create(VALUE name)
|
52
|
-
{
|
53
|
-
auto const& ruby = api::instance();
|
54
|
-
return ruby.rb_class_new_instance(1, &name, ruby.lookup({"Facter", "Util", "Fact"}));
|
55
|
-
}
|
56
|
-
|
57
|
-
VALUE fact::name() const
|
58
|
-
{
|
59
|
-
return _name;
|
60
|
-
}
|
61
|
-
|
62
|
-
VALUE fact::value()
|
63
|
-
{
|
64
|
-
auto const& ruby = api::instance();
|
65
|
-
auto facter = module::current();
|
66
|
-
|
67
|
-
collection& facts = facter->facts();
|
68
|
-
|
69
|
-
// Prevent cycles by raising an exception
|
70
|
-
if (_resolving) {
|
71
|
-
ruby.rb_raise(*ruby.rb_eRuntimeError, _("cycle detected while requesting value of fact \"{1}\"", ruby.rb_string_value_ptr(&_name)).c_str());
|
72
|
-
}
|
73
|
-
|
74
|
-
if (_resolved) {
|
75
|
-
return _value;
|
76
|
-
}
|
77
|
-
|
78
|
-
// Sort the resolutions by weight (descending)
|
79
|
-
sort(_resolutions.begin(), _resolutions.end(), [&](VALUE first, VALUE second) {
|
80
|
-
auto res_first = ruby.to_native<resolution>(first);
|
81
|
-
auto res_second = ruby.to_native<resolution>(second);
|
82
|
-
return res_first->weight() > res_second->weight();
|
83
|
-
});
|
84
|
-
|
85
|
-
_resolving = true;
|
86
|
-
bool add = true;
|
87
|
-
|
88
|
-
vector<VALUE>::iterator it;
|
89
|
-
ruby.rescue([&]() {
|
90
|
-
volatile VALUE value = ruby.nil_value();
|
91
|
-
size_t weight = 0;
|
92
|
-
|
93
|
-
// Look through the resolutions and find the first allowed resolution that resolves
|
94
|
-
for (it = _resolutions.begin(); it != _resolutions.end(); ++it) {
|
95
|
-
auto res = ruby.to_native<resolution>(*it);
|
96
|
-
if (!res->suitable(*facter)) {
|
97
|
-
continue;
|
98
|
-
}
|
99
|
-
value = res->value();
|
100
|
-
if (!ruby.is_nil(value)) {
|
101
|
-
weight = res->weight();
|
102
|
-
break;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
// Set the value to what was resolved
|
107
|
-
_value = value;
|
108
|
-
_weight = weight;
|
109
|
-
|
110
|
-
if (! ruby.is_nil(_value) && _weight != 0) {
|
111
|
-
return 0;
|
112
|
-
}
|
113
|
-
|
114
|
-
// There's two possibilities here:
|
115
|
-
// 1. None of our resolvers could resolve the value
|
116
|
-
// 2. A resolver of weight 0 resolved the value
|
117
|
-
//
|
118
|
-
// In both cases, we attempt to use the "built-in" fact's
|
119
|
-
// value. This serves as a fallback resolver for Case (1)
|
120
|
-
// while for Case (2), we want built-in values to take
|
121
|
-
// precedence over 0-weight custom facts.
|
122
|
-
|
123
|
-
auto builtin_value = facts[ruby.to_string(_name)];
|
124
|
-
if (! builtin_value) {
|
125
|
-
return 0;
|
126
|
-
}
|
127
|
-
auto builtin_ruby_value = facter->to_ruby(builtin_value);
|
128
|
-
|
129
|
-
// We need this check for Case (2). Otherwise, we risk
|
130
|
-
// overwriting our resolved value in the small chance
|
131
|
-
// that builtin_value exists, but its ruby value is
|
132
|
-
// nil.
|
133
|
-
if (! ruby.is_nil(builtin_ruby_value)) {
|
134
|
-
// Already in collection, do not add
|
135
|
-
add = false;
|
136
|
-
_value = builtin_ruby_value;
|
137
|
-
_weight = builtin_value->weight();
|
138
|
-
}
|
139
|
-
|
140
|
-
return 0;
|
141
|
-
}, [&](VALUE ex) {
|
142
|
-
LOG_ERROR("error while resolving custom fact \"{1}\": {2}", ruby.rb_string_value_ptr(&_name), ruby.exception_to_string(ex));
|
143
|
-
|
144
|
-
// Failed, so set to nil
|
145
|
-
_value = ruby.nil_value();
|
146
|
-
_weight = 0;
|
147
|
-
return 0;
|
148
|
-
});
|
149
|
-
|
150
|
-
if (add) {
|
151
|
-
facts.add_custom(ruby.to_string(_name), ruby.is_nil(_value) ? nullptr : make_value<ruby::ruby_value>(_value), _weight);
|
152
|
-
}
|
153
|
-
|
154
|
-
_resolved = true;
|
155
|
-
_resolving = false;
|
156
|
-
return _value;
|
157
|
-
}
|
158
|
-
|
159
|
-
void fact::value(VALUE v)
|
160
|
-
{
|
161
|
-
_value = v;
|
162
|
-
_resolved = true;
|
163
|
-
}
|
164
|
-
|
165
|
-
VALUE fact::find_resolution(VALUE name) const
|
166
|
-
{
|
167
|
-
auto const& ruby = api::instance();
|
168
|
-
|
169
|
-
if (ruby.is_nil(name)) {
|
170
|
-
return ruby.nil_value();
|
171
|
-
}
|
172
|
-
|
173
|
-
if (!ruby.is_string(name)) {
|
174
|
-
ruby.rb_raise(*ruby.rb_eTypeError, _("expected resolution name to be a String").c_str());
|
175
|
-
}
|
176
|
-
|
177
|
-
// Search for the resolution by name
|
178
|
-
auto it = find_if(_resolutions.begin(), _resolutions.end(), [&](VALUE self) {
|
179
|
-
return ruby.equals(ruby.to_native<resolution>(self)->name(), name);
|
180
|
-
});
|
181
|
-
if (it == _resolutions.end()) {
|
182
|
-
return ruby.nil_value();
|
183
|
-
}
|
184
|
-
return *it;
|
185
|
-
}
|
186
|
-
|
187
|
-
VALUE fact::define_resolution(VALUE name, VALUE options)
|
188
|
-
{
|
189
|
-
// Do not declare types with destructors; if you do, wrap below in a api::protect call
|
190
|
-
auto const& ruby = api::instance();
|
191
|
-
|
192
|
-
if (!ruby.is_nil(name) && !ruby.is_string(name) && !ruby.is_symbol(name)) {
|
193
|
-
ruby.rb_raise(*ruby.rb_eTypeError, _("expected resolution name to be a Symbol or String").c_str());
|
194
|
-
}
|
195
|
-
|
196
|
-
if (ruby.is_symbol(name)) {
|
197
|
-
name = ruby.rb_sym_to_s(name);
|
198
|
-
}
|
199
|
-
|
200
|
-
bool aggregate = false;
|
201
|
-
bool has_weight = false;
|
202
|
-
size_t weight = 0;
|
203
|
-
volatile VALUE resolution_value = ruby.nil_value();
|
204
|
-
|
205
|
-
// Read the options if provided
|
206
|
-
if (!ruby.is_nil(options)) {
|
207
|
-
ID simple_id = ruby.rb_intern("simple");
|
208
|
-
ID aggregate_id = ruby.rb_intern("aggregate");
|
209
|
-
ID type_id = ruby.rb_intern("type");
|
210
|
-
ID value_id = ruby.rb_intern("value");
|
211
|
-
ID weight_id = ruby.rb_intern("weight");
|
212
|
-
ID timeout_id = ruby.rb_intern("timeout");
|
213
|
-
|
214
|
-
if (!ruby.is_hash(options)) {
|
215
|
-
ruby.rb_raise(*ruby.rb_eTypeError, _("expected a Hash for the options").c_str());
|
216
|
-
}
|
217
|
-
|
218
|
-
ruby.hash_for_each(options, [&](VALUE key, VALUE value) {
|
219
|
-
if (!ruby.is_symbol(key)) {
|
220
|
-
ruby.rb_raise(*ruby.rb_eTypeError, _("expected a Symbol for options key").c_str());
|
221
|
-
}
|
222
|
-
ID key_id = ruby.rb_to_id(key);
|
223
|
-
if (key_id == type_id) {
|
224
|
-
// Handle the type option
|
225
|
-
if (!ruby.is_symbol(value)) {
|
226
|
-
ruby.rb_raise(*ruby.rb_eTypeError, _("expected a Symbol for type option").c_str());
|
227
|
-
}
|
228
|
-
ID type_id = ruby.rb_to_id(value);
|
229
|
-
if (type_id != simple_id && type_id != aggregate_id) {
|
230
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("expected simple or aggregate for resolution type but was given {1}", ruby.rb_id2name(type_id)).c_str());
|
231
|
-
}
|
232
|
-
aggregate = (type_id == aggregate_id);
|
233
|
-
} else if (key_id == value_id) {
|
234
|
-
// Handle the value option
|
235
|
-
resolution_value = value;
|
236
|
-
} else if (key_id == weight_id) {
|
237
|
-
// Handle the weight option
|
238
|
-
has_weight = true;
|
239
|
-
weight = ruby.num2size_t(value);
|
240
|
-
} else if (key_id == timeout_id) {
|
241
|
-
// Ignore timeout as it isn't supported
|
242
|
-
static bool timeout_warning = true;
|
243
|
-
if (timeout_warning) {
|
244
|
-
LOG_WARNING("timeout option is not supported for custom facts and will be ignored.")
|
245
|
-
timeout_warning = false;
|
246
|
-
}
|
247
|
-
} else {
|
248
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("unexpected option {1}", ruby.rb_id2name(key_id)).c_str());
|
249
|
-
}
|
250
|
-
return true;
|
251
|
-
});
|
252
|
-
}
|
253
|
-
|
254
|
-
// Find or create the resolution
|
255
|
-
VALUE resolution_self = find_resolution(name);
|
256
|
-
if (ruby.is_nil(resolution_self)) {
|
257
|
-
if (_resolutions.size() == MAXIMUM_RESOLUTIONS) {
|
258
|
-
ruby.rb_raise(*ruby.rb_eRuntimeError, _("fact \"{1}\" already has the maximum number of resolutions allowed ({2}).", ruby.rb_string_value_ptr(&_name), MAXIMUM_RESOLUTIONS).c_str());
|
259
|
-
}
|
260
|
-
|
261
|
-
if (aggregate) {
|
262
|
-
_resolutions.push_back(aggregate_resolution::create());
|
263
|
-
} else {
|
264
|
-
_resolutions.push_back(simple_resolution::create());
|
265
|
-
}
|
266
|
-
resolution_self = _resolutions.back();
|
267
|
-
} else {
|
268
|
-
if (aggregate && !ruby.is_a(resolution_self, ruby.lookup({ "Facter", "Core", "Aggregate"}))) {
|
269
|
-
ruby.rb_raise(*ruby.rb_eArgError,
|
270
|
-
_("cannot define an aggregate resolution with name \"{1}\": a simple resolution with the same name already exists",
|
271
|
-
ruby.rb_string_value_ptr(&name)).c_str());
|
272
|
-
} else if (!aggregate && !ruby.is_a(resolution_self, ruby.lookup({ "Facter", "Util", "Resolution"}))) {
|
273
|
-
ruby.rb_raise(*ruby.rb_eArgError,
|
274
|
-
_("cannot define a simple resolution with name \"{1}\": an aggregate resolution with the same name already exists",
|
275
|
-
ruby.rb_string_value_ptr(&name)).c_str());
|
276
|
-
}
|
277
|
-
}
|
278
|
-
|
279
|
-
// Set the name, value, and weight
|
280
|
-
auto res = ruby.to_native<resolution>(resolution_self);
|
281
|
-
res->name(name);
|
282
|
-
res->value(resolution_value);
|
283
|
-
if (has_weight) {
|
284
|
-
res->weight(weight);
|
285
|
-
}
|
286
|
-
|
287
|
-
// Call the block if one was given
|
288
|
-
if (ruby.rb_block_given_p()) {
|
289
|
-
ruby.rb_funcall_passing_block(resolution_self, ruby.rb_intern("instance_eval"), 0, nullptr);
|
290
|
-
}
|
291
|
-
return resolution_self;
|
292
|
-
}
|
293
|
-
|
294
|
-
void fact::flush()
|
295
|
-
{
|
296
|
-
auto const& ruby = api::instance();
|
297
|
-
|
298
|
-
// Call flush on every resolution
|
299
|
-
for (auto r : _resolutions) {
|
300
|
-
ruby.to_native<resolution>(r)->flush();
|
301
|
-
}
|
302
|
-
|
303
|
-
// Reset the value
|
304
|
-
_resolved = false;
|
305
|
-
_value = ruby.nil_value();
|
306
|
-
}
|
307
|
-
|
308
|
-
VALUE fact::alloc(VALUE klass)
|
309
|
-
{
|
310
|
-
auto const& ruby = api::instance();
|
311
|
-
|
312
|
-
// Create a fact and wrap with a Ruby data object
|
313
|
-
unique_ptr<fact> f(new fact());
|
314
|
-
VALUE self = f->_self = ruby.rb_data_object_alloc(klass, f.get(), mark, free);
|
315
|
-
ruby.register_data_object(self);
|
316
|
-
|
317
|
-
// Release the smart pointer; ownership is now with Ruby's GC
|
318
|
-
f.release();
|
319
|
-
return self;
|
320
|
-
}
|
321
|
-
|
322
|
-
void fact::mark(void* data)
|
323
|
-
{
|
324
|
-
// Mark all VALUEs contained in the fact
|
325
|
-
auto const& ruby = api::instance();
|
326
|
-
auto instance = reinterpret_cast<fact*>(data);
|
327
|
-
|
328
|
-
// Mark the name and value
|
329
|
-
ruby.rb_gc_mark(instance->_name);
|
330
|
-
ruby.rb_gc_mark(instance->_value);
|
331
|
-
|
332
|
-
// Mark the resolutions
|
333
|
-
for (auto v : instance->_resolutions) {
|
334
|
-
ruby.rb_gc_mark(v);
|
335
|
-
}
|
336
|
-
}
|
337
|
-
|
338
|
-
void fact::free(void* data)
|
339
|
-
{
|
340
|
-
auto instance = reinterpret_cast<fact*>(data);
|
341
|
-
|
342
|
-
// Unregister the data object
|
343
|
-
auto const& ruby = api::instance();
|
344
|
-
ruby.unregister_data_object(instance->_self);
|
345
|
-
|
346
|
-
// Delete the fact
|
347
|
-
delete instance;
|
348
|
-
}
|
349
|
-
|
350
|
-
VALUE fact::ruby_initialize(VALUE self, VALUE name)
|
351
|
-
{
|
352
|
-
auto const& ruby = api::instance();
|
353
|
-
|
354
|
-
if (!ruby.is_string(name) && !ruby.is_symbol(name)) {
|
355
|
-
ruby.rb_raise(*ruby.rb_eTypeError, _("expected a String or Symbol for fact name").c_str());
|
356
|
-
}
|
357
|
-
|
358
|
-
ruby.to_native<fact>(self)->_name = name;
|
359
|
-
return self;
|
360
|
-
}
|
361
|
-
|
362
|
-
VALUE fact::ruby_name(VALUE self)
|
363
|
-
{
|
364
|
-
auto const& ruby = api::instance();
|
365
|
-
return ruby.to_native<fact>(self)->name();
|
366
|
-
}
|
367
|
-
|
368
|
-
VALUE fact::ruby_value(VALUE self)
|
369
|
-
{
|
370
|
-
auto const& ruby = api::instance();
|
371
|
-
return ruby.to_native<fact>(self)->value();
|
372
|
-
}
|
373
|
-
|
374
|
-
VALUE fact::ruby_resolution(VALUE self, VALUE name)
|
375
|
-
{
|
376
|
-
auto const& ruby = api::instance();
|
377
|
-
return ruby.to_native<fact>(self)->find_resolution(name);
|
378
|
-
}
|
379
|
-
|
380
|
-
VALUE fact::ruby_define_resolution(int argc, VALUE* argv, VALUE self)
|
381
|
-
{
|
382
|
-
auto const& ruby = api::instance();
|
383
|
-
|
384
|
-
if (argc == 0 || argc > 2) {
|
385
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("wrong number of arguments ({1} for 2)", argc).c_str());
|
386
|
-
}
|
387
|
-
|
388
|
-
return ruby.to_native<fact>(self)->define_resolution(argv[0], argc > 1 ? argv[1] : ruby.nil_value());
|
389
|
-
}
|
390
|
-
|
391
|
-
VALUE fact::ruby_flush(VALUE self)
|
392
|
-
{
|
393
|
-
auto const& ruby = api::instance();
|
394
|
-
ruby.to_native<fact>(self)->flush();
|
395
|
-
return ruby.nil_value();
|
396
|
-
}
|
397
|
-
|
398
|
-
}} // namespace facter::ruby
|
@@ -1,1130 +0,0 @@
|
|
1
|
-
#include <internal/ruby/module.hpp>
|
2
|
-
#include <internal/ruby/aggregate_resolution.hpp>
|
3
|
-
#include <internal/ruby/confine.hpp>
|
4
|
-
#include <internal/ruby/simple_resolution.hpp>
|
5
|
-
#include <facter/facts/collection.hpp>
|
6
|
-
#include <facter/logging/logging.hpp>
|
7
|
-
#include <facter/util/config.hpp>
|
8
|
-
#include <facter/version.h>
|
9
|
-
#include <facter/export.h>
|
10
|
-
#include <leatherman/util/environment.hpp>
|
11
|
-
#include <leatherman/execution/execution.hpp>
|
12
|
-
#include <leatherman/file_util/directory.hpp>
|
13
|
-
#include <leatherman/logging/logging.hpp>
|
14
|
-
#include <leatherman/locale/locale.hpp>
|
15
|
-
#include <boost/filesystem.hpp>
|
16
|
-
#include <boost/algorithm/string.hpp>
|
17
|
-
#include <boost/nowide/iostream.hpp>
|
18
|
-
#include <boost/nowide/convert.hpp>
|
19
|
-
#include <stdexcept>
|
20
|
-
#include <functional>
|
21
|
-
#include <facter/facts/scalar_value.hpp>
|
22
|
-
#include <facter/facts/array_value.hpp>
|
23
|
-
#include <facter/facts/map_value.hpp>
|
24
|
-
#include <internal/ruby/ruby_value.hpp>
|
25
|
-
|
26
|
-
// Mark string for translation (alias for leatherman::locale::format)
|
27
|
-
using leatherman::locale::_;
|
28
|
-
|
29
|
-
using namespace std;
|
30
|
-
using namespace facter::facts;
|
31
|
-
using namespace facter::util::config;
|
32
|
-
using namespace leatherman::execution;
|
33
|
-
using namespace leatherman::file_util;
|
34
|
-
using namespace leatherman::util;
|
35
|
-
using namespace boost::filesystem;
|
36
|
-
using namespace leatherman::logging;
|
37
|
-
using namespace leatherman::ruby;
|
38
|
-
|
39
|
-
namespace facter { namespace ruby {
|
40
|
-
|
41
|
-
/**
|
42
|
-
* Helper for maintaining context when initialized via a Ruby require.
|
43
|
-
*/
|
44
|
-
struct require_context
|
45
|
-
{
|
46
|
-
/**
|
47
|
-
* Constructs a new require context.
|
48
|
-
*/
|
49
|
-
require_context()
|
50
|
-
{
|
51
|
-
// Create a collection and a facter module
|
52
|
-
boost::program_options::variables_map vm;
|
53
|
-
auto hocon_conf = load_default_config_file();
|
54
|
-
load_fact_settings(hocon_conf, vm);
|
55
|
-
set<string> blocklist;
|
56
|
-
if (vm.count("blocklist")) {
|
57
|
-
auto facts_to_block = vm["blocklist"].as<vector<string>>();
|
58
|
-
blocklist.insert(facts_to_block.begin(), facts_to_block.end());
|
59
|
-
}
|
60
|
-
auto ttls = load_ttls(hocon_conf);
|
61
|
-
_facts.reset(new collection(blocklist, ttls));
|
62
|
-
_module.reset(new module(*_facts));
|
63
|
-
|
64
|
-
// Ruby doesn't have a proper way of notifying extensions that the VM is shutting down
|
65
|
-
// The easiest way to get notified is to have a global data object that never gets collected
|
66
|
-
// until the VM shuts down
|
67
|
-
auto const& ruby = api::instance();
|
68
|
-
_canary = ruby.rb_data_object_alloc(*ruby.rb_cObject, this, nullptr, cleanup);
|
69
|
-
ruby.rb_gc_register_address(&_canary);
|
70
|
-
ruby.register_data_object(_canary);
|
71
|
-
}
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Destructs the require context.
|
75
|
-
*/
|
76
|
-
~require_context()
|
77
|
-
{
|
78
|
-
_module.reset();
|
79
|
-
_facts.reset();
|
80
|
-
|
81
|
-
// Remove the finalizer and let Ruby collect the object
|
82
|
-
auto const& ruby = api::instance();
|
83
|
-
ruby.rb_gc_unregister_address(&_canary);
|
84
|
-
ruby.unregister_data_object(_canary);
|
85
|
-
}
|
86
|
-
|
87
|
-
/**
|
88
|
-
* Creates the require context.
|
89
|
-
*/
|
90
|
-
static void create()
|
91
|
-
{
|
92
|
-
// Reset first before allocating a new context
|
93
|
-
reset();
|
94
|
-
|
95
|
-
_instance.reset(new require_context());
|
96
|
-
}
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Resets the require context.
|
100
|
-
*/
|
101
|
-
static void reset()
|
102
|
-
{
|
103
|
-
_instance.reset();
|
104
|
-
}
|
105
|
-
|
106
|
-
private:
|
107
|
-
static void cleanup(void* ptr)
|
108
|
-
{
|
109
|
-
if (ptr == _instance.get()) {
|
110
|
-
reset();
|
111
|
-
}
|
112
|
-
}
|
113
|
-
|
114
|
-
unique_ptr<collection> _facts;
|
115
|
-
unique_ptr<module> _module;
|
116
|
-
VALUE _canary;
|
117
|
-
|
118
|
-
static unique_ptr<require_context> _instance;
|
119
|
-
};
|
120
|
-
|
121
|
-
unique_ptr<require_context> require_context::_instance;
|
122
|
-
}}
|
123
|
-
|
124
|
-
// Exports for a Ruby extension.
|
125
|
-
extern "C" {
|
126
|
-
/**
|
127
|
-
* Called by the Ruby VM when native facter is required.
|
128
|
-
*/
|
129
|
-
void LIBFACTER_EXPORT Init_libfacter()
|
130
|
-
{
|
131
|
-
bool logging_init_failed = false;
|
132
|
-
string logging_init_error_msg;
|
133
|
-
try {
|
134
|
-
facter::logging::setup_logging(boost::nowide::cerr);
|
135
|
-
set_level(log_level::warning);
|
136
|
-
} catch(facter::logging::locale_error const& e) {
|
137
|
-
logging_init_failed = true;
|
138
|
-
logging_init_error_msg = e.what();
|
139
|
-
}
|
140
|
-
|
141
|
-
// Initialize ruby
|
142
|
-
api* ruby = nullptr;
|
143
|
-
try {
|
144
|
-
ruby = &api::instance();
|
145
|
-
} catch (runtime_error& ex) {
|
146
|
-
if (!logging_init_failed) {
|
147
|
-
LOG_WARNING("{1}: facts requiring Ruby will not be resolved.", ex.what());
|
148
|
-
} else {
|
149
|
-
// This could only happen if some non-ruby library
|
150
|
-
// consumer called this function for some reason and
|
151
|
-
// we didn't have a libruby loaded. AND the locales
|
152
|
-
// are messed up so badly that even resetting locale
|
153
|
-
// environment variables fails. This seems so
|
154
|
-
// astronomically unlikely that I don't really think
|
155
|
-
// it's worth figuring out what we should do in this
|
156
|
-
// case - I'm honestly not even sure there's a correct
|
157
|
-
// behavior at this point.
|
158
|
-
// -- Branan
|
159
|
-
}
|
160
|
-
return;
|
161
|
-
}
|
162
|
-
|
163
|
-
ruby->initialize();
|
164
|
-
|
165
|
-
// If logging init failed, we'll raise a load error
|
166
|
-
// here. Otherwise we Create the context
|
167
|
-
if (logging_init_failed) {
|
168
|
-
ruby->rb_raise(*ruby->rb_eLoadError, _("could not initialize facter due to a locale error: {1}", logging_init_error_msg).c_str());
|
169
|
-
} else {
|
170
|
-
facter::ruby::require_context::create();
|
171
|
-
}
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
namespace facter { namespace ruby {
|
176
|
-
|
177
|
-
static string canonicalize(string p)
|
178
|
-
{
|
179
|
-
// Get the canonical/absolute directory name
|
180
|
-
// If it can be resolved, use canonical to avoid duplicate search paths.
|
181
|
-
// Fall back to absolute because canonical on Windows won't recognize paths as valid if
|
182
|
-
// they resolve to symlinks to non-NTFS volumes.
|
183
|
-
boost::system::error_code ec;
|
184
|
-
auto directory = canonical(p, ec);
|
185
|
-
if (ec) {
|
186
|
-
return absolute(p).string();
|
187
|
-
}
|
188
|
-
return directory.string();
|
189
|
-
}
|
190
|
-
|
191
|
-
map<VALUE, module*> module::_instances;
|
192
|
-
|
193
|
-
module::module(collection& facts, vector<string> const& paths, bool logging_hooks) :
|
194
|
-
_collection(facts),
|
195
|
-
_loaded_all(false)
|
196
|
-
{
|
197
|
-
auto const& ruby = api::instance();
|
198
|
-
if (!ruby.initialized()) {
|
199
|
-
throw runtime_error(_("Ruby API is not initialized.").c_str());
|
200
|
-
}
|
201
|
-
|
202
|
-
// Load global settigs from config file
|
203
|
-
load_global_settings(load_default_config_file(), _config_file_settings);
|
204
|
-
|
205
|
-
initialize_search_paths(paths);
|
206
|
-
|
207
|
-
// Register the block for logging callback with the GC
|
208
|
-
_on_message_block = ruby.nil_value();
|
209
|
-
ruby.rb_gc_register_address(&_on_message_block);
|
210
|
-
|
211
|
-
// Install a logging message handler
|
212
|
-
on_message([this](log_level level, string const& message) {
|
213
|
-
auto const& ruby = api::instance();
|
214
|
-
|
215
|
-
if (ruby.is_nil(_on_message_block)) {
|
216
|
-
return true;
|
217
|
-
}
|
218
|
-
|
219
|
-
// Call the block and don't log messages
|
220
|
-
ruby.rescue([&]() {
|
221
|
-
ruby.rb_funcall(_on_message_block, ruby.rb_intern("call"), 2, level_to_symbol(level), ruby.utf8_value(message));
|
222
|
-
return ruby.nil_value();
|
223
|
-
}, [&](VALUE) {
|
224
|
-
// Logging can take place from locations where we do not expect Ruby exceptions to be raised
|
225
|
-
// Therefore, intentionally swallow any exceptions.
|
226
|
-
return ruby.nil_value();
|
227
|
-
});
|
228
|
-
return false;
|
229
|
-
});
|
230
|
-
|
231
|
-
// Define the Facter module
|
232
|
-
_self = ruby.rb_define_module("Facter");
|
233
|
-
_instances[_self] = this;
|
234
|
-
|
235
|
-
VALUE core = ruby.rb_define_module_under(_self, "Core");
|
236
|
-
VALUE execution = ruby.rb_define_module_under(core, "Execution");
|
237
|
-
ruby.rb_define_module_under(_self, "Util");
|
238
|
-
|
239
|
-
// Define the methods on the Facter module
|
240
|
-
volatile VALUE version = ruby.utf8_value(LIBFACTER_VERSION);
|
241
|
-
ruby.rb_const_set(_self, ruby.rb_intern("FACTERVERSION"), version);
|
242
|
-
ruby.rb_define_singleton_method(_self, "version", RUBY_METHOD_FUNC(ruby_version), 0);
|
243
|
-
ruby.rb_define_singleton_method(_self, "add", RUBY_METHOD_FUNC(ruby_add), -1);
|
244
|
-
ruby.rb_define_singleton_method(_self, "define_fact", RUBY_METHOD_FUNC(ruby_define_fact), -1);
|
245
|
-
ruby.rb_define_singleton_method(_self, "value", RUBY_METHOD_FUNC(ruby_value), 1);
|
246
|
-
ruby.rb_define_singleton_method(_self, "[]", RUBY_METHOD_FUNC(ruby_fact), 1);
|
247
|
-
ruby.rb_define_singleton_method(_self, "fact", RUBY_METHOD_FUNC(ruby_fact), 1);
|
248
|
-
ruby.rb_define_singleton_method(_self, "debug", RUBY_METHOD_FUNC(ruby_debug), 1);
|
249
|
-
ruby.rb_define_singleton_method(_self, "debugonce", RUBY_METHOD_FUNC(ruby_debugonce), 1);
|
250
|
-
ruby.rb_define_singleton_method(_self, "warn", RUBY_METHOD_FUNC(ruby_warn), 1);
|
251
|
-
ruby.rb_define_singleton_method(_self, "warnonce", RUBY_METHOD_FUNC(ruby_warnonce), 1);
|
252
|
-
ruby.rb_define_singleton_method(_self, "log_exception", RUBY_METHOD_FUNC(ruby_log_exception), -1);
|
253
|
-
ruby.rb_define_singleton_method(_self, "debugging?", RUBY_METHOD_FUNC(ruby_get_debugging), 0);
|
254
|
-
ruby.rb_define_singleton_method(_self, "trace?", RUBY_METHOD_FUNC(ruby_get_trace), 0);
|
255
|
-
ruby.rb_define_singleton_method(_self, "flush", RUBY_METHOD_FUNC(ruby_flush), 0);
|
256
|
-
ruby.rb_define_singleton_method(_self, "list", RUBY_METHOD_FUNC(ruby_list), 0);
|
257
|
-
ruby.rb_define_singleton_method(_self, "to_hash", RUBY_METHOD_FUNC(ruby_to_hash), 0);
|
258
|
-
ruby.rb_define_singleton_method(_self, "each", RUBY_METHOD_FUNC(ruby_each), 0);
|
259
|
-
ruby.rb_define_singleton_method(_self, "clear", RUBY_METHOD_FUNC(ruby_clear), 0);
|
260
|
-
ruby.rb_define_singleton_method(_self, "reset", RUBY_METHOD_FUNC(ruby_reset), 0);
|
261
|
-
ruby.rb_define_singleton_method(_self, "loadfacts", RUBY_METHOD_FUNC(ruby_loadfacts), 0);
|
262
|
-
ruby.rb_define_singleton_method(_self, "search", RUBY_METHOD_FUNC(ruby_search), -1);
|
263
|
-
ruby.rb_define_singleton_method(_self, "search_path", RUBY_METHOD_FUNC(ruby_search_path), 0);
|
264
|
-
ruby.rb_define_singleton_method(_self, "search_external", RUBY_METHOD_FUNC(ruby_search_external), 1);
|
265
|
-
ruby.rb_define_singleton_method(_self, "search_external_path", RUBY_METHOD_FUNC(ruby_search_external_path), 0);
|
266
|
-
|
267
|
-
// Only define these if requested to do so
|
268
|
-
// This prevents consumers of Facter from altering the logging behavior
|
269
|
-
if (logging_hooks) {
|
270
|
-
ruby.rb_define_singleton_method(_self, "debugging", RUBY_METHOD_FUNC(ruby_set_debugging), 1);
|
271
|
-
ruby.rb_define_singleton_method(_self, "trace", RUBY_METHOD_FUNC(ruby_set_trace), 1);
|
272
|
-
ruby.rb_define_singleton_method(_self, "on_message", RUBY_METHOD_FUNC(ruby_on_message), 0);
|
273
|
-
}
|
274
|
-
|
275
|
-
// Define the execution module
|
276
|
-
ruby.rb_define_singleton_method(execution, "which", RUBY_METHOD_FUNC(ruby_which), 1);
|
277
|
-
ruby.rb_define_singleton_method(execution, "exec", RUBY_METHOD_FUNC(ruby_exec), 1);
|
278
|
-
ruby.rb_define_singleton_method(execution, "execute", RUBY_METHOD_FUNC(ruby_execute), -1);
|
279
|
-
ruby.rb_define_class_under(execution, "ExecutionFailure", *ruby.rb_eStandardError);
|
280
|
-
|
281
|
-
// Define the Fact and resolution classes
|
282
|
-
fact::define();
|
283
|
-
simple_resolution::define();
|
284
|
-
aggregate_resolution::define();
|
285
|
-
|
286
|
-
// Custom facts may `require 'facter'`
|
287
|
-
// To allow those custom facts to still function, add facter.rb to loaded features using the first directory in the load path
|
288
|
-
// Note: use forward slashes in the path even on Windows because that's what Ruby expects in $LOADED_FEATURES
|
289
|
-
volatile VALUE first = ruby.rb_ary_entry(ruby.rb_gv_get("$LOAD_PATH"), 0);
|
290
|
-
if (!ruby.is_nil(first)) {
|
291
|
-
ruby.rb_ary_push(ruby.rb_gv_get("$LOADED_FEATURES"), ruby.utf8_value(ruby.to_string(first) + "/facter.rb"));
|
292
|
-
}
|
293
|
-
}
|
294
|
-
|
295
|
-
module::~module()
|
296
|
-
{
|
297
|
-
_instances.erase(_self);
|
298
|
-
|
299
|
-
clear_facts(false);
|
300
|
-
|
301
|
-
try {
|
302
|
-
api& ruby = api::instance();
|
303
|
-
|
304
|
-
// Unregister the on message block
|
305
|
-
ruby.rb_gc_unregister_address(&_on_message_block);
|
306
|
-
on_message(nullptr);
|
307
|
-
|
308
|
-
// Undefine the module
|
309
|
-
ruby.rb_const_remove(*ruby.rb_cObject, ruby.rb_intern("Facter"));
|
310
|
-
} catch (runtime_error& ex) {
|
311
|
-
LOG_WARNING("{1}: Ruby cleanup ended prematurely", ex.what());
|
312
|
-
return;
|
313
|
-
}
|
314
|
-
}
|
315
|
-
|
316
|
-
void module::search(vector<string> const& paths)
|
317
|
-
{
|
318
|
-
for (auto dir : paths) {
|
319
|
-
_additional_search_paths.emplace_back(dir);
|
320
|
-
_search_paths.emplace_back(canonicalize(_additional_search_paths.back()));
|
321
|
-
}
|
322
|
-
}
|
323
|
-
|
324
|
-
void module::load_facts()
|
325
|
-
{
|
326
|
-
if (_loaded_all) {
|
327
|
-
return;
|
328
|
-
}
|
329
|
-
|
330
|
-
LOG_DEBUG("loading all custom facts.");
|
331
|
-
|
332
|
-
LOG_DEBUG("loading custom fact directories from config file");
|
333
|
-
if (_config_file_settings.count("custom-dir")) {
|
334
|
-
auto config_paths = _config_file_settings["custom-dir"].as<vector<string>>();
|
335
|
-
_search_paths.insert(_search_paths.end(), config_paths.begin(), config_paths.end());
|
336
|
-
}
|
337
|
-
|
338
|
-
for (auto const& directory : _search_paths) {
|
339
|
-
LOG_DEBUG("searching for custom facts in {1}.", directory);
|
340
|
-
each_file(directory, [&](string const& file) {
|
341
|
-
load_file(file);
|
342
|
-
return true;
|
343
|
-
}, "\\.rb$");
|
344
|
-
}
|
345
|
-
|
346
|
-
_loaded_all = true;
|
347
|
-
}
|
348
|
-
|
349
|
-
void module::resolve_facts()
|
350
|
-
{
|
351
|
-
// Before we do anything, call facts to ensure the collection is populated
|
352
|
-
facts();
|
353
|
-
|
354
|
-
load_facts();
|
355
|
-
|
356
|
-
auto const& ruby = api::instance();
|
357
|
-
|
358
|
-
// Get the value from all facts
|
359
|
-
for (auto const& kvp : _facts) {
|
360
|
-
ruby.to_native<fact>(kvp.second)->value();
|
361
|
-
}
|
362
|
-
}
|
363
|
-
|
364
|
-
void module::clear_facts(bool clear_collection)
|
365
|
-
{
|
366
|
-
auto const& ruby = api::instance();
|
367
|
-
|
368
|
-
// Unregister all the facts
|
369
|
-
for (auto& kvp : _facts) {
|
370
|
-
ruby.rb_gc_unregister_address(&kvp.second);
|
371
|
-
}
|
372
|
-
|
373
|
-
// Clear the custom facts
|
374
|
-
_facts.clear();
|
375
|
-
|
376
|
-
// Clear the collection
|
377
|
-
if (clear_collection) {
|
378
|
-
_collection.clear();
|
379
|
-
}
|
380
|
-
}
|
381
|
-
|
382
|
-
VALUE module::fact_value(VALUE name)
|
383
|
-
{
|
384
|
-
auto const& ruby = api::instance();
|
385
|
-
|
386
|
-
VALUE fact_self = load_fact(name);
|
387
|
-
if (ruby.is_nil(fact_self)) {
|
388
|
-
return ruby.nil_value();
|
389
|
-
}
|
390
|
-
|
391
|
-
return ruby.to_native<fact>(fact_self)->value();
|
392
|
-
}
|
393
|
-
|
394
|
-
VALUE module::to_ruby(value const* val) const
|
395
|
-
{
|
396
|
-
auto const& ruby = api::instance();
|
397
|
-
|
398
|
-
if (!val) {
|
399
|
-
return ruby.nil_value();
|
400
|
-
}
|
401
|
-
if (auto ptr = dynamic_cast<facter::ruby::ruby_value const*>(val)) {
|
402
|
-
return ptr->value();
|
403
|
-
}
|
404
|
-
if (auto ptr = dynamic_cast<string_value const*>(val)) {
|
405
|
-
return ruby.utf8_value(ptr->value());
|
406
|
-
}
|
407
|
-
if (auto ptr = dynamic_cast<integer_value const*>(val)) {
|
408
|
-
return ruby.rb_ll2inum(static_cast<LONG_LONG>(ptr->value()));
|
409
|
-
}
|
410
|
-
if (auto ptr = dynamic_cast<boolean_value const*>(val)) {
|
411
|
-
return ptr->value() ? ruby.true_value() : ruby.false_value();
|
412
|
-
}
|
413
|
-
if (auto ptr = dynamic_cast<double_value const*>(val)) {
|
414
|
-
return ruby.rb_float_new_in_heap(ptr->value());
|
415
|
-
}
|
416
|
-
if (auto ptr = dynamic_cast<array_value const*>(val)) {
|
417
|
-
volatile VALUE array = ruby.rb_ary_new_capa(static_cast<long>(ptr->size()));
|
418
|
-
ptr->each([&](value const* element) {
|
419
|
-
ruby.rb_ary_push(array, to_ruby(element));
|
420
|
-
return true;
|
421
|
-
});
|
422
|
-
return array;
|
423
|
-
}
|
424
|
-
if (auto ptr = dynamic_cast<map_value const*>(val)) {
|
425
|
-
volatile VALUE hash = ruby.rb_hash_new();
|
426
|
-
ptr->each([&](string const& name, value const* element) {
|
427
|
-
ruby.rb_hash_aset(hash, ruby.utf8_value(name), to_ruby(element));
|
428
|
-
return true;
|
429
|
-
});
|
430
|
-
return hash;
|
431
|
-
}
|
432
|
-
return ruby.nil_value();
|
433
|
-
}
|
434
|
-
|
435
|
-
VALUE module::normalize(VALUE name) const
|
436
|
-
{
|
437
|
-
auto const& ruby = api::instance();
|
438
|
-
|
439
|
-
if (ruby.is_symbol(name)) {
|
440
|
-
name = ruby.rb_sym_to_s(name);
|
441
|
-
}
|
442
|
-
if (ruby.is_string(name)) {
|
443
|
-
name = ruby.rb_funcall(name, ruby.rb_intern("downcase"), 0);
|
444
|
-
}
|
445
|
-
return name;
|
446
|
-
}
|
447
|
-
|
448
|
-
collection& module::facts()
|
449
|
-
{
|
450
|
-
if (_collection.empty()) {
|
451
|
-
bool include_ruby_facts = true;
|
452
|
-
_collection.add_default_facts(include_ruby_facts);
|
453
|
-
_collection.add_external_facts(_external_search_paths);
|
454
|
-
|
455
|
-
auto const& ruby = api::instance();
|
456
|
-
_collection.add_environment_facts([&](string const& name) {
|
457
|
-
// Create a fact and explicitly set the value
|
458
|
-
// We honor environment variables above custom fact resolutions
|
459
|
-
ruby.to_native<fact>(create_fact(ruby.utf8_value(name)))->value(to_ruby(_collection[name]));
|
460
|
-
});
|
461
|
-
}
|
462
|
-
return _collection;
|
463
|
-
}
|
464
|
-
|
465
|
-
VALUE module::self() const
|
466
|
-
{
|
467
|
-
return _self;
|
468
|
-
}
|
469
|
-
|
470
|
-
module* module::current()
|
471
|
-
{
|
472
|
-
auto const& ruby = api::instance();
|
473
|
-
return from_self(ruby.lookup({"Facter"}));
|
474
|
-
}
|
475
|
-
|
476
|
-
static VALUE safe_eval(char const* scope, function<VALUE()> body)
|
477
|
-
{
|
478
|
-
try {
|
479
|
-
return body();
|
480
|
-
} catch (exception const& e) {
|
481
|
-
LOG_ERROR("{1} uncaught exception: {2}", scope, e.what());
|
482
|
-
}
|
483
|
-
return api::instance().nil_value();
|
484
|
-
}
|
485
|
-
|
486
|
-
VALUE module::ruby_version(VALUE self)
|
487
|
-
{
|
488
|
-
return safe_eval("Facter.version", [&]() {
|
489
|
-
auto const& ruby = api::instance();
|
490
|
-
return ruby.lookup({ "Facter", "FACTERVERSION" });
|
491
|
-
});
|
492
|
-
}
|
493
|
-
|
494
|
-
VALUE module::ruby_add(int argc, VALUE* argv, VALUE self)
|
495
|
-
{
|
496
|
-
return safe_eval("Facter.add", [&]() {
|
497
|
-
auto const& ruby = api::instance();
|
498
|
-
|
499
|
-
if (argc == 0 || argc > 2) {
|
500
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("wrong number of arguments ({1} for 2)", argc).c_str());
|
501
|
-
}
|
502
|
-
|
503
|
-
VALUE fact_self = from_self(self)->create_fact(argv[0]);
|
504
|
-
|
505
|
-
// Read the resolution name from the options hash, if present
|
506
|
-
volatile VALUE name = ruby.nil_value();
|
507
|
-
VALUE options = argc == 2 ? argv[1] : ruby.nil_value();
|
508
|
-
if (!ruby.is_nil(options)) {
|
509
|
-
name = ruby.rb_funcall(options, ruby.rb_intern("delete"), 1, ruby.to_symbol("name"));
|
510
|
-
}
|
511
|
-
|
512
|
-
ruby.to_native<fact>(fact_self)->define_resolution(name, options);
|
513
|
-
return fact_self;
|
514
|
-
});
|
515
|
-
}
|
516
|
-
|
517
|
-
VALUE module::ruby_define_fact(int argc, VALUE* argv, VALUE self)
|
518
|
-
{
|
519
|
-
return safe_eval("Facter.define_fact", [&]() {
|
520
|
-
auto const& ruby = api::instance();
|
521
|
-
|
522
|
-
if (argc == 0 || argc > 2) {
|
523
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("wrong number of arguments ({1} for 2)", argc).c_str());
|
524
|
-
}
|
525
|
-
|
526
|
-
VALUE fact_self = from_self(self)->create_fact(argv[0]);
|
527
|
-
|
528
|
-
// Call the block if one was given
|
529
|
-
if (ruby.rb_block_given_p()) {
|
530
|
-
ruby.rb_funcall_passing_block(fact_self, ruby.rb_intern("instance_eval"), 0, nullptr);
|
531
|
-
}
|
532
|
-
return fact_self;
|
533
|
-
});
|
534
|
-
}
|
535
|
-
|
536
|
-
VALUE module::ruby_value(VALUE self, VALUE name)
|
537
|
-
{
|
538
|
-
return safe_eval("Facter.value", [&]() {
|
539
|
-
return from_self(self)->fact_value(name);
|
540
|
-
});
|
541
|
-
}
|
542
|
-
|
543
|
-
VALUE module::ruby_fact(VALUE self, VALUE name)
|
544
|
-
{
|
545
|
-
return safe_eval("Facter.fact", [&]() {
|
546
|
-
return from_self(self)->load_fact(name);
|
547
|
-
});
|
548
|
-
}
|
549
|
-
|
550
|
-
VALUE module::ruby_debug(VALUE self, VALUE message)
|
551
|
-
{
|
552
|
-
return safe_eval("Facter.debug", [&]() {
|
553
|
-
auto const& ruby = api::instance();
|
554
|
-
LOG_DEBUG(ruby.to_string(message));
|
555
|
-
return ruby.nil_value();
|
556
|
-
});
|
557
|
-
}
|
558
|
-
|
559
|
-
VALUE module::ruby_debugonce(VALUE self, VALUE message)
|
560
|
-
{
|
561
|
-
return safe_eval("Facter.debugonce", [&]() {
|
562
|
-
auto const& ruby = api::instance();
|
563
|
-
|
564
|
-
string msg = ruby.to_string(message);
|
565
|
-
if (from_self(self)->_debug_messages.insert(msg).second) {
|
566
|
-
LOG_DEBUG(msg);
|
567
|
-
}
|
568
|
-
return ruby.nil_value();
|
569
|
-
});
|
570
|
-
}
|
571
|
-
|
572
|
-
VALUE module::ruby_warn(VALUE self, VALUE message)
|
573
|
-
{
|
574
|
-
return safe_eval("Facter.warn", [&]() {
|
575
|
-
auto const& ruby = api::instance();
|
576
|
-
LOG_WARNING(ruby.to_string(message));
|
577
|
-
return ruby.nil_value();
|
578
|
-
});
|
579
|
-
}
|
580
|
-
|
581
|
-
VALUE module::ruby_warnonce(VALUE self, VALUE message)
|
582
|
-
{
|
583
|
-
return safe_eval("Facter.warnonce", [&]() {
|
584
|
-
auto const& ruby = api::instance();
|
585
|
-
|
586
|
-
string msg = ruby.to_string(message);
|
587
|
-
if (from_self(self)->_warning_messages.insert(msg).second) {
|
588
|
-
LOG_WARNING(msg);
|
589
|
-
}
|
590
|
-
return ruby.nil_value();
|
591
|
-
});
|
592
|
-
}
|
593
|
-
|
594
|
-
VALUE module::ruby_set_debugging(VALUE self, VALUE value)
|
595
|
-
{
|
596
|
-
return safe_eval("Facter.debugging", [&]() {
|
597
|
-
auto const& ruby = api::instance();
|
598
|
-
|
599
|
-
if (ruby.is_true(value)) {
|
600
|
-
set_level(log_level::debug);
|
601
|
-
} else {
|
602
|
-
set_level(log_level::warning);
|
603
|
-
}
|
604
|
-
return ruby_get_debugging(self);
|
605
|
-
});
|
606
|
-
}
|
607
|
-
|
608
|
-
VALUE module::ruby_get_debugging(VALUE self)
|
609
|
-
{
|
610
|
-
return safe_eval("Facter.debugging?", [&]() {
|
611
|
-
auto const& ruby = api::instance();
|
612
|
-
return is_enabled(log_level::debug) ? ruby.true_value() : ruby.false_value();
|
613
|
-
});
|
614
|
-
}
|
615
|
-
|
616
|
-
VALUE module::ruby_set_trace(VALUE self, VALUE value)
|
617
|
-
{
|
618
|
-
return safe_eval("Facter.trace", [&]() {
|
619
|
-
auto& ruby = api::instance();
|
620
|
-
ruby.include_stack_trace(ruby.is_true(value));
|
621
|
-
return ruby_get_trace(self);
|
622
|
-
});
|
623
|
-
}
|
624
|
-
|
625
|
-
VALUE module::ruby_get_trace(VALUE self)
|
626
|
-
{
|
627
|
-
return safe_eval("Facter.trace?", [&]() {
|
628
|
-
auto const& ruby = api::instance();
|
629
|
-
return ruby.include_stack_trace() ? ruby.true_value() : ruby.false_value();
|
630
|
-
});
|
631
|
-
}
|
632
|
-
|
633
|
-
VALUE module::ruby_log_exception(int argc, VALUE* argv, VALUE self)
|
634
|
-
{
|
635
|
-
return safe_eval("Facter.log_exception", [&]() {
|
636
|
-
auto const& ruby = api::instance();
|
637
|
-
|
638
|
-
if (argc == 0 || argc > 2) {
|
639
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("wrong number of arguments ({1} for 2)", argc).c_str());
|
640
|
-
}
|
641
|
-
|
642
|
-
string message;
|
643
|
-
if (argc == 2) {
|
644
|
-
// Use the given argument provided it is not a symbol equal to :default
|
645
|
-
if (!ruby.is_symbol(argv[1]) || ruby.rb_to_id(argv[1]) != ruby.rb_intern("default")) {
|
646
|
-
message = ruby.to_string(argv[1]);
|
647
|
-
}
|
648
|
-
}
|
649
|
-
|
650
|
-
LOG_ERROR(ruby.exception_to_string(argv[0], message));
|
651
|
-
return ruby.nil_value();
|
652
|
-
});
|
653
|
-
}
|
654
|
-
|
655
|
-
VALUE module::ruby_flush(VALUE self)
|
656
|
-
{
|
657
|
-
return safe_eval("Facter.flush", [&]() {
|
658
|
-
auto const& ruby = api::instance();
|
659
|
-
|
660
|
-
for (auto& kvp : from_self(self)->_facts)
|
661
|
-
{
|
662
|
-
ruby.to_native<fact>(kvp.second)->flush();
|
663
|
-
}
|
664
|
-
return ruby.nil_value();
|
665
|
-
});
|
666
|
-
}
|
667
|
-
|
668
|
-
VALUE module::ruby_list(VALUE self)
|
669
|
-
{
|
670
|
-
return safe_eval("Facter.list", [&]() {
|
671
|
-
auto const& ruby = api::instance();
|
672
|
-
module* instance = from_self(self);
|
673
|
-
|
674
|
-
instance->resolve_facts();
|
675
|
-
|
676
|
-
volatile VALUE array = ruby.rb_ary_new_capa(instance->facts().size());
|
677
|
-
|
678
|
-
instance->facts().each([&](string const& name, value const*) {
|
679
|
-
ruby.rb_ary_push(array, ruby.utf8_value(name));
|
680
|
-
return true;
|
681
|
-
});
|
682
|
-
|
683
|
-
return array;
|
684
|
-
});
|
685
|
-
}
|
686
|
-
|
687
|
-
VALUE module::ruby_to_hash(VALUE self)
|
688
|
-
{
|
689
|
-
return safe_eval("Facter.to_hash", [&]() {
|
690
|
-
auto const& ruby = api::instance();
|
691
|
-
module* instance = from_self(self);
|
692
|
-
|
693
|
-
instance->resolve_facts();
|
694
|
-
|
695
|
-
volatile VALUE hash = ruby.rb_hash_new();
|
696
|
-
|
697
|
-
instance->facts().each([&](string const& name, value const* val) {
|
698
|
-
ruby.rb_hash_aset(hash, ruby.utf8_value(name), instance->to_ruby(val));
|
699
|
-
return true;
|
700
|
-
});
|
701
|
-
|
702
|
-
return hash;
|
703
|
-
});
|
704
|
-
}
|
705
|
-
|
706
|
-
VALUE module::ruby_each(VALUE self)
|
707
|
-
{
|
708
|
-
return safe_eval("Facter.each", [&]() {
|
709
|
-
auto const& ruby = api::instance();
|
710
|
-
module* instance = from_self(self);
|
711
|
-
|
712
|
-
instance->resolve_facts();
|
713
|
-
|
714
|
-
instance->facts().each([&](string const& name, value const* val) {
|
715
|
-
ruby.rb_yield_values(2, ruby.utf8_value(name), instance->to_ruby(val));
|
716
|
-
return true;
|
717
|
-
});
|
718
|
-
|
719
|
-
return self;
|
720
|
-
});
|
721
|
-
}
|
722
|
-
|
723
|
-
VALUE module::ruby_clear(VALUE self)
|
724
|
-
{
|
725
|
-
return safe_eval("Facter.clear", [&]() {
|
726
|
-
auto const& ruby = api::instance();
|
727
|
-
|
728
|
-
ruby_flush(self);
|
729
|
-
ruby_reset(self);
|
730
|
-
|
731
|
-
return ruby.nil_value();
|
732
|
-
});
|
733
|
-
}
|
734
|
-
|
735
|
-
VALUE module::ruby_reset(VALUE self)
|
736
|
-
{
|
737
|
-
return safe_eval("Facter.reset", [&]() {
|
738
|
-
auto const& ruby = api::instance();
|
739
|
-
module* instance = from_self(self);
|
740
|
-
|
741
|
-
instance->clear_facts();
|
742
|
-
instance->initialize_search_paths({});
|
743
|
-
instance->_external_search_paths.clear();
|
744
|
-
instance->_loaded_all = false;
|
745
|
-
instance->_loaded_files.clear();
|
746
|
-
|
747
|
-
return ruby.nil_value();
|
748
|
-
});
|
749
|
-
}
|
750
|
-
|
751
|
-
VALUE module::ruby_loadfacts(VALUE self)
|
752
|
-
{
|
753
|
-
return safe_eval("Facter.loadfacts", [&]() {
|
754
|
-
auto const& ruby = api::instance();
|
755
|
-
|
756
|
-
from_self(self)->load_facts();
|
757
|
-
return ruby.nil_value();
|
758
|
-
});
|
759
|
-
}
|
760
|
-
|
761
|
-
VALUE module::ruby_search(int argc, VALUE* argv, VALUE self)
|
762
|
-
{
|
763
|
-
return safe_eval("Facter.search", [&]() {
|
764
|
-
auto const& ruby = api::instance();
|
765
|
-
module* instance = from_self(self);
|
766
|
-
|
767
|
-
for (int i = 0; i < argc; ++i) {
|
768
|
-
if (!ruby.is_string(argv[i])) {
|
769
|
-
continue;
|
770
|
-
}
|
771
|
-
|
772
|
-
instance->_additional_search_paths.emplace_back(ruby.to_string(argv[i]));
|
773
|
-
instance->_search_paths.emplace_back(canonicalize(instance->_additional_search_paths.back()));
|
774
|
-
}
|
775
|
-
return ruby.nil_value();
|
776
|
-
});
|
777
|
-
}
|
778
|
-
|
779
|
-
VALUE module::ruby_search_path(VALUE self)
|
780
|
-
{
|
781
|
-
return safe_eval("Facter.search_path", [&]() {
|
782
|
-
auto const& ruby = api::instance();
|
783
|
-
module* instance = from_self(self);
|
784
|
-
|
785
|
-
volatile VALUE array = ruby.rb_ary_new_capa(instance->_additional_search_paths.size());
|
786
|
-
|
787
|
-
for (auto const& path : instance->_additional_search_paths) {
|
788
|
-
ruby.rb_ary_push(array, ruby.utf8_value(path));
|
789
|
-
}
|
790
|
-
return array;
|
791
|
-
});
|
792
|
-
}
|
793
|
-
|
794
|
-
VALUE module::ruby_search_external(VALUE self, VALUE paths)
|
795
|
-
{
|
796
|
-
return safe_eval("Facter.search_external", [&]() {
|
797
|
-
auto const& ruby = api::instance();
|
798
|
-
module* instance = from_self(self);
|
799
|
-
|
800
|
-
ruby.array_for_each(paths, [&](VALUE element) {
|
801
|
-
if (!ruby.is_string(element)) {
|
802
|
-
return true;
|
803
|
-
}
|
804
|
-
instance->_external_search_paths.emplace_back(ruby.to_string(element));
|
805
|
-
return true;
|
806
|
-
});
|
807
|
-
|
808
|
-
// Add external path from config file
|
809
|
-
LOG_DEBUG(_("loading external fact directories from config file"));
|
810
|
-
if (instance->_config_file_settings.count("external-dir")) {
|
811
|
-
auto config_paths = instance->_config_file_settings["external-dir"].as<vector<string>>();
|
812
|
-
instance->_external_search_paths.insert(instance->_external_search_paths.end(), config_paths.begin(), config_paths.end());
|
813
|
-
}
|
814
|
-
return ruby.nil_value();
|
815
|
-
});
|
816
|
-
}
|
817
|
-
|
818
|
-
VALUE module::ruby_search_external_path(VALUE self)
|
819
|
-
{
|
820
|
-
return safe_eval("Facter.search_external_path", [&]() {
|
821
|
-
auto const& ruby = api::instance();
|
822
|
-
module* instance = from_self(self);
|
823
|
-
|
824
|
-
volatile VALUE array = ruby.rb_ary_new_capa(instance->_external_search_paths.size());
|
825
|
-
|
826
|
-
for (auto const& path : instance->_external_search_paths) {
|
827
|
-
ruby.rb_ary_push(array, ruby.utf8_value(path));
|
828
|
-
}
|
829
|
-
return array;
|
830
|
-
});
|
831
|
-
}
|
832
|
-
|
833
|
-
VALUE module::ruby_which(VALUE self, VALUE binary)
|
834
|
-
{
|
835
|
-
return safe_eval("Facter::Core::Execution::which", [&]() {
|
836
|
-
// Note: self is Facter::Core::Execution
|
837
|
-
auto const& ruby = api::instance();
|
838
|
-
|
839
|
-
string path = which(ruby.to_string(binary));
|
840
|
-
if (path.empty()) {
|
841
|
-
return ruby.nil_value();
|
842
|
-
}
|
843
|
-
|
844
|
-
return ruby.utf8_value(path);
|
845
|
-
});
|
846
|
-
}
|
847
|
-
|
848
|
-
VALUE module::ruby_exec(VALUE self, VALUE command)
|
849
|
-
{
|
850
|
-
return safe_eval("Facter::Core::Execution::exec", [&]() {
|
851
|
-
// Note: self is Facter::Core::Execution
|
852
|
-
auto const& ruby = api::instance();
|
853
|
-
return execute_command(ruby.to_string(command), ruby.nil_value(), false);
|
854
|
-
});
|
855
|
-
}
|
856
|
-
|
857
|
-
VALUE module::ruby_execute(int argc, VALUE* argv, VALUE self)
|
858
|
-
{
|
859
|
-
return safe_eval("Facter::Core::Execution::execute", [&]() {
|
860
|
-
// Note: self is Facter::Core::Execution
|
861
|
-
auto const& ruby = api::instance();
|
862
|
-
|
863
|
-
if (argc == 0 || argc > 2) {
|
864
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("wrong number of arguments ({1} for 2)", argc).c_str());
|
865
|
-
}
|
866
|
-
|
867
|
-
if (argc == 1) {
|
868
|
-
return execute_command(ruby.to_string(argv[0]), ruby.nil_value(), true);
|
869
|
-
}
|
870
|
-
|
871
|
-
// Unfortunately we have to call to_sym rather than using ID2SYM, which is Ruby version dependent
|
872
|
-
uint32_t timeout = 0;
|
873
|
-
volatile VALUE timeout_option = ruby.rb_hash_lookup(argv[1], ruby.to_symbol("timeout"));
|
874
|
-
if (ruby.is_integer(timeout_option)) {
|
875
|
-
timeout = ruby.num2size_t(timeout_option);
|
876
|
-
}
|
877
|
-
|
878
|
-
// Get the on_fail option (defaults to :raise)
|
879
|
-
bool raise = false;
|
880
|
-
volatile VALUE raise_value = ruby.to_symbol("raise");
|
881
|
-
volatile VALUE fail_option = ruby.rb_hash_lookup2(argv[1], ruby.to_symbol("on_fail"), raise_value);
|
882
|
-
if (ruby.equals(fail_option, raise_value)) {
|
883
|
-
raise = true;
|
884
|
-
fail_option = ruby.nil_value();
|
885
|
-
}
|
886
|
-
return execute_command(ruby.to_string(argv[0]), fail_option, raise, timeout);
|
887
|
-
});
|
888
|
-
}
|
889
|
-
|
890
|
-
VALUE module::ruby_on_message(VALUE self)
|
891
|
-
{
|
892
|
-
return safe_eval("Facter.on_message", [&]() {
|
893
|
-
auto const& ruby = api::instance();
|
894
|
-
|
895
|
-
from_self(self)->_on_message_block = ruby.rb_block_given_p() ? ruby.rb_block_proc() : ruby.nil_value();
|
896
|
-
return ruby.nil_value();
|
897
|
-
});
|
898
|
-
}
|
899
|
-
|
900
|
-
module* module::from_self(VALUE self)
|
901
|
-
{
|
902
|
-
auto it = _instances.find(self);
|
903
|
-
if (it == _instances.end()) {
|
904
|
-
auto const& ruby = api::instance();
|
905
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("unexpected self value {1}", self).c_str());
|
906
|
-
return nullptr;
|
907
|
-
}
|
908
|
-
return it->second;
|
909
|
-
}
|
910
|
-
|
911
|
-
VALUE module::execute_command(std::string const& command, VALUE failure_default, bool raise, uint32_t timeout)
|
912
|
-
{
|
913
|
-
auto const& ruby = api::instance();
|
914
|
-
|
915
|
-
// Expand the command
|
916
|
-
auto expanded = expand_command(command);
|
917
|
-
|
918
|
-
if (!expanded.empty()) {
|
919
|
-
try {
|
920
|
-
auto exec = execute(
|
921
|
-
command_shell,
|
922
|
-
{
|
923
|
-
command_args,
|
924
|
-
expanded
|
925
|
-
},
|
926
|
-
timeout,
|
927
|
-
{
|
928
|
-
execution_options::trim_output,
|
929
|
-
execution_options::merge_environment,
|
930
|
-
execution_options::redirect_stderr_to_null,
|
931
|
-
execution_options::preserve_arguments
|
932
|
-
});
|
933
|
-
// Ruby can encode some additional information in the
|
934
|
-
// lower 8 bits. None of those set means "process exited normally"
|
935
|
-
ruby.rb_last_status_set(exec.exit_code << 8, static_cast<rb_pid_t>(exec.pid));
|
936
|
-
return ruby.utf8_value(exec.output);
|
937
|
-
} catch (timeout_exception const& ex) {
|
938
|
-
// Always raise for timeouts
|
939
|
-
ruby.rb_raise(ruby.lookup({ "Facter", "Core", "Execution", "ExecutionFailure"}), ex.what());
|
940
|
-
}
|
941
|
-
}
|
942
|
-
// Command was not found
|
943
|
-
if (raise) {
|
944
|
-
if (expanded.empty()) {
|
945
|
-
ruby.rb_raise(ruby.lookup({ "Facter", "Core", "Execution", "ExecutionFailure"}), _("execution of command \"{1}\" failed: command not found.", command).c_str());
|
946
|
-
}
|
947
|
-
ruby.rb_raise(ruby.lookup({ "Facter", "Core", "Execution", "ExecutionFailure"}), _("execution of command \"{1}\" failed.", command).c_str());
|
948
|
-
}
|
949
|
-
return failure_default;
|
950
|
-
}
|
951
|
-
|
952
|
-
void module::initialize_search_paths(vector<string> const& paths)
|
953
|
-
{
|
954
|
-
auto const& ruby = api::instance();
|
955
|
-
|
956
|
-
_search_paths.clear();
|
957
|
-
_additional_search_paths.clear();
|
958
|
-
|
959
|
-
// Look for "facter" subdirectories on the load path
|
960
|
-
for (auto const& directory : ruby.get_load_path()) {
|
961
|
-
boost::system::error_code ec;
|
962
|
-
// Use forward-slash to keep this consistent with Ruby conventions.
|
963
|
-
auto dir = canonicalize(directory) + "/facter";
|
964
|
-
|
965
|
-
// Ignore facter itself if it's on the load path
|
966
|
-
if (is_regular_file(dir, ec)) {
|
967
|
-
continue;
|
968
|
-
}
|
969
|
-
|
970
|
-
if (!is_directory(dir, ec)) {
|
971
|
-
continue;
|
972
|
-
}
|
973
|
-
_search_paths.push_back(dir);
|
974
|
-
}
|
975
|
-
|
976
|
-
// Append the FACTERLIB paths
|
977
|
-
string variable;
|
978
|
-
if (environment::get("FACTERLIB", variable)) {
|
979
|
-
vector<string> env_paths;
|
980
|
-
boost::split(env_paths, variable, bind(equal_to<char>(), placeholders::_1, environment::get_path_separator()), boost::token_compress_on);
|
981
|
-
_search_paths.insert(_search_paths.end(), make_move_iterator(env_paths.begin()), make_move_iterator(env_paths.end()));
|
982
|
-
}
|
983
|
-
|
984
|
-
// Insert the given paths last
|
985
|
-
_search_paths.insert(_search_paths.end(), paths.begin(), paths.end());
|
986
|
-
|
987
|
-
// Do a canonical/absolute transform
|
988
|
-
transform(_search_paths.begin(), _search_paths.end(), _search_paths.begin(), [](string const& directory) -> string {
|
989
|
-
return canonicalize(directory);
|
990
|
-
});
|
991
|
-
|
992
|
-
// Remove anything that is empty using the erase-remove idiom.
|
993
|
-
_search_paths.erase(
|
994
|
-
remove_if(begin(_search_paths), end(_search_paths), [](string const& path) { return path.empty(); }),
|
995
|
-
end(_search_paths));
|
996
|
-
}
|
997
|
-
|
998
|
-
VALUE module::load_fact(VALUE name)
|
999
|
-
{
|
1000
|
-
auto const& ruby = api::instance();
|
1001
|
-
|
1002
|
-
name = normalize(name);
|
1003
|
-
string fact_name = ruby.to_string(name);
|
1004
|
-
|
1005
|
-
// First check to see if we have that fact already
|
1006
|
-
auto it = _facts.find(fact_name);
|
1007
|
-
if (it != _facts.end()) {
|
1008
|
-
return it->second;
|
1009
|
-
}
|
1010
|
-
|
1011
|
-
// Try to load it by file name
|
1012
|
-
if (!_loaded_all) {
|
1013
|
-
// Next, attempt to load it by file
|
1014
|
-
string filename = fact_name + ".rb";
|
1015
|
-
LOG_DEBUG("searching for custom fact \"{1}\".", fact_name);
|
1016
|
-
|
1017
|
-
for (auto const& directory : _search_paths) {
|
1018
|
-
LOG_DEBUG("searching for {1} in {2}.", filename, directory);
|
1019
|
-
|
1020
|
-
// Check to see if there's a file of a matching name in this directory
|
1021
|
-
path full_path = path(directory) / filename;
|
1022
|
-
boost::system::error_code ec;
|
1023
|
-
if (!is_regular_file(full_path, ec)) {
|
1024
|
-
continue;
|
1025
|
-
}
|
1026
|
-
|
1027
|
-
// Load the fact file
|
1028
|
-
load_file(full_path.string());
|
1029
|
-
}
|
1030
|
-
|
1031
|
-
// Check to see if we now have the fact
|
1032
|
-
it = _facts.find(fact_name);
|
1033
|
-
if (it != _facts.end()) {
|
1034
|
-
return it->second;
|
1035
|
-
}
|
1036
|
-
}
|
1037
|
-
|
1038
|
-
// Otherwise, check to see if it's already in the collection
|
1039
|
-
auto value = facts()[fact_name];
|
1040
|
-
if (value) {
|
1041
|
-
return create_fact(name);
|
1042
|
-
}
|
1043
|
-
|
1044
|
-
// Couldn't load the fact by file name, load all facts to try to find it
|
1045
|
-
load_facts();
|
1046
|
-
|
1047
|
-
// Check to see if we now have the fact
|
1048
|
-
it = _facts.find(fact_name);
|
1049
|
-
if (it != _facts.end()) {
|
1050
|
-
return it->second;
|
1051
|
-
}
|
1052
|
-
|
1053
|
-
// Couldn't find the fact
|
1054
|
-
LOG_DEBUG("custom fact \"{1}\" was not found.", fact_name);
|
1055
|
-
return ruby.nil_value();
|
1056
|
-
}
|
1057
|
-
|
1058
|
-
void module::load_file(std::string const& path)
|
1059
|
-
{
|
1060
|
-
// Only load the file if we haven't done so before
|
1061
|
-
if (!_loaded_files.insert(path).second) {
|
1062
|
-
return;
|
1063
|
-
}
|
1064
|
-
|
1065
|
-
auto const& ruby = api::instance();
|
1066
|
-
|
1067
|
-
LOG_INFO("loading custom facts from {1}.", path);
|
1068
|
-
ruby.rescue([&]() {
|
1069
|
-
// Do not construct C++ objects in a rescue callback
|
1070
|
-
// C++ stack unwinding will not take place if a Ruby exception is thrown!
|
1071
|
-
ruby.rb_load(ruby.utf8_value(path), 0);
|
1072
|
-
return 0;
|
1073
|
-
}, [&](VALUE ex) {
|
1074
|
-
LOG_ERROR("error while resolving custom facts in {1}: {2}", path, ruby.exception_to_string(ex));
|
1075
|
-
return 0;
|
1076
|
-
});
|
1077
|
-
}
|
1078
|
-
|
1079
|
-
VALUE module::create_fact(VALUE name)
|
1080
|
-
{
|
1081
|
-
auto const& ruby = api::instance();
|
1082
|
-
|
1083
|
-
if (!ruby.is_string(name) && !ruby.is_symbol(name)) {
|
1084
|
-
ruby.rb_raise(*ruby.rb_eTypeError, _("expected a String or Symbol for fact name").c_str());
|
1085
|
-
}
|
1086
|
-
|
1087
|
-
name = normalize(name);
|
1088
|
-
string fact_name = ruby.to_string(name);
|
1089
|
-
|
1090
|
-
// First check to see if we have that fact already
|
1091
|
-
auto it = _facts.find(fact_name);
|
1092
|
-
if (it == _facts.end()) {
|
1093
|
-
// Before adding the first fact, call facts to ensure the collection is populated
|
1094
|
-
facts();
|
1095
|
-
// facts() may add entries to _facts, so check again to ensure entry has not already been added (avoid duplicate Ruby GC registration)
|
1096
|
-
it = _facts.find(fact_name);
|
1097
|
-
if (it == _facts.end()) {
|
1098
|
-
it = _facts.insert(make_pair(fact_name, fact::create(name))).first;
|
1099
|
-
ruby.rb_gc_register_address(&it->second);
|
1100
|
-
}
|
1101
|
-
}
|
1102
|
-
return it->second;
|
1103
|
-
}
|
1104
|
-
|
1105
|
-
VALUE module::level_to_symbol(log_level level)
|
1106
|
-
{
|
1107
|
-
auto const& ruby = api::instance();
|
1108
|
-
|
1109
|
-
char const* name = nullptr;
|
1110
|
-
|
1111
|
-
if (level == log_level::trace) {
|
1112
|
-
name = "trace";
|
1113
|
-
} else if (level == log_level::debug) {
|
1114
|
-
name = "debug";
|
1115
|
-
} else if (level == log_level::info) {
|
1116
|
-
name = "info";
|
1117
|
-
} else if (level == log_level::warning) {
|
1118
|
-
name = "warn";
|
1119
|
-
} else if (level == log_level::error) {
|
1120
|
-
name = "error";
|
1121
|
-
} else if (level == log_level::fatal) {
|
1122
|
-
name = "fatal";
|
1123
|
-
}
|
1124
|
-
if (!name) {
|
1125
|
-
ruby.rb_raise(*ruby.rb_eArgError, _("invalid log level specified.").c_str(), 0);
|
1126
|
-
}
|
1127
|
-
return ruby.to_symbol(name);
|
1128
|
-
}
|
1129
|
-
|
1130
|
-
}} // namespace facter::ruby
|