quandl_client 2.4.6 → 2.4.7

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
2
  SHA1:
3
- metadata.gz: 14ef2307a4ae4d35586ec924b530d4d6a130bb1c
4
- data.tar.gz: 49c4b0c24f13a74a3211a6f0ad4ae5c0cab4f945
3
+ metadata.gz: 63746d1a5911c0123f53e0c8374249252ec885e0
4
+ data.tar.gz: 47bd1b09afd032baa38067c34cd4404d96ac52bf
5
5
  SHA512:
6
- metadata.gz: 3236ed60a30d3159f1face6085eae6dc4cbb213f53c862c071862ac904041b96cc58f8ae55ad5b95108b706ea80dd40ff1be2c33ea1f20efd5c51c1a38454390
7
- data.tar.gz: 331e27847d1e1cd3e015b91a72db6826033628498b74381479fa78cf8d2e15c4932eb2d6fba64adab64358c0e9d3b74ffb3b891797d694ce071b702cc7acee91
6
+ metadata.gz: 276cb82cd3f6269187b55ec918405a0e0c82f21be1ea33ca1eaf293e1086fa94f0a2ff890026fa1ca6589a7dcfa0ab328aa2bb7f8d1dcdb7229b10cff491c09a
7
+ data.tar.gz: 9dbe1625f4d9fa8847a8d5e59dcd2fdead945cf2e06ec3a7def4dca23c88799d3f8bbee8acf884eb8d97d48a5b4ee9eda209f6cd6fcd15622d9fbc4d8aa7a1e4
data/UPGRADE.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 2.4.7
2
+
3
+ * add middleware to track the origin of requests across quandl packages
4
+
5
+
1
6
  # 2.4.6
2
7
 
3
8
  * QUGC-43 improved message on wrong number of colums
data/lib/quandl/client.rb CHANGED
@@ -19,6 +19,16 @@ require 'quandl/client/models/user'
19
19
  module Quandl
20
20
  module Client
21
21
 
22
+ attr_accessor :request_source, :request_version
23
+
24
+ def request_source
25
+ @request_source ||= "quandl_client"
26
+ end
27
+
28
+ def request_version
29
+ @request_version ||= Quandl::Client::VERSION
30
+ end
31
+
22
32
  def self.use(url)
23
33
  Quandl::Client::Base.use(url)
24
34
  end
@@ -29,6 +29,7 @@ class Quandl::Client::Base
29
29
  def her_api
30
30
  Her::API.new.setup url: url_with_version do |c|
31
31
  c.use TokenAuthentication
32
+ c.use TrackRequestSource
32
33
  c.use Faraday::Request::UrlEncoded
33
34
  c.use Quandl::Client::Middleware::ParseJSON
34
35
  c.use Faraday::Adapter::NetHttp
@@ -75,6 +76,15 @@ class Quandl::Client::Base
75
76
  end
76
77
  end
77
78
 
79
+ class TrackRequestSource < Faraday::Middleware
80
+ def call(env)
81
+ env[:body] ||= {}
82
+ env[:body][:request_source] = Quandl::Client.request_source
83
+ env[:body][:request_version] = Quandl::Client.request_version
84
+ @app.call(env)
85
+ end
86
+ end
87
+
78
88
  end
79
89
 
80
90
  end
@@ -27,7 +27,7 @@ module Model
27
27
  @elapsed_request_time ||= (request_finished_at - request_started_at)
28
28
  end
29
29
 
30
- private
30
+ private
31
31
 
32
32
  def touch_request_started_at
33
33
  self.request_started_at = Time.now
@@ -1,6 +1,6 @@
1
1
  module Quandl
2
2
  module Client
3
- VERSION = '2.4.6'
3
+ VERSION = '2.4.7'
4
4
  API_VERSION = 'v2'
5
5
 
6
6
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.6
4
+ version: 2.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake