spear-cb-api 0.0.13 → 0.0.14
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 +4 -4
- data/lib/spear/plugins/save_apis.rb +7 -14
- data/lib/spear/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: 883ee74220cec0fb8ab0ab79a870747c5d3be790
|
|
4
|
+
data.tar.gz: 89183395706d57d1daf4f93f44a5638af69a8f49
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2526f6e49622b4eafa36da14361de85f1d917abbcb0cb687f7bdc36597b329ff772be4f79e879f46dd3bf372cd33ada60783d8562584ede0ef5d4d46fca2b8a7
|
|
7
|
+
data.tar.gz: 3d0a89169a9cd2a62003a29c473f01c39453682b01a10d48a57b77eb745033bca9bb1fc7014bcc46e92d29a6a143901adcc743d2271d944c2f3804dc3e90387e
|
|
@@ -6,7 +6,7 @@ module Spear
|
|
|
6
6
|
extend ActiveSupport::Concern
|
|
7
7
|
|
|
8
8
|
included do
|
|
9
|
-
class_attribute :api_response, :api_started_at
|
|
9
|
+
class_attribute :api_response, :api_started_at
|
|
10
10
|
|
|
11
11
|
before_execute :record_started_time
|
|
12
12
|
after_execute :save_infos
|
|
@@ -17,8 +17,6 @@ module Spear
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def save_infos
|
|
20
|
-
self.api_async_job ||= AsyncSaveApi.new
|
|
21
|
-
|
|
22
20
|
params = {
|
|
23
21
|
project: Spear.project,
|
|
24
22
|
request: nil,
|
|
@@ -39,25 +37,20 @@ module Spear
|
|
|
39
37
|
params[:request][:FileBytes] = '...'
|
|
40
38
|
end
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
AsyncSaveApi.new.async.perform(params)
|
|
43
41
|
end
|
|
44
42
|
|
|
45
43
|
class AsyncSaveApi
|
|
44
|
+
include HTTParty
|
|
46
45
|
include SuckerPunch::Job
|
|
47
46
|
workers 4
|
|
48
47
|
|
|
49
48
|
def perform(options={})
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
body:
|
|
53
|
-
project: options[:project],
|
|
54
|
-
url: options[:url],
|
|
55
|
-
method: options[:method],
|
|
56
|
-
request: options[:request],
|
|
57
|
-
response: options[:response],
|
|
58
|
-
duration: options[:duration] }.to_json,
|
|
49
|
+
self.class.post(
|
|
50
|
+
'http://eventlogs.cb-apac.com/api/1/api-info',
|
|
51
|
+
body: options.to_json,
|
|
59
52
|
options: {headers: {'Content-Type' => 'application/json'}}
|
|
60
|
-
)
|
|
53
|
+
)
|
|
61
54
|
end
|
|
62
55
|
|
|
63
56
|
# def later(sec, data)
|
data/lib/spear/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spear-cb-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- CBluowei
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-03
|
|
11
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|