-
-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
# section 5.6.3.2 in the ~1000 page pdf spec | ||
def canonicalize_headers(headers) | ||
tmp = headers.reduce({}) {|ret, h| ret[h.first.downcase] = h.last if h.first.match(/^x-tmrk/i) ; ret } | ||
tmp.reject! {|k,v| k == "x-tmrk-authorization" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused block argument - v
. If it's necessary, use _
or _v
as an argument name to indicate that it won't be used.
Space missing after comma.
Space between { and | missing.
cc476eb
to
83ece2e
Compare
params[:headers].merge!("Accept" => "application/xml") | ||
end | ||
unless params[:body].nil? || params[:body].empty? | ||
params[:headers].merge!({ "x-tmrk-contenthash" => "Sha256 #{Base64.encode64(Digest::SHA2.digest(params[:body].to_s)).chomp}" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant curly braces around a hash parameter.
83ece2e
to
7137fdc
Compare
} | ||
|
||
ip_address = { | ||
:id => ip_address_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
7137fdc
to
6130f9b
Compare
"x-tmrk-version" => @version, | ||
"Date" => Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S GMT"), | ||
}.merge(params[:headers] || {}) | ||
if params[:method]=="POST" || params[:method]=="PUT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surrounding space missing for operator '=='.
6130f9b
to
f8df702
Compare
} | ||
environment.merge!( | ||
:Links => { | ||
:Link => [ Fog::Ecloud.keep(organization, :href, :name, :type), ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space inside square brackets detected.
f8df702
to
5fd65e5
Compare
|
||
def validate_data(required_opts = [], options = {}) | ||
unless required_opts.all? { |opt| options.key?(opt) } | ||
raise ArgumentError.new("Required data missing: #{(required_opts - options.keys).map(&:inspect).join(", ")}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings inside interpolations.
if params[:uri].is_a?(String) | ||
params[:uri] = URI.parse(@host + params[:uri]) | ||
end | ||
host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ":#{params[:uri].port}" : ""}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings inside interpolations.
5fd65e5
to
091080d
Compare
@cpu_usage ||= Fog::Compute::Ecloud::CpuUsageDetailSummary.new(:service => service, :href => "#{service.base_path}/computePools/#{id}/usage/cpu") | ||
end | ||
|
||
def memory_usage | ||
# time ? query = "/details?time=#{Time.parse(time).utc.strftime('%Y-%m-%dT%H:%M:%SZ')}" : query = "" | ||
# time ? query = "/details?time=#{Time.parse(time).utc.strftime("%Y-%m-%dT%H:%M:%SZ")}" : query = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect indentation detected (column 0 instead of 10).
091080d
to
39fd5a6
Compare
end | ||
slice_ips = slice_ips.map { |i| {:name => i.address.name, :network_name => i.network.name} }.push({:name => options[:ip], :network_name => options[:network_name]}).uniq | ||
slice_ips = slice_ips.map { |i| {:name => i.address.name, :network_name => i.network.name} }.push(:name => options[:ip], :network_name => options[:network_name]).uniq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space inside { missing.
Space inside } missing.
39fd5a6
to
ea9e807
Compare
end | ||
|
||
def self.ip_address | ||
4.times.map{ Fog::Mock.random_numbers(3) }.join(".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing to the left of {.
ea9e807
to
c185122
Compare
relates to fog/fog#3430