From 61edff9ba5e8e4f8db8bb9cd5a84a986b8703c5d Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Thu, 5 May 2011 16:24:26 -0700 Subject: (#7353) Remove :for_humans format entirely. Since we never shipped this in a real release, we don't need to maintain compatibility. So, remove it entirely from the codebase. Reviewed-By: Max Martin --- lib/puppet/application/face_base.rb | 20 +++++------------- lib/puppet/face/help.rb | 33 +++++++++++------------------- lib/puppet/interface/action_builder.rb | 4 +--- spec/unit/application/face_base_spec.rb | 11 ---------- spec/unit/interface/action_builder_spec.rb | 10 --------- 5 files changed, 18 insertions(+), 60 deletions(-) diff --git a/lib/puppet/application/face_base.rb b/lib/puppet/application/face_base.rb index 8c1e03e3f..7a5ce3400 100644 --- a/lib/puppet/application/face_base.rb +++ b/lib/puppet/application/face_base.rb @@ -29,17 +29,11 @@ class Puppet::Application::FaceBase < Puppet::Application attr_accessor :face, :action, :type, :arguments, :render_as def render_as=(format) - @render_as = case format.to_sym - when :for_humans then - # We have an old alias name for :console, which went out in - # 2.7.0rc1, so we are going to carry it forward for a - # while. --daniel 2011-05-04 - Puppet::Network::FormatHandler.format(:console) - when :json then - Puppet::Network::FormatHandler.format(:pson) - else - Puppet::Network::FormatHandler.format(format) - end + if format == :json then + @render_as = Puppet::Network::FormatHandler.format(:pson) + else + @render_as = Puppet::Network::FormatHandler.format(format) + end @render_as or raise ArgumentError, "I don't know how to render '#{format}'" end @@ -47,10 +41,6 @@ class Puppet::Application::FaceBase < Puppet::Application # Invoke the rendering hook supplied by the user, if appropriate. if hook = action.when_rendering(render_as.name) result = hook.call(result) - elsif render_as.name == :console and hook = action.when_rendering(:for_humans) - # We have an old alias name for :console, which went out in 2.7.0rc1, so - # we are going to carry it forward for a while. --daniel 2011-05-04 - result = hook.call(result) end render_as.render(result) diff --git a/lib/puppet/face/help.rb b/lib/puppet/face/help.rb index 07c3ed9b1..aef917447 100644 --- a/lib/puppet/face/help.rb +++ b/lib/puppet/face/help.rb @@ -24,29 +24,20 @@ Puppet::Face.define(:help, '0.0.1') do options = args.pop if options.nil? or args.length > 2 then if args.select { |x| x == 'help' }.length > 2 then - c = "\n !\"'),-./7:;