diff options
author | Pete Higgins <pete@peterhiggins.org> | 2020-06-09 18:17:18 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-06-10 11:16:52 -0700 |
commit | 8f6c2cfedc7798aac9b33e8a74785e5dd1c1f5a6 (patch) | |
tree | d7fe2f5be4455dcba897b96166622280e779942c | |
parent | da24cca475c8ba842f4fb7a0eef89aea64c858cd (diff) | |
download | chef-8f6c2cfedc7798aac9b33e8a74785e5dd1c1f5a6.tar.gz |
Remove shared initializer for WindowsScript.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r-- | lib/chef/resource/batch.rb | 6 | ||||
-rw-r--r-- | lib/chef/resource/powershell_script.rb | 6 | ||||
-rw-r--r-- | lib/chef/resource/windows_script.rb | 7 |
3 files changed, 8 insertions, 11 deletions
diff --git a/lib/chef/resource/batch.rb b/lib/chef/resource/batch.rb index a524737abe..35939614f0 100644 --- a/lib/chef/resource/batch.rb +++ b/lib/chef/resource/batch.rb @@ -27,8 +27,10 @@ class Chef description "Use the **batch** resource to execute a batch script using the cmd.exe interpreter on Windows. The batch resource creates and executes a temporary file (similar to how the script resource behaves), rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use not_if and only_if to guard this resource for idempotence." - def initialize(name, run_context = nil) - super(name, run_context, nil, "cmd.exe") + def initialize(*args) + super + @interpreter = "cmd.exe" + @default_guard_interpreter = self.resource_name end end diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb index 434f9ca09f..aa8f35152a 100644 --- a/lib/chef/resource/powershell_script.rb +++ b/lib/chef/resource/powershell_script.rb @@ -48,8 +48,10 @@ class Chef " idempotent, as they are typically unique to the environment in which they are run. Use not_if"\ " and only_if to guard this resource for idempotence." - def initialize(name, run_context = nil) - super(name, run_context, :powershell_script, "powershell.exe") + def initialize(*args) + super + @interpreter = "powershell.exe" + @default_guard_interpreter = self.resource_name @convert_boolean_return = false end diff --git a/lib/chef/resource/windows_script.rb b/lib/chef/resource/windows_script.rb index 353264c617..2fb5a81cf8 100644 --- a/lib/chef/resource/windows_script.rb +++ b/lib/chef/resource/windows_script.rb @@ -33,13 +33,6 @@ class Chef protected - def initialize(name, run_context, resource_name, interpreter_command) - super(name, run_context) - @interpreter = interpreter_command - @resource_name = resource_name if resource_name - @default_guard_interpreter = self.resource_name - end - include Chef::Mixin::WindowsArchitectureHelper public |