productive 0.5.10 → 0.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/productive/configuration.rb +2 -4
- data/lib/productive/resources/base.rb +8 -2
- data/lib/productive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52fc4794c8e9b00c020e634dfbe3de6989ba0200
|
4
|
+
data.tar.gz: 0f501300c68fd6f2a8c2e48869ee868b826e8579
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
55
|
+
connection(rebuild: true)
|
50
56
|
end
|
51
57
|
|
52
58
|
def self.all(args = {})
|
data/lib/productive/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|