Since we never shipped this in a real release, we don't need to maintain
compatibility.  So, remove it entirely from the codebase.
---
 lib/puppet/application/face_base.rb        |   20 +++++---------------
 lib/puppet/interface/action_builder.rb     |    4 +---
 spec/unit/application/face_base_spec.rb    |   11 -----------
 spec/unit/interface/action_builder_spec.rb |   10 ----------
 4 files changed, 6 insertions(+), 39 deletions(-)

diff --git a/lib/puppet/application/face_base.rb 
b/lib/puppet/application/face_base.rb
index 8c1e03e..7a5ce34 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/interface/action_builder.rb 
b/lib/puppet/interface/action_builder.rb
index 1630553..62db8de 100644
--- a/lib/puppet/interface/action_builder.rb
+++ b/lib/puppet/interface/action_builder.rb
@@ -38,9 +38,7 @@ class Puppet::Interface::ActionBuilder
   def render_as(value = nil)
     value.nil? and raise ArgumentError, "You must give a rendering format to 
render_as"
 
-    # :for_humans is a compatibility alias for :console, but since we shipped
-    # it in 2.7.0rc1 we need to support it ongoing. --daniel 2011-05-04
-    formats = Puppet::Network::FormatHandler.formats << :for_humans
+    formats = Puppet::Network::FormatHandler.formats
     unless formats.include? value
       raise ArgumentError, "#{value.inspect} is not a valid rendering format: 
#{formats.sort.join(", ")}"
     end
diff --git a/spec/unit/application/face_base_spec.rb 
b/spec/unit/application/face_base_spec.rb
index 25797ea..2a9a223 100755
--- a/spec/unit/application/face_base_spec.rb
+++ b/spec/unit/application/face_base_spec.rb
@@ -329,15 +329,4 @@ EOT
       }.to have_printed(/you invoked the 's' rendering hook/)
     end
   end
-
-  describe "#render_as=" do
-    # This is for compatibility with the format name in 2.7.0rc1, but isn't a
-    # long term desirable name.  We can't just randomly drop it since it was
-    # released, though, so it will live for a couple of major versions.
-    # --daniel 2011-05-04
-    it "should treat :for_humans as a synonym for :console" do
-      app.render_as = :for_humans
-      app.render_as.name.should == :console
-    end
-  end
 end
diff --git a/spec/unit/interface/action_builder_spec.rb 
b/spec/unit/interface/action_builder_spec.rb
index 89aef26..c398605 100755
--- a/spec/unit/interface/action_builder_spec.rb
+++ b/spec/unit/interface/action_builder_spec.rb
@@ -200,16 +200,6 @@ describe Puppet::Interface::ActionBuilder do
       end
     end
 
-    # :for_humans is an alias for :console, and deprecated, but since we
-    # shipped it in 2.7.0rc1 we need to support it. --daniel 2011-05-04
-    it "should accept :for_humans format" do
-      action = Puppet::Interface::ActionBuilder.build(face, :foo) do
-        when_invoked do true end
-        render_as :for_humans
-      end
-      action.render_as.should == :for_humans
-    end
-
     [:if_you_define_this_format_you_frighten_me, "json", 12].each do |input|
       it "should fail if given #{input.inspect}" do
         expect {
-- 
1.7.5

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to