summaryrefslogtreecommitdiffstats
path: root/lib/puppet/feature/rack.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/feature/rack.rb')
-rw-r--r--lib/puppet/feature/rack.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/puppet/feature/rack.rb b/lib/puppet/feature/rack.rb
index b91aa13b7..8d101ffc5 100644
--- a/lib/puppet/feature/rack.rb
+++ b/lib/puppet/feature/rack.rb
@@ -3,22 +3,22 @@ require 'puppet/util/feature'
# See if we have rack available, an HTTP Application Stack
# Explicitly depend on rack library version >= 1.0.0
Puppet.features.add(:rack) do
- begin
- require 'rack'
- rescue LoadError => detail
- require 'rubygems'
- require 'rack'
- end
+ begin
+ require 'rack'
+ rescue LoadError => detail
+ require 'rubygems'
+ require 'rack'
+ end
- if ! (defined?(::Rack) and defined?(::Rack.release))
- false
+ if ! (defined?(::Rack) and defined?(::Rack.release))
+ false
+ else
+ major_version = ::Rack.release.split('.')[0].to_i
+ if major_version >= 1
+ true
else
- major_version = ::Rack.release.split('.')[0].to_i
- if major_version >= 1
- true
- else
- false
- end
+ false
end
+ end
end