productive 0.5.10 → 0.5.11

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: 162e0cd76005cfc7584d703d761d142eb74ad779
4
- data.tar.gz: d970134e0e73742da531ce2b418b91c811ce9cc3
3
+ metadata.gz: 52fc4794c8e9b00c020e634dfbe3de6989ba0200
4
+ data.tar.gz: 0f501300c68fd6f2a8c2e48869ee868b826e8579
5
5
  SHA512:
6
- metadata.gz: e9a30911d1b3a95f3260c55882c7026ed990ff4fb54cd086197c5ba87a9cd42b0df6bb9f3905afa62ce8eccba236c55db906ff35d14da6beab2782738c8af909
7
- data.tar.gz: d021f8cceb15f8bf330b421aedf821b6b861997a7f718026e99bff3dc6fc3822039384bae4016c4c89ec31e12c3aff0aec9cc2531eff5c22d17ca140f649699b
6
+ metadata.gz: f1e721aa94259d811c141ec6bcfe0b1192dcab83c33d0889c19100f33c26a51ed6d16f6ee86b42a5823ae6e646532efa87ac084f1bdb4e0fb06f2dd347e09383
7
+ data.tar.gz: 80e4878f56f57968b7b5cb06dc7eaf8f4981c9711bbc6a32175cc52101bf1694a44200c565e61098990c5e69ec235762a09d6b148f0205736c06399517e9e7a9
@@ -2,16 +2,14 @@ require 'json_api_paginator'
2
2
 
3
3
  module Productive
4
4
  class Configuration
5
- attr_accessor :api_key
6
- attr_accessor :account_id
7
- attr_accessor :base_url
8
- attr_accessor :paginator
5
+ attr_accessor :api_key, :account_id, :base_url, :paginator, :connection_options
9
6
 
10
7
  def initialize
11
8
  self.api_key = ENV['PRODUCTIVE_API_KEY']
12
9
  self.account_id = ENV['PRODUCTIVE_ACCOUNT_ID']
13
10
  self.base_url = 'https://api.productive.io/api/v2/'
14
11
  self.paginator = JsonApiPaginator
12
+ self.connection_options = {}
15
13
  end
16
14
  end
17
15
  end
@@ -38,7 +38,13 @@ module Productive
38
38
  end
39
39
 
40
40
  def self.connection_options_setup(config)
41
- self.connection_options = { headers: { 'X-Auth-Token' => config.api_key } }
41
+ if config.connection_options[:headers].nil?
42
+ config.connection_options[:headers] = { 'X-Auth-Token' => config.api_key }
43
+ else
44
+ config.connection_options[:headers]['X-Auth-Token'] = config.api_key
45
+ end
46
+
47
+ self.connection_options = config.connection_options
42
48
  end
43
49
 
44
50
  def self.paginator_setup(config)
@@ -46,7 +52,7 @@ module Productive
46
52
  end
47
53
 
48
54
  def self.reset_connection
49
- self.connection(rebuild: true)
55
+ connection(rebuild: true)
50
56
  end
51
57
 
52
58
  def self.all(args = {})
@@ -1,3 +1,3 @@
1
1
  module Productive
2
- VERSION = '0.5.10'.freeze
2
+ VERSION = '0.5.11'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: productive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josip Bišćan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-06 00:00:00.000000000 Z
11
+ date: 2017-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack