admqr_knife 0.1.2 → 0.1.3
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/exe/admqr_visit +3 -1
- data/lib/admqr_knife.rb +4 -1
- data/lib/admqr_knife/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b49e1135d4ebb318fe9a27720b326418f896b24b1e3287d04861ef0d98eb9869
|
4
|
+
data.tar.gz: 45cfda2e1a7c67fcd05f4ef224a3b24604c371eb9d1bd97b068644c72171ffc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11966f6fd78f9417cc69523b1cbe6f602a4f73350a6227e8c480bb5d58dbb967b203199f4c4289461c77c0c3a593f70b57c5f47554f0395453f405e7caf1f245
|
7
|
+
data.tar.gz: 851360d2eea2e64a439a0a8073465748dfdedcaa3bb5aad74474e6897a032b8af08d46b4cc46156bbc2b667130bf08a19069aded829c64f1642a33d80a1154ce
|
data/exe/admqr_visit
CHANGED
@@ -11,15 +11,17 @@ class AdmqrVisitCLI < Thor
|
|
11
11
|
option :ua, desc: "visitor's user agent"
|
12
12
|
option :referer, desc: 'visitor from '
|
13
13
|
option :tag, desc: 'project name'
|
14
|
+
option :extra, desc: 'extra info'
|
14
15
|
option :new_to_visit, type: :boolean, desc: 'is a new visit', default: true
|
15
16
|
|
16
17
|
def record(unique_code)
|
17
18
|
AdmqrKnife.init(options[:client_key])
|
18
19
|
AdmqrKnife.visit(unique_code: unique_code,
|
19
|
-
client_ua: options[:ua],
|
20
|
+
client_ua: options[:ua] || options[:client_ua],
|
20
21
|
referer: options[:referer],
|
21
22
|
tag: options[:tag],
|
22
23
|
new_to_visit: options[:new_to_visit],
|
24
|
+
extra: options[:extra],
|
23
25
|
remote_ip: options[:remote_ip])
|
24
26
|
AdmqrKnife.logger.debug('ok!')
|
25
27
|
end
|
data/lib/admqr_knife.rb
CHANGED
@@ -24,16 +24,19 @@ module AdmqrKnife
|
|
24
24
|
def visit(unique_code:, **options)
|
25
25
|
raise 'unique_code 不能为空' if unique_code.to_s == ''
|
26
26
|
|
27
|
-
ua = options[:ua]
|
27
|
+
ua = options[:ua] || options[:client_ua]
|
28
28
|
referer = options[:referer]
|
29
29
|
tag = options[:tag]
|
30
30
|
new_to_visit = options[:new_to_visit]
|
31
31
|
remote_ip = options[:remote_ip]
|
32
|
+
extra = options[:extra]
|
32
33
|
CubeService.post('/api/knifes/statis',
|
33
34
|
{ unique_code: unique_code,
|
34
35
|
client_ua: ua,
|
35
36
|
referer: referer,
|
37
|
+
extra: extra,
|
36
38
|
tag: tag,
|
39
|
+
extra: extra,
|
37
40
|
new_to_visit: new_to_visit,
|
38
41
|
remote_ip: remote_ip }.reject! { |_k, v| v.nil? })
|
39
42
|
rescue StandardError => e
|
data/lib/admqr_knife/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: admqr_knife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- atpking
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|