admqr_knife 0.1.2 → 0.1.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: f941f3ef287b3045821af11a43905f1ad92b74c4fde34222512f645504123aba
4
- data.tar.gz: a010233306b667c1a0b6463b75506f397cbb1e9e6a04befab7c30f68e92612be
3
+ metadata.gz: b49e1135d4ebb318fe9a27720b326418f896b24b1e3287d04861ef0d98eb9869
4
+ data.tar.gz: 45cfda2e1a7c67fcd05f4ef224a3b24604c371eb9d1bd97b068644c72171ffc9
5
5
  SHA512:
6
- metadata.gz: 25fb8abae5f06e22aba0fb824acc53b9c8d6fca78069b37f95b0fab51078df91bacb21bb99aa5fd155e515110b32ad73fd0f07a033083c650f76a4b0cbe45991
7
- data.tar.gz: 11c812380fb975ed7b4faa2d707651d9d219c0b8531a29327d7bb0204b6344a623d7adfdb58808cc9f4029dc2ffd6b4788c7faf139c4cd92c764651ca6858488
6
+ metadata.gz: 11966f6fd78f9417cc69523b1cbe6f602a4f73350a6227e8c480bb5d58dbb967b203199f4c4289461c77c0c3a593f70b57c5f47554f0395453f405e7caf1f245
7
+ data.tar.gz: 851360d2eea2e64a439a0a8073465748dfdedcaa3bb5aad74474e6897a032b8af08d46b4cc46156bbc2b667130bf08a19069aded829c64f1642a33d80a1154ce
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module AdmqrKnife
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-13 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler