1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

Mitigates Style/Proc

This commit is contained in:
Thomas Nys 2015-04-18 12:39:39 +02:00
parent 0d3e870025
commit 29797dad54
5 changed files with 5 additions and 5 deletions

View file

@ -9,7 +9,7 @@ class Rep
include HTTParty
parser(
Proc.new do |body, format|
proc do |body, format|
Crack::XML.parse(body)
end
)

View file

@ -53,7 +53,7 @@ end
class AdHocParsing
include HTTParty
parser(
Proc.new do |body, format|
proc do |body, format|
case format
when :json
body.to_json

View file

@ -19,7 +19,7 @@ end
Given /^that service takes (\d+) seconds to generate a response$/ do |time|
@server_response_time = time.to_i
@handler.preprocessor = Proc.new { sleep time.to_i }
@handler.preprocessor = proc { sleep time.to_i }
end
Given /^a remote deflate service$/ do

View file

@ -14,7 +14,7 @@ module HTTParty
SupportedURISchemes = [URI::HTTP, URI::HTTPS, URI::Generic]
NON_RAILS_QUERY_STRING_NORMALIZER = Proc.new do |query|
NON_RAILS_QUERY_STRING_NORMALIZER = proc do |query|
Array(query).sort_by { |a| a[0].to_s }.map do |key, value|
if value.nil?
key.to_s

View file

@ -318,7 +318,7 @@ RSpec.describe HTTParty do
end
let(:parser) do
Proc.new { |data, format| CustomParser.parse(data) }
proc { |data, format| CustomParser.parse(data) }
end
it "should set parser options" do