maremma 2.4.1 → 2.4.2

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e85c7ec8aada2d2f923923b8b4e6dbab66db8bbe
4
- data.tar.gz: 3cac6cf66e744d64eaf2fb175f3d1ac3a868d390
3
+ metadata.gz: ad3e476013e011400f9cb2bc0cce7506edb73f1d
4
+ data.tar.gz: 8b82d6d99583631206cf98dd35f8fd918ec8b7a5
5
5
  SHA512:
6
- metadata.gz: f7c2c8fa0e410e7cec5dcb40dd48c7f9e847f08d424624b0756f9aea7fa56a770b28cfe39cf4105d40a0a00a3d0af2a41b6d5fe916484400a24eb7ce642a2b3a
7
- data.tar.gz: 4dfbcdb599d97e2dd9e7b9c5635756d8b0269d6ae9e4bad6a70d3bcfd5fa5acf84170916b6de8ebb7f37eaa4eb9da32746ee4ad28e5b6301b1df13a511179a98
6
+ metadata.gz: 8724f8d5520fa807b948343970745fd3fb8bfa04c1d2ad208b7d775fb811939bc5922d4d080a0f8dbb9381895e5183c667984bec0f4135a0600fc51a88ddc129
7
+ data.tar.gz: 002312c3ca9cb4889734ae4fa02f8edaba4e7822e99790068237414a41af3a0c304e59cf14c9db09e8839a28acd58740402a602d10f8151ed53398f17331c39b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maremma (2.4.1)
4
+ maremma (2.4.2)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  builder (~> 3.2, >= 3.2.2)
7
7
  excon (~> 0.45.0)
@@ -15,63 +15,63 @@ PATH
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activesupport (4.2.7.1)
18
+ activesupport (4.2.8)
19
19
  i18n (~> 0.7)
20
- json (~> 1.7, >= 1.7.7)
21
20
  minitest (~> 5.1)
22
21
  thread_safe (~> 0.3, >= 0.3.4)
23
22
  tzinfo (~> 1.1)
24
- addressable (2.5.0)
23
+ addressable (2.5.1)
25
24
  public_suffix (~> 2.0, >= 2.0.2)
26
- builder (3.2.2)
27
- codeclimate-test-reporter (1.0.0)
25
+ builder (3.2.3)
26
+ codeclimate-test-reporter (1.0.8)
27
+ simplecov (<= 0.13)
28
28
  crack (0.4.3)
29
29
  safe_yaml (~> 1.0.0)
30
- diff-lcs (1.2.5)
30
+ diff-lcs (1.3)
31
31
  docile (1.1.5)
32
32
  excon (0.45.4)
33
33
  faraday (0.9.2)
34
34
  multipart-post (>= 1.2, < 3)
35
35
  faraday-encoding (0.0.4)
36
36
  faraday
37
- faraday_middleware (0.10.0)
38
- faraday (>= 0.7.4, < 0.10)
39
- hashdiff (0.3.0)
40
- i18n (0.7.0)
41
- json (1.8.3)
37
+ faraday_middleware (0.10.1)
38
+ faraday (>= 0.7.4, < 1.0)
39
+ hashdiff (0.3.4)
40
+ i18n (0.8.4)
41
+ json (2.1.0)
42
42
  mini_portile2 (2.1.0)
43
- minitest (5.9.1)
43
+ minitest (5.10.2)
44
44
  multi_json (1.11.3)
45
45
  multipart-post (2.0.0)
46
46
  nokogiri (1.6.8.1)
47
47
  mini_portile2 (~> 2.1.0)
48
48
  oj (2.13.1)
49
- public_suffix (2.0.3)
50
- rack (2.0.1)
49
+ public_suffix (2.0.5)
50
+ rack (2.0.3)
51
51
  rack-test (0.6.3)
52
52
  rack (>= 1.0)
53
- rake (11.3.0)
54
- rspec (3.5.0)
55
- rspec-core (~> 3.5.0)
56
- rspec-expectations (~> 3.5.0)
57
- rspec-mocks (~> 3.5.0)
58
- rspec-core (3.5.4)
59
- rspec-support (~> 3.5.0)
60
- rspec-expectations (3.5.0)
53
+ rake (12.0.0)
54
+ rspec (3.6.0)
55
+ rspec-core (~> 3.6.0)
56
+ rspec-expectations (~> 3.6.0)
57
+ rspec-mocks (~> 3.6.0)
58
+ rspec-core (3.6.0)
59
+ rspec-support (~> 3.6.0)
60
+ rspec-expectations (3.6.0)
61
61
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.5.0)
63
- rspec-mocks (3.5.0)
62
+ rspec-support (~> 3.6.0)
63
+ rspec-mocks (3.6.0)
64
64
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.5.0)
66
- rspec-support (3.5.0)
65
+ rspec-support (~> 3.6.0)
66
+ rspec-support (3.6.0)
67
67
  safe_yaml (1.0.4)
68
- simplecov (0.12.0)
68
+ simplecov (0.13.0)
69
69
  docile (~> 1.1.0)
70
70
  json (>= 1.8, < 3)
71
71
  simplecov-html (~> 0.10.0)
72
- simplecov-html (0.10.0)
73
- thread_safe (0.3.5)
74
- tzinfo (1.2.2)
72
+ simplecov-html (0.10.1)
73
+ thread_safe (0.3.6)
74
+ tzinfo (1.2.3)
75
75
  thread_safe (~> 0.1)
76
76
  vcr (3.0.3)
77
77
  webmock (1.24.6)
data/lib/maremma.rb CHANGED
@@ -107,6 +107,9 @@ module Maremma
107
107
  options[:headers]['Authorization'] = "Bearer #{options[:bearer]}"
108
108
  elsif options[:token].present?
109
109
  options[:headers]["Authorization"] = "Token token=#{options[:token]}"
110
+ elsif options[:github_token].present?
111
+ # GitHub uses different format for token authentication
112
+ options[:headers]["Authorization"] = "Token #{options[:github_token]}"
110
113
  elsif options[:username].present?
111
114
  basic = Base64.encode64("#{options[:username]}:#{options[:password].to_s}")
112
115
  options[:headers]["Authorization"] = "Basic #{basic}"
@@ -1,3 +1,3 @@
1
1
  module Maremma
2
- VERSION = "2.4.1"
2
+ VERSION = "2.4.2"
3
3
  end
data/spec/maremma_spec.rb CHANGED
@@ -365,6 +365,11 @@ describe Maremma do
365
365
  expect(subject.set_request_headers(url, options)).to eq("User-Agent"=>"Maremma - https://github.com/datacite/maremma", "Accept"=>accept_header, "Authorization"=>"Token token=12345")
366
366
  end
367
367
 
368
+ it 'github_token' do
369
+ options = { github_token: '12345' }
370
+ expect(subject.set_request_headers(url, options)).to eq("User-Agent"=>"Maremma - https://github.com/datacite/maremma", "Accept"=>accept_header, "Authorization"=>"Token 12345")
371
+ end
372
+
368
373
  it 'basic' do
369
374
  options = { username: 'foo', password: '12345' }
370
375
  basic = Base64.encode64("foo:12345")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maremma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-06 00:00:00.000000000 Z
11
+ date: 2017-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday