mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Mitigates Style/Proc
This commit is contained in:
parent
0d3e870025
commit
29797dad54
5 changed files with 5 additions and 5 deletions
|
@ -9,7 +9,7 @@ class Rep
|
||||||
include HTTParty
|
include HTTParty
|
||||||
|
|
||||||
parser(
|
parser(
|
||||||
Proc.new do |body, format|
|
proc do |body, format|
|
||||||
Crack::XML.parse(body)
|
Crack::XML.parse(body)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
|
@ -53,7 +53,7 @@ end
|
||||||
class AdHocParsing
|
class AdHocParsing
|
||||||
include HTTParty
|
include HTTParty
|
||||||
parser(
|
parser(
|
||||||
Proc.new do |body, format|
|
proc do |body, format|
|
||||||
case format
|
case format
|
||||||
when :json
|
when :json
|
||||||
body.to_json
|
body.to_json
|
||||||
|
|
|
@ -19,7 +19,7 @@ end
|
||||||
|
|
||||||
Given /^that service takes (\d+) seconds to generate a response$/ do |time|
|
Given /^that service takes (\d+) seconds to generate a response$/ do |time|
|
||||||
@server_response_time = time.to_i
|
@server_response_time = time.to_i
|
||||||
@handler.preprocessor = Proc.new { sleep time.to_i }
|
@handler.preprocessor = proc { sleep time.to_i }
|
||||||
end
|
end
|
||||||
|
|
||||||
Given /^a remote deflate service$/ do
|
Given /^a remote deflate service$/ do
|
||||||
|
|
|
@ -14,7 +14,7 @@ module HTTParty
|
||||||
|
|
||||||
SupportedURISchemes = [URI::HTTP, URI::HTTPS, URI::Generic]
|
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|
|
Array(query).sort_by { |a| a[0].to_s }.map do |key, value|
|
||||||
if value.nil?
|
if value.nil?
|
||||||
key.to_s
|
key.to_s
|
||||||
|
|
|
@ -318,7 +318,7 @@ RSpec.describe HTTParty do
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:parser) do
|
let(:parser) do
|
||||||
Proc.new { |data, format| CustomParser.parse(data) }
|
proc { |data, format| CustomParser.parse(data) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should set parser options" do
|
it "should set parser options" do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue