Class: Inspec::Resources::Http::Worker::Remote
- Inherits:
-
Base
- Object
- Base
- Inspec::Resources::Http::Worker::Remote
show all
- Defined in:
- lib/inspec/resources/http.rb
Instance Attribute Summary collapse
Attributes inherited from Base
#http_method, #opts, #url
Instance Method Summary
collapse
Constructor Details
#initialize(inspec, http_method, url, opts) ⇒ Remote
Returns a new instance of Remote.
176
177
178
179
180
181
182
183
184
185
|
# File 'lib/inspec/resources/http.rb', line 176
def initialize(inspec, http_method, url, opts)
http_cmd = inspec.os.windows? ? "Invoke-WebRequest" : "curl"
unless inspec.command(http_cmd).exist?
raise Inspec::Exceptions::ResourceSkipped,
"#{http_cmd} is not available on the target machine"
end
@ran_http = false
@inspec = inspec
super(http_method, url, opts)
end
|
Instance Attribute Details
#inspec ⇒ Object
Returns the value of attribute inspec.
174
175
176
|
# File 'lib/inspec/resources/http.rb', line 174
def inspec
@inspec
end
|
Instance Method Details
#body ⇒ Object
192
193
194
195
|
# File 'lib/inspec/resources/http.rb', line 192
def body
run_http
@body&.strip
end
|
197
198
199
200
|
# File 'lib/inspec/resources/http.rb', line 197
def
run_http
@response_headers
end
|
#status ⇒ Object
187
188
189
190
|
# File 'lib/inspec/resources/http.rb', line 187
def status
run_http
@status
end
|