Skip to content

Commit

Permalink
strip trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsdeleo committed Jul 5, 2012
1 parent 972f9d3 commit e6268e7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions chef/lib/chef/formatters/base.rb
Expand Up @@ -92,7 +92,7 @@ def puts(string, *colors)
end

end


# == Formatters::Base
# Base class that all formatters should inherit from.
Expand Down Expand Up @@ -120,9 +120,9 @@ def print(*args)
@output.print(*args)
end

# Input: a Formatters::ErrorDescription object.
# Input: a Formatters::ErrorDescription object.
# Outputs error to SDOUT.
def display_error(description)
def display_error(description)
puts("")
description.display(output)
end
Expand Down Expand Up @@ -152,7 +152,7 @@ def cookbook_sync_failed(cookbooks, exception)
description = ErrorMapper.cookbook_sync_failed_helper(cookbooks, exception)
display_error(description)
end

def resource_failed(resource, action, exception)
description = ErrorMapper.resource_failed_helper(resource, action, exception)
display_error(description)
Expand Down Expand Up @@ -210,7 +210,7 @@ def attribute_file_load_failed(path, exception)
def definition_file_loaded(path)
file_loaded(path)
end

# Delegates to #file_load_failed
def definition_file_load_failed(path, exception)
file_load_failed(path, exception)
Expand Down
Expand Up @@ -7,9 +7,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -109,8 +109,8 @@ def humanize_http_exception(error_description)
else
error_description.section("Unexpected API Request Failure:", format_rest_error)
end
end
end

end
end
end
Expand Down
12 changes: 6 additions & 6 deletions chef/lib/chef/formatters/error_mapper.rb
Expand Up @@ -6,9 +6,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -19,9 +19,9 @@
class Chef
module Formatters
# == Formatters::ErrorMapper
# Collection of methods for creating and returning
# Collection of methods for creating and returning
# Formatters::ErrorDescription objects based on node,
# exception, and configuration information.
# exception, and configuration information.
module ErrorMapper

# Failed to register this client with the server.
Expand Down Expand Up @@ -64,7 +64,7 @@ def self.cookbook_sync_failed_helper(cookbooks, exception)
error_inspector.add_explanation(description)
return description
end

def self.resource_failed_helper(resource, action, exception)
error_inspector = ErrorInspectors::ResourceFailureInspector.new(resource, action, exception)
headline = "Error executing action `#{action}` on resource '#{resource}'"
Expand All @@ -74,5 +74,5 @@ def self.resource_failed_helper(resource, action, exception)
end

end
end
end
end
8 changes: 4 additions & 4 deletions chef/lib/chef/resource_reporter.rb
Expand Up @@ -25,7 +25,7 @@
class Chef
class ResourceReporter < EventDispatch::Base



class ResourceReport < Struct.new(:new_resource,
:current_resource,
Expand Down Expand Up @@ -187,19 +187,19 @@ def report(node)

def run_list_expand_failed(node, exception)
description = Formatters::ErrorMapper.run_list_expand_failed_helper(node, exception)
@error_descriptions = description.for_json
@error_descriptions = description.for_json
end

def cookbook_resolution_failed(expanded_run_list, exception)
description = Formatters::ErrorMapper.cookbook_resolution_failed_helper(expanded_run_list, exception)
@error_descriptions = description.for_json
end

def cookbook_sync_failed(cookbooks, exception)
description = Formatters::ErrorMapper.cookbook_sync_failed_helper(cookbooks, exception)
@error_descriptions = description.for_json
end

def reporting_enabled?
@reporting_enabled
end
Expand Down
6 changes: 3 additions & 3 deletions chef/spec/unit/resource_reporter_spec.rb
Expand Up @@ -50,7 +50,7 @@

it "should have no error_descriptions" do
@resource_reporter.error_descriptions.should be_nil
# @resource_reporter.error_descriptions.should be_empty
# @resource_reporter.error_descriptions.should be_empty
# @resource_reporter.should have(0).error_descriptions
end

Expand Down Expand Up @@ -338,7 +338,7 @@
context "for an unsuccessful run" do

before do

@backtrace = "foo.rb:1 in `foo!'\nbar.rb:2 in `bar!\n'baz.rb:3 in `baz!'"
@node = Chef::Node.new
@node.name("spitfire")
Expand Down Expand Up @@ -372,7 +372,7 @@
@report["data"]["exception"].should have_key("description")
@report["data"]["exception"]["description"].should include({"title"=>"Error expanding the run_list:", "sections"=>[["Unexpected Error:", "RSpec::Mocks::Mock: Object not found"]]})
end


end

Expand Down

0 comments on commit e6268e7

Please sign in to comment.