summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2011-02-03 16:10:49 -0800
committerJesse Wolfe <jes5199@gmail.com>2011-02-03 16:40:35 -0800
commite1191f33defcaffec5900c7122a89ca75d3a9673 (patch)
treeeb7c159a20a4de9329c1f8178657afd409d60db4
parentc469f99301563c899dcca43e81ae14a8580931fc (diff)
downloadpuppet-e1191f33defcaffec5900c7122a89ca75d3a9673.tar.gz
puppet-e1191f33defcaffec5900c7122a89ca75d3a9673.tar.xz
puppet-e1191f33defcaffec5900c7122a89ca75d3a9673.zip
Maint: remove rdoc/usage dependency
-rw-r--r--lib/puppet/application.rb21
-rwxr-xr-xspec/unit/application_spec.rb5
2 files changed, 5 insertions, 21 deletions
diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb
index c3d7355f6..7ef71bc81 100644
--- a/lib/puppet/application.rb
+++ b/lib/puppet/application.rb
@@ -250,7 +250,8 @@ class Application
# Every app responds to --help
option("--help", "-h") do |v|
- help
+ puts help
+ exit
end
def should_parse_config?
@@ -385,23 +386,7 @@ class Application
end
def help
- if Puppet.features.usage?
- # RH:FIXME: My goodness, this is ugly.
- ::RDoc.const_set("PuppetSourceFile", name)
- #:stopdoc: # Issue #4161
- def (::RDoc).caller
- docfile = `grep -l 'Puppet::Application\\[:#{::RDoc::PuppetSourceFile}\\]' #{DOCPATTERN}`.chomp
- super << "#{docfile}:0"
- end
- #:startdoc:
- ::RDoc::usage && exit
- else
- puts "No help available unless you have RDoc::usage installed"
- exit
- end
- rescue Errno::ENOENT
- puts "No help available for puppet #{name}"
- exit
+ "No help available for puppet #{name}"
end
private
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index 5a52c2d54..1446535e1 100755
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -283,11 +283,10 @@ describe Puppet::Application do
@app.parse_options
end
- describe "when using --help", :if => Puppet.features.usage? do
+ describe "when using --help" do
- it "should call RDoc::usage and exit" do
+ it "should call exit" do
@app.expects(:exit)
- RDoc.expects(:usage).returns(true)
@app.handle_help(nil)
end