antbird 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: 2b134c730af7d5ff2f88b64158aba346bf92e412439de8501df3608bc52dba06
4
- data.tar.gz: 75efcb9f9e87f3371ef48e793fbfd630a122213719e79c43d276cf48186ef69b
3
+ metadata.gz: b4c5039ccff974fe57df1991a32faec3f4c6ff5e42ff564bc54e4e2541a65c2f
4
+ data.tar.gz: c27abf56cb4429a89a9577b5f29e44df00e5b5d081d94a4292725697c69f8334
5
5
  SHA512:
6
- metadata.gz: 0d2b4cde70a9eefe2ca1e5776c6bb1743ec7c0a57d77bf8487fc3098f37499a12402597a18afd31b12d815bee7bedf08f808e3877aff490295a554b5365c904e
7
- data.tar.gz: dea3a216fb467d5aa03be1ee51ad14f6955f4dfdc23653b122d574f373c94aabde8f31e385665ad15ba29aedbffc0e54205f55faac495fd0e29f9bc754a5c413
6
+ metadata.gz: b39414eacac5c6fab86828ea7f62ef9be11b7f9e74143876d2a551812ea544cba03b5b18aa9f814f632eebe60b20b038461e0c52ef5a556fb071d07ab30a13bf
7
+ data.tar.gz: e55b1cd638bf572c87b304e9a81fecdbf1c6763893788eecfee1a82daf73b0ffe9bb9d4fa72aa164aac660e31030f9699a3750a763cabad8c44ac9b4f79e530d
data/README.md CHANGED
@@ -38,6 +38,26 @@ client = Antbird::Client.new(
38
38
  type: 'test-type'
39
39
  }
40
40
  )
41
+
42
+ # OR
43
+
44
+ require 'faraday_middleware'
45
+ require 'faraday_middleware/aws_sigv4'
46
+ client = Antbird::Client.new(
47
+ url: ENV['AMAZON_ELASTICSEARCH_SERVICE_URL'],
48
+ scope: {
49
+ index: 'test-index',
50
+ type: 'test-type'
51
+ }
52
+ ) do |f|
53
+ f.request(
54
+ :aws_sigv4,
55
+ service: 'es',
56
+ region: 'ap-northeast-1',
57
+ access_key_id: ENV['AWS_ACCESS_KEY_ID'],
58
+ secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
59
+ )
60
+ end
41
61
  ```
42
62
 
43
63
  ### Call APIs
@@ -9,11 +9,13 @@ module Antbird
9
9
  url: "http://localhost:9200",
10
10
  version: nil,
11
11
  read_timeout: 5,
12
- open_timeout: 2)
12
+ open_timeout: 2,
13
+ &block)
13
14
 
14
15
  @read_timeout = read_timeout
15
16
  @open_timeout = open_timeout
16
- @url = url
17
+ @block = block
18
+ @url = url
17
19
 
18
20
  @scope = scope.transform_keys(&:to_sym)
19
21
  @version = version || fetch_version
@@ -137,6 +139,7 @@ module Antbird
137
139
 
138
140
  def connection
139
141
  @connection ||= Faraday.new(url) do |conn|
142
+ @block.call(conn) if @block
140
143
  conn.request :json
141
144
  conn.response :json, :content_type => /\bjson$/
142
145
 
@@ -1,3 +1,3 @@
1
1
  module Antbird
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: antbird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - fukayatsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday