resterl 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ba291d5cad21d29e786dffb4c29f6f95af7ac42a
4
- data.tar.gz: 849817253c65f4c23edde761e654d7f3ad70144c
2
+ SHA256:
3
+ metadata.gz: 34e6d5fb43fdcc446afac5ab06419e2632dac2bc2806a1528725d6165b492ab2
4
+ data.tar.gz: b6038c9b94e3db6134ec0de6cbc1763573c429f5c412186e59e6dd6af8de1dc2
5
5
  SHA512:
6
- metadata.gz: a51fef712af70ca0cd8d3c47ca5ce522461d8de13d902c157b39fb434b30b1a7053ca965fc8b772c0af3d18d23f42fd39eaa177143146e8f82a87c1309d6bc36
7
- data.tar.gz: 15bfd502fc79be97912caae50d42c9899b4ef5d42836b13bf7813e13555b8e6e77603abbc927cd4b5aeb478da039927ca8942442d9d720a6f3e50a4e9c561284
6
+ metadata.gz: c4371977339943f3a99831519bc1927724fa4b068902ccd86c2130e5566be7917d9693f0ac2fefd24ea70481f2854daaa1514d59bff59fd8464ece2fee0ea78e
7
+ data.tar.gz: 64f8c76852a4cd99e033910229f26fbb3be74e4c9162440cd5c47ccd11d7294247f19f15c414a52ff0f6289309827cf10048ade5557df08a58e67d29f450a098
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.4
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/object/blank'
2
+ require 'active_support/core_ext/hash'
2
3
 
3
4
  module Resterl
4
5
  class GenericRequest
@@ -29,11 +30,7 @@ module Resterl
29
30
  end
30
31
 
31
32
  def query_param_string
32
- @query_param_string ||= begin
33
- @query_params.collect do |key, value|
34
- "#{URI.escape(key.to_s)}=#{URI.escape(value.to_s)}"
35
- end.join('&')
36
- end
33
+ @query_param_string ||= @query_params.to_query
37
34
  end
38
35
 
39
36
  def apply_basic_auth request
@@ -1,3 +1,3 @@
1
1
  module Resterl
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -4,6 +4,8 @@ require 'webmock/rspec'
4
4
  require 'timecop'
5
5
 
6
6
  describe Resterl::Client do
7
+ subject(:client) { Resterl::Client.new }
8
+
7
9
  describe 'minimum cache lifetime' do
8
10
  before do
9
11
  Timecop.freeze(Time.parse('2015-01-01 01:00'))
@@ -14,7 +16,6 @@ describe Resterl::Client do
14
16
  headers: { cache_control: 'max-age=0, private, must-revalidate' }
15
17
  ).then.to_raise('2 requests')
16
18
  end
17
- let(:client) { Resterl::Client.new }
18
19
 
19
20
  it 'is used in "max-age=0" case' do
20
21
  response = client.get 'http://www.example.com/', {}, {}
@@ -31,4 +32,12 @@ describe Resterl::Client do
31
32
  end.not_to raise_error
32
33
  end
33
34
  end
35
+
36
+ it 'encodes url params' do
37
+ stub_request(
38
+ :get, "http://www.example.com/?text=Ein%20gro%C3%9Fer%20Spa%C3%9F!"
39
+ ).to_return(status: 200, body: '', headers: {})
40
+
41
+ client.get 'http://www.example.com/', { text: 'Ein großer Spaß!' }, {}
42
+ end
34
43
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resterl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Dütsch
8
8
  - Stefan Hoffmann
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-22 00:00:00.000000000 Z
12
+ date: 2021-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -123,7 +123,7 @@ dependencies:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
- description:
126
+ description:
127
127
  email:
128
128
  - florian.duetsch@nix-wie-weg.de
129
129
  - stefan.hoffmann@nix-wie-weg.de
@@ -134,6 +134,7 @@ files:
134
134
  - ".document"
135
135
  - ".gitignore"
136
136
  - ".rubocop.yml"
137
+ - ".ruby-version"
137
138
  - Gemfile
138
139
  - LICENSE
139
140
  - README.rdoc
@@ -162,7 +163,7 @@ files:
162
163
  homepage: https://github.com/Nix-wie-weg/resterl
163
164
  licenses: []
164
165
  metadata: {}
165
- post_install_message:
166
+ post_install_message:
166
167
  rdoc_options: []
167
168
  require_paths:
168
169
  - lib
@@ -177,9 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
178
  - !ruby/object:Gem::Version
178
179
  version: '0'
179
180
  requirements: []
180
- rubyforge_project:
181
- rubygems_version: 2.4.5.1
182
- signing_key:
181
+ rubygems_version: 3.1.6
182
+ signing_key:
183
183
  specification_version: 4
184
184
  summary: Rudimentary HTTP client with focus on caching
185
185
  test_files: