summaryrefslogtreecommitdiff
path: root/chef-server-api/app
diff options
context:
space:
mode:
authorNuo Yan <nuo@opscode.com>2011-02-09 16:15:38 -0800
committerNuo Yan <nuo@opscode.com>2011-02-09 16:15:38 -0800
commit706a9e963603ada7660e0e66ae3c75fec10041e4 (patch)
treeba65902bcdb5948717a4b503097051edea7c72fa /chef-server-api/app
parent005d8e77e18235a5500808137250b32b481b3364 (diff)
downloadchef-706a9e963603ada7660e0e66ae3c75fec10041e4.tar.gz
update cukes for the API change
Diffstat (limited to 'chef-server-api/app')
-rw-r--r--chef-server-api/app/controllers/cookbooks.rb2
-rw-r--r--chef-server-api/app/controllers/environments.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/chef-server-api/app/controllers/cookbooks.rb b/chef-server-api/app/controllers/cookbooks.rb
index cdfeb6a6ab..4915b3b8b3 100644
--- a/chef-server-api/app/controllers/cookbooks.rb
+++ b/chef-server-api/app/controllers/cookbooks.rb
@@ -51,7 +51,7 @@ class Cookbooks < Application
num_versions = params[:num_versions].nil? || params[:num_versions].empty? || params[:num_versions].to_i < 0 ? "1" : params[:num_versions]
response = Hash.new
cookbook_list.each do |k, v|
- response[k] = {:url=>absolute_url(:cookbook, :cookbook_name => k), :versions => v.inject([]){ |r,val| r.push({:url => absolute_url(:cookbook_version, :cookbook_name => k, :cookbook_version => val), :version => val}) if num_versions.to_i > r.size; r}}
+ response[k] = {:url=>absolute_url(:cookbook, :cookbook_name => k), :versions => v.inject([]){ |r,val| r.push({:url => absolute_url(:cookbook_version, :cookbook_name => k, :cookbook_version => val), :version => val}) if num_versions.to_i > r.size || num_versions == 'all'; r}}
end
display response
end
diff --git a/chef-server-api/app/controllers/environments.rb b/chef-server-api/app/controllers/environments.rb
index c902d05360..dc85ee68d9 100644
--- a/chef-server-api/app/controllers/environments.rb
+++ b/chef-server-api/app/controllers/environments.rb
@@ -101,7 +101,7 @@ class Environments < Application
end
num_versions = params[:num_versions].nil? || params[:num_versions].empty? || params[:num_versions].to_i < 0 ? "1" : params[:num_versions]
display(filtered_cookbooks.inject({}) {|res, (cookbook_name,versions)|
- res[cookbook_name] = {:url => absolute_url(:cookbook, :cookbook_name => cookbook_name), :versions => versions.inject([]){|r, val| r.push({:url => absolute_url(:cookbook_version, :cookbook_name => cookbook_name, :cookbook_version => val.version), :version => val.version}) if num_versions.to_i > r.size; r}}
+ res[cookbook_name] = {:url => absolute_url(:cookbook, :cookbook_name => cookbook_name), :versions => versions.inject([]){|r, val| r.push({:url => absolute_url(:cookbook_version, :cookbook_name => cookbook_name, :cookbook_version => val.version), :version => val.version}) if num_versions.to_i > r.size || num_versions == 'all'; r}}
res
})
end