diff options
| author | Max Martin <max@puppetlabs.com> | 2011-02-18 15:19:46 -0800 |
|---|---|---|
| committer | Max Martin <max@puppetlabs.com> | 2011-02-18 15:19:46 -0800 |
| commit | d1f1858ea52d3089fd2088994e80d6f49d7e0347 (patch) | |
| tree | 7e4421582c3080611a0184033cff0cade2508d80 /lib/puppet/network/http/api | |
| parent | 12fd75a7c575ea181f065b6aaffdcb65417aeb35 (diff) | |
| download | puppet-d1f1858ea52d3089fd2088994e80d6f49d7e0347.tar.gz puppet-d1f1858ea52d3089fd2088994e80d6f49d7e0347.tar.xz puppet-d1f1858ea52d3089fd2088994e80d6f49d7e0347.zip | |
(#6376) Add support and testing for _search GET requests
Added support for adding "_search" to the end of any indirection to
'pluralize' it, and added tests to check this functionality and to test
hidden side effect of plurality method unpluralizing indirections.
Paired-With:Paul Berry <paul@puppetlabs.com>
Diffstat (limited to 'lib/puppet/network/http/api')
| -rw-r--r-- | lib/puppet/network/http/api/v1.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb index 0a04a465f..9e51aae36 100644 --- a/lib/puppet/network/http/api/v1.rb +++ b/lib/puppet/network/http/api/v1.rb @@ -63,9 +63,9 @@ module Puppet::Network::HTTP::API::V1 return :singular if indirection == "status" return :plural if indirection == "inventory" - result = (indirection =~ /s$/) ? :plural : :singular + result = (indirection =~ /s$|_search$/) ? :plural : :singular - indirection.sub!(/s$/, '') if result + indirection.sub!(/s$|_search$|es$/, '') result end |
