summaryrefslogtreecommitdiff
path: root/lib/chef/knife/raw.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/knife/raw.rb')
-rw-r--r--lib/chef/knife/raw.rb48
1 files changed, 32 insertions, 16 deletions
diff --git a/lib/chef/knife/raw.rb b/lib/chef/knife/raw.rb
index 2916736e66..2d49c457fc 100644
--- a/lib/chef/knife/raw.rb
+++ b/lib/chef/knife/raw.rb
@@ -1,3 +1,19 @@
+#
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require "chef/knife"
require "chef/http"
@@ -17,27 +33,27 @@ class Chef
end
option :method,
- :long => "--method METHOD",
- :short => "-m METHOD",
- :default => "GET",
- :description => "Request method (GET, POST, PUT or DELETE). Default: GET"
+ long: "--method METHOD",
+ short: "-m METHOD",
+ default: "GET",
+ description: "Request method (GET, POST, PUT or DELETE). Default: GET"
option :pretty,
- :long => "--[no-]pretty",
- :boolean => true,
- :default => true,
- :description => "Pretty-print JSON output. Default: true"
+ long: "--[no-]pretty",
+ boolean: true,
+ default: true,
+ description: "Pretty-print JSON output. Default: true"
option :input,
- :long => "--input FILE",
- :short => "-i FILE",
- :description => "Name of file to use for PUT or POST"
+ long: "--input FILE",
+ short: "-i FILE",
+ description: "Name of file to use for PUT or POST"
option :proxy_auth,
- :long => "--proxy-auth",
- :boolean => true,
- :default => false,
- :description => "Use webui proxy authentication. Client key must be the webui key."
+ long: "--proxy-auth",
+ boolean: true,
+ default: false,
+ description: "Use webui proxy authentication. Client key must be the webui key."
# We need a custom HTTP client class here because we don't want to even
# try to decode the body, in case we get back corrupted JSON or whatnot.
@@ -89,7 +105,7 @@ class Chef
result = Chef::JSONCompat.to_json_pretty(result)
end
else
- chef_rest = RawInputServerAPI.new(:raw_output => true)
+ chef_rest = RawInputServerAPI.new(raw_output: true)
result = chef_rest.request(method, name_args[0], headers, data)
end
output result