maremma 2.1 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDViZDYzNTdhY2FjNzhkZmFmMGE3OTY3OTMzYzg5NjI3YjEzYzVhZQ==
4
+ ZmViMTFhMmVkNTczYTJmNmJkN2VkZWIzMTJhNTM3M2Q0NjlhM2QxYw==
5
5
  data.tar.gz: !binary |-
6
- MjI0MjhjNTY2YWY4NWM4N2UyMzZjMzBmODBiZGJmNTdhZjcyYzhjZQ==
6
+ NGFkMDVkNWEzODdhNDExOWY5ZTE0ZjA1OGM0ZjJkYjY4MjI4ZTg2Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2ZjZWNhN2JhYzUzMzQ4MzRjNGFiYWQzYTE2ZmJmZWIyN2I3MDUxNDE4ODlh
10
- YTVjODZkOTczYjllOGRiZGI3MTAyM2Q4YmFiZWI5ZjA1NzVjYTFmMGMzYWNh
11
- MWQ2ZTg0ZWQwZjdlODRlYWM2MGE1OWY0ODdjNDUxYTExNzY4ZDI=
9
+ ZWNkZjkyNjUzOWRmOTQ2NjcwZTk4MTRmNTQzZjQ0NTA4ZGNjZDAxMDNmMGI3
10
+ MzcwMDAxMDEyYTc1ZWRhOGYxNDY4Nzg4NTQzOWYzNWY0YmYyMDdiNjVkMmQ5
11
+ NzRjMWViZTQ2MDc3ZWIxMTgyYTg1NTVmMTkxMTk4YzIzYzIzMmM=
12
12
  data.tar.gz: !binary |-
13
- MWRjNmVkMmUxNTdjMzVhMTNmYTgzM2VmMDY3ZDA0ZTEwMDRkOWYyMmZlZTU1
14
- NjNmNWY4Yjc3MTc3ZTYzZTU1Yzk2OTU0ZWFlNzU4ZDM5ZWI0MDRlMmE3MDE3
15
- OTQ3NTExMmUxZjMwODU4NmQwYmE1YjlhMzViNjc5ZmFjZTdjMjM=
13
+ MTQ0NDhhMzc3ODIzOTI5YjRmZjliNzRlNDZjMTc1OWRlOWQxMjViMTBlNDhj
14
+ ODQzNGY5OGY1ZDYwOGU5MWQxNGRhYTUzZWZjMTU4ZmRmYzViODcyNGExZTM1
15
+ NWNlYjEzNzJmNTE4NjYyOGI4Yzg1MDQwNDVmNDAyOTA1ODA2ZTI=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maremma (2.1)
4
+ maremma (2.1.1)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  builder (~> 3.2, >= 3.2.2)
7
7
  excon (~> 0.45.0)
@@ -15,7 +15,7 @@ PATH
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activesupport (4.2.5.2)
18
+ activesupport (4.2.5.1)
19
19
  i18n (~> 0.7)
20
20
  json (~> 1.7, >= 1.7.7)
21
21
  minitest (~> 5.1)
@@ -29,7 +29,7 @@ GEM
29
29
  excon (0.45.4)
30
30
  faraday (0.9.2)
31
31
  multipart-post (>= 1.2, < 3)
32
- faraday-encoding (0.0.2)
32
+ faraday-encoding (0.0.1)
33
33
  faraday
34
34
  faraday_middleware (0.10.0)
35
35
  faraday (>= 0.7.4, < 0.10)
@@ -1,3 +1,3 @@
1
1
  module Maremma
2
- VERSION = "2.1"
2
+ VERSION = "2.1.1"
3
3
  end
data/lib/maremma.rb CHANGED
@@ -22,7 +22,7 @@ module Maremma
22
22
  def self.post(url, options={})
23
23
  options[:content_type] ||= 'json'
24
24
  options[:data] ||= {}
25
- options[:headers] = set_headers(url, options)
25
+ options[:headers] = set_request_headers(url, options)
26
26
 
27
27
  conn = faraday_conn(options[:content_type], options)
28
28
 
@@ -38,7 +38,7 @@ module Maremma
38
38
 
39
39
  def self.get(url, options={})
40
40
  options[:content_type] ||= 'json'
41
- options[:headers] = set_headers(url, options)
41
+ options[:headers] = set_request_headers(url, options)
42
42
 
43
43
  conn = faraday_conn(options[:content_type], options)
44
44
 
@@ -80,7 +80,7 @@ module Maremma
80
80
  end
81
81
  end
82
82
 
83
- def self.set_headers(url, options)
83
+ def self.set_request_headers(url, options)
84
84
  options[:headers] ||= {}
85
85
  options[:headers]['Host'] = URI.parse(url).host
86
86
 
data/spec/maremma_spec.rb CHANGED
@@ -283,23 +283,23 @@ describe Maremma do
283
283
  context 'authentication' do
284
284
  it 'no auth' do
285
285
  options = {}
286
- expect(subject.set_headers(url, options)).to eq("Host"=>"example.org")
286
+ expect(subject.set_request_headers(url, options)).to eq("Host"=>"example.org")
287
287
  end
288
288
 
289
289
  it 'bearer' do
290
290
  options = { bearer: 'mF_9.B5f-4.1JqM' }
291
- expect(subject.set_headers(url, options)).to eq("Host"=>"example.org", "Authorization"=>"Bearer mF_9.B5f-4.1JqM")
291
+ expect(subject.set_request_headers(url, options)).to eq("Host"=>"example.org", "Authorization"=>"Bearer mF_9.B5f-4.1JqM")
292
292
  end
293
293
 
294
294
  it 'token' do
295
295
  options = { token: '12345' }
296
- expect(subject.set_headers(url, options)).to eq("Host"=>"example.org", "Authorization"=>"Token token=12345")
296
+ expect(subject.set_request_headers(url, options)).to eq("Host"=>"example.org", "Authorization"=>"Token token=12345")
297
297
  end
298
298
 
299
299
  it 'basic' do
300
300
  options = { username: 'foo', password: '12345' }
301
301
  basic = Base64.encode64("foo:12345")
302
- expect(subject.set_headers(url, options)).to eq("Host"=>"example.org", "Authorization"=>"Basic #{basic}")
302
+ expect(subject.set_request_headers(url, options)).to eq("Host"=>"example.org", "Authorization"=>"Basic #{basic}")
303
303
  end
304
304
  end
305
305
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maremma
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.1'
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner