summaryrefslogtreecommitdiff
path: root/lib/chef/dsl/platform_introspection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/dsl/platform_introspection.rb')
-rw-r--r--lib/chef/dsl/platform_introspection.rb17
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/chef/dsl/platform_introspection.rb b/lib/chef/dsl/platform_introspection.rb
index a3a978d418..d018a9dfef 100644
--- a/lib/chef/dsl/platform_introspection.rb
+++ b/lib/chef/dsl/platform_introspection.rb
@@ -18,15 +18,12 @@
class Chef
module DSL
-
# == Chef::DSL::PlatformIntrospection
# Provides the DSL for platform-dependent switch logic, such as
# #value_for_platform.
module PlatformIntrospection
-
# Implementation class for determining platform dependent values
class PlatformDependentValue
-
# Create a platform dependent value object.
# === Arguments
# platform_hash (Hash) a hash of the same structure as Chef::Platform,
@@ -45,7 +42,7 @@ class Chef
# :default => default_value
def initialize(platform_hash)
@values = {}
- platform_hash.each { |platforms, value| set(platforms, value)}
+ platform_hash.each { |platforms, value| set(platforms, value) }
end
def value_for_node(node)
@@ -110,7 +107,7 @@ class Chef
@values["default"] = value
else
assert_valid_platform_values!(platforms, value)
- Array(platforms).each { |platform| @values[platform.to_s] = normalize_keys(value)}
+ Array(platforms).each { |platform| @values[platform.to_s] = normalize_keys(value) }
value
end
end
@@ -134,8 +131,6 @@ class Chef
end
end
-
-
# Given a hash similar to the one we use for Platforms, select a value from the hash. Supports
# per platform defaults, along with a single base default. Arrays may be passed as hash keys and
# will be expanded.
@@ -168,11 +163,8 @@ class Chef
has_platform
end
-
-
# Implementation class for determining platform family dependent values
class PlatformFamilyDependentValue
-
# Create a platform family dependent value object.
# === Arguments
# platform_family_hash (Hash) a map of platform families to values.
@@ -193,7 +185,7 @@ class Chef
def initialize(platform_family_hash)
@values = {}
@values["default"] = nil
- platform_family_hash.each { |platform_families, value| set(platform_families, value)}
+ platform_family_hash.each { |platform_families, value| set(platform_families, value) }
end
def value_for_node(node)
@@ -221,7 +213,6 @@ class Chef
end
end
-
# Given a hash mapping platform families to values, select a value from the hash. Supports a single
# base default if platform family is not in the map. Arrays may be passed as hash keys and will be
# expanded
@@ -249,7 +240,6 @@ class Chef
platform_family.to_s == node[:platform_family]
end
end
-
end
end
end
@@ -257,4 +247,3 @@ end
# **DEPRECATED**
# This used to be part of chef/mixin/language. Load the file to activate the deprecation code.
require "chef/mixin/language"
-