dino_utils 0.1.6 → 0.1.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: 3f66c7d51c434edb1b1cdb759519f6b6c894a37f
4
- data.tar.gz: 6f01d7f1da07016d7eb101d92788d788db905dd8
3
+ metadata.gz: e6bc89d610d713b0d4f68316656af11c671d53ea
4
+ data.tar.gz: 8ab15aafed134b191265f92e316bf65aee887e39
5
5
  SHA512:
6
- metadata.gz: 4133b6773ab962ebedeb27479c72b5112707f1d56a8d3a274a98dd4b429a166d90c8acf8977f28cdeaa4624b38312170a89021c2554543b386dced30a47bf184
7
- data.tar.gz: be11af8b162c558b3c4fa3baa05c9013832bd21b5eb9242088d35d5bf7d35dbc26ad34a1a1b9772fc8913a997de89217f2b3b0011fe5df39bb8a0f0312080327
6
+ metadata.gz: 3d0c5e04ff41d76eca51b806ed5bdeecfd82fbcc756da3ce55e4edb0e1c1d7e849467ea8468a860f38425be30a1f7951da7b626759add997603fa829849a9d54
7
+ data.tar.gz: eee3495e3ab6507e8641c4f0ad4758a13df816c86f379bb9dc8276f409d815e4df01e89899f7053e2ac5a0ba9473e010a43a68fd2fa8e129eebe4f0a7bf1dfbc
data/dino_utils.gemspec CHANGED
@@ -21,5 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.8"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
  spec.add_dependency "activerecord", ">= 3"
24
+ spec.add_dependency "faraday"
25
+ spec.add_dependency "faraday_middleware"
26
+ spec.add_dependency "faraday-conductivity"
24
27
  spec.add_dependency "pg"
25
28
  end
@@ -1,3 +1,3 @@
1
1
  module DinoUtils
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/dino_utils.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  require "dino_utils/version"
2
2
  require_relative 'dino/upsert'
3
3
  require_relative 'string_monkeypatch'
4
+ require_relative 'tn/http'
data/lib/tn/http.rb ADDED
@@ -0,0 +1,32 @@
1
+ require 'faraday'
2
+ require 'faraday_middleware'
3
+
4
+ module TN
5
+ module HTTP
6
+ ClientError = Class.new(Faraday::ClientError)
7
+
8
+ class WrapError < Faraday::Middleware
9
+ def call(env)
10
+ @app.call(env)
11
+ rescue Faraday::ClientError => e
12
+ raise ClientError.new(e)
13
+ end
14
+ end
15
+
16
+ def self.default_connection
17
+ Faraday.new do |conn|
18
+ conn.use TN::HTTP::WrapError
19
+ yield conn if block_given?
20
+ conn.adapter Faraday.default_adapter
21
+ end
22
+ end
23
+
24
+ def self.default_json_connection
25
+ default_connection do |conn|
26
+ conn.response :mashify
27
+ conn.response :json
28
+ yield conn if block_given?
29
+ end
30
+ end
31
+ end
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dino_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Van Dyk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,48 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: faraday_middleware
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: faraday-conductivity
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
55
97
  - !ruby/object:Gem::Dependency
56
98
  name: pg
57
99
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +142,7 @@ files:
100
142
  - lib/dino_utils.rb
101
143
  - lib/dino_utils/version.rb
102
144
  - lib/string_monkeypatch.rb
145
+ - lib/tn/http.rb
103
146
  homepage: https://github.com/tanga/dino_utils
104
147
  licenses:
105
148
  - MIT