summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-07 15:28:50 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-07 15:28:50 -0700
commitd7c4085d55a537d297f557c119fa6a9bd7e22690 (patch)
treefacde7c91df602a4b9584472a09c2043036501b0 /lib/chef
parent3e9e6d41a31bd1ac932f7f4100102466b4fdfe05 (diff)
downloadchef-d7c4085d55a537d297f557c119fa6a9bd7e22690.tar.gz
Add spaces after attrs
This makes it easier to read the classes. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/chef_fs/file_system/repository/base_file.rb1
-rw-r--r--lib/chef/exceptions.rb3
-rw-r--r--lib/chef/knife/bootstrap/train_connector.rb1
-rw-r--r--lib/chef/knife/core/hashed_command_loader.rb1
-rw-r--r--lib/chef/mixin/template.rb1
-rw-r--r--lib/chef/resource.rb2
-rw-r--r--lib/chef/resource/lwrp_base.rb1
-rw-r--r--lib/chef/shell/shell_session.rb2
8 files changed, 12 insertions, 0 deletions
diff --git a/lib/chef/chef_fs/file_system/repository/base_file.rb b/lib/chef/chef_fs/file_system/repository/base_file.rb
index 582f4130a8..94b52b9201 100644
--- a/lib/chef/chef_fs/file_system/repository/base_file.rb
+++ b/lib/chef/chef_fs/file_system/repository/base_file.rb
@@ -92,6 +92,7 @@ class Chef
end
attr_writer :write_pretty_json
+
def write_pretty_json
@write_pretty_json.nil? ? root.write_pretty_json : @write_pretty_json
end
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb
index 645193389e..444fe82df1 100644
--- a/lib/chef/exceptions.rb
+++ b/lib/chef/exceptions.rb
@@ -198,6 +198,7 @@ class Chef
class MetadataNotFound < StandardError
attr_reader :install_path
attr_reader :cookbook_name
+
def initialize(install_path, cookbook_name)
@install_path = install_path
@cookbook_name = cookbook_name
@@ -448,6 +449,7 @@ class Chef
# to correctly populate the backtrace with the wrapped backtraces.
class RunFailedWrappingError < RuntimeError
attr_reader :wrapped_errors
+
def initialize(*errors)
errors = errors.select { |e| !e.nil? }
output = "Found #{errors.size} errors, they are stored in the backtrace"
@@ -488,6 +490,7 @@ class Chef
class MultipleDscResourcesFound < RuntimeError
attr_reader :resources_found
+
def initialize(resources_found)
@resources_found = resources_found
matches_info = @resources_found.each do |r|
diff --git a/lib/chef/knife/bootstrap/train_connector.rb b/lib/chef/knife/bootstrap/train_connector.rb
index 623720c0ad..8a1e5863bb 100644
--- a/lib/chef/knife/bootstrap/train_connector.rb
+++ b/lib/chef/knife/bootstrap/train_connector.rb
@@ -322,6 +322,7 @@ class Chef
class RemoteExecutionFailed < StandardError
attr_reader :exit_status, :command, :hostname, :stdout, :stderr
+
def initialize(hostname, command, result)
@hostname = hostname
@exit_status = result.exit_status
diff --git a/lib/chef/knife/core/hashed_command_loader.rb b/lib/chef/knife/core/hashed_command_loader.rb
index d31865affc..b88cededc0 100644
--- a/lib/chef/knife/core/hashed_command_loader.rb
+++ b/lib/chef/knife/core/hashed_command_loader.rb
@@ -27,6 +27,7 @@ class Chef
KEY = "_autogenerated_command_paths".freeze
attr_accessor :manifest
+
def initialize(chef_config_dir, plugin_manifest)
super(chef_config_dir)
@manifest = plugin_manifest
diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb
index 06c191d63b..d72bfe9e3a 100644
--- a/lib/chef/mixin/template.rb
+++ b/lib/chef/mixin/template.rb
@@ -213,6 +213,7 @@ class Chef
class TemplateError < RuntimeError
attr_reader :original_exception, :context, :options
+
SOURCE_CONTEXT_WINDOW = 2
def initialize(original_exception, template, context, options)
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index bd6757c6f7..f2390b5801 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -638,6 +638,7 @@ class Chef
# Do NOT use this. It may be removed. It is for internal purposes only.
# @api private
attr_reader :resource_initializing
+
def resource_initializing=(value)
if value
@resource_initializing = true
@@ -888,6 +889,7 @@ class Chef
# have.
#
attr_writer :allowed_actions
+
def allowed_actions(value = NOT_PASSED)
if value != NOT_PASSED
self.allowed_actions = value
diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb
index 935da6d29e..a1d2afd791 100644
--- a/lib/chef/resource/lwrp_base.rb
+++ b/lib/chef/resource/lwrp_base.rb
@@ -103,6 +103,7 @@ class Chef
protected
attr_writer :loaded_lwrps
+
def loaded_lwrps
@loaded_lwrps ||= {}
end
diff --git a/lib/chef/shell/shell_session.rb b/lib/chef/shell/shell_session.rb
index 49348d415d..a1957c6667 100644
--- a/lib/chef/shell/shell_session.rb
+++ b/lib/chef/shell/shell_session.rb
@@ -41,6 +41,7 @@ module Shell
attr_accessor :node, :compile, :recipe, :json_configuration
attr_reader :node_attributes, :client
+
def initialize
@node_built = false
formatter = Chef::Formatters.new(Chef::Config.formatter, STDOUT, STDERR)
@@ -75,6 +76,7 @@ module Shell
end
attr_writer :run_context
+
def run_context
@run_context ||= rebuild_context
end