Skip to content

Commit

Permalink
remove empty hashes after setting lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRuiz committed Mar 23, 2023
1 parent 1e3e35f commit 761875b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/nice_http/utils/set_lambdas.rb
Expand Up @@ -19,6 +19,9 @@ def self.set_lambdas(data, data_orig)
end
elsif v.is_a?(Hash)
data[k] = set_lambdas(v, data_orig[k])
unless data_orig.is_a?(Hash) and data_orig.key?(k)
data.delete(k) if data[k].empty?
end
elsif v.is_a?(Array)
v.each.with_index do |v2, i|
if data_orig.key?(k) and data_orig[k].is_a?(Array) and data_orig[k].size > i
Expand Down
2 changes: 1 addition & 1 deletion nice_http.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'nice_http'
s.version = '1.9.6'
s.version = '1.9.7'
s.summary = "NiceHttp -- simplest library for accessing and testing HTTP and REST resources. Get http logs and statistics automatically. Use hashes on your requests. Access JSON even easier."
s.description = "NiceHttp -- simplest library for accessing and testing HTTP and REST resources. Get http logs and statistics automatically. Use hashes on your requests. Access JSON even easier."
s.authors = ["Mario Ruiz"]
Expand Down

0 comments on commit 761875b

Please sign in to comment.