diff options
Diffstat (limited to 'lib/chef/knife/cookbook_site_share.rb')
-rw-r--r-- | lib/chef/knife/cookbook_site_share.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index 5d5b3ddcc4..144085c2a2 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -39,24 +39,24 @@ class Chef category "cookbook site" option :cookbook_path, - :short => "-o PATH:PATH", - :long => "--cookbook-path PATH:PATH", - :description => "A colon-separated path to look for cookbooks in", - :proc => lambda { |o| Chef::Config.cookbook_path = o.split(":") } + short: "-o PATH:PATH", + long: "--cookbook-path PATH:PATH", + description: "A colon-separated path to look for cookbooks in", + proc: lambda { |o| Chef::Config.cookbook_path = o.split(":") } option :dry_run, - :long => "--dry-run", - :short => "-n", - :boolean => true, - :default => false, - :description => "Don't take action, only print what files will be uploaded to Supermarket." + long: "--dry-run", + short: "-n", + boolean: true, + default: false, + description: "Don't take action, only print what files will be uploaded to Supermarket." option :supermarket_site, - :short => "-m SUPERMARKET_SITE", - :long => "--supermarket-site SUPERMARKET_SITE", - :description => "Supermarket Site", - :default => "https://supermarket.chef.io", - :proc => Proc.new { |supermarket| Chef::Config[:knife][:supermarket_site] = supermarket } + short: "-m SUPERMARKET_SITE", + long: "--supermarket-site SUPERMARKET_SITE", + description: "Supermarket Site", + default: "https://supermarket.chef.io", + proc: Proc.new { |supermarket| Chef::Config[:knife][:supermarket_site] = supermarket } def run config[:cookbook_path] ||= Chef::Config[:cookbook_path] @@ -81,7 +81,7 @@ class Chef begin Chef::Log.trace("Temp cookbook directory is #{tmp_cookbook_dir.inspect}") ui.info("Making tarball #{cookbook_name}.tgz") - shell_out!("#{tar_cmd} -czf #{cookbook_name}.tgz #{cookbook_name}", :cwd => tmp_cookbook_dir) + shell_out!("#{tar_cmd} -czf #{cookbook_name}.tgz #{cookbook_name}", cwd: tmp_cookbook_dir) rescue => e ui.error("Error making tarball #{cookbook_name}.tgz: #{e.message}. Increase log verbosity (-VV) for more information.") Chef::Log.trace("\n#{e.backtrace.join("\n")}") @@ -90,7 +90,7 @@ class Chef if config[:dry_run] ui.info("Not uploading #{cookbook_name}.tgz due to --dry-run flag.") - result = shell_out!("#{tar_cmd} -tzf #{cookbook_name}.tgz", :cwd => tmp_cookbook_dir) + result = shell_out!("#{tar_cmd} -tzf #{cookbook_name}.tgz", cwd: tmp_cookbook_dir) ui.info(result.stdout) FileUtils.rm_rf tmp_cookbook_dir return @@ -129,8 +129,8 @@ class Chef category_string = Chef::JSONCompat.to_json({ "category" => cookbook_category }) http_resp = Chef::CookbookSiteStreamingUploader.post(uri, user_id, user_secret_filename, { - :tarball => File.open(cookbook_filename), - :cookbook => category_string, + tarball: File.open(cookbook_filename), + cookbook: category_string, }) res = Chef::JSONCompat.from_json(http_resp.body) |