hyperfocal 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hyperfocal.rb +1 -0
- data/lib/hyperfocal/transmitter.rb +10 -3
- data/lib/hyperfocal/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5046ce4f7fdf2d932fe5b1a097009e5b758d4307
|
4
|
+
data.tar.gz: 3306a8afcdd06e0c254b202bc3746f176541ecf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c646aeebf4e1c75d73f0de5f9f872aa1a9963d579816ee35941a883bede37b3b819982ebad0931ab9ea64114f56e5901a4348b18ea422eb29ccd60989ed928a
|
7
|
+
data.tar.gz: f623089efa9e5bf563ee45280741cffd515b2e36bc2358c2eb99321c10ca79116ff41bc244317b31f72109de5fe42bc942d333f7fc3c169aa21e9130efa74d1b
|
data/lib/hyperfocal.rb
CHANGED
@@ -1,22 +1,29 @@
|
|
1
|
+
require 'typhoeus'
|
2
|
+
|
1
3
|
module Hyperfocal
|
2
4
|
module Transmitter
|
3
5
|
module_function
|
4
6
|
|
5
7
|
def send(type, params)
|
6
|
-
if
|
8
|
+
if send_event
|
7
9
|
url = URI(url_for(type))
|
8
10
|
params.merge!(environment: Hyperfocal.configuration.env)
|
9
|
-
|
11
|
+
Typhoeus.post(url, body: params)
|
10
12
|
else
|
11
13
|
Hyperfocal.logger.info "Logging #{type} params: #{params}"
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
15
17
|
def url_for(type)
|
16
|
-
raise 'Unknown Tracking Type' unless %w[ event metric
|
18
|
+
raise 'Unknown Tracking Type' unless %w[ event metric ].include?(type)
|
17
19
|
|
18
20
|
host = Hyperfocal.host
|
19
21
|
return "#{host}/#{type}"
|
20
22
|
end
|
23
|
+
|
24
|
+
def send_event
|
25
|
+
return true if Hyperfocal.configuration.env.nil?
|
26
|
+
Hyperfocal.configuration.environments.include?(Hyperfocal.configuration.env)
|
27
|
+
end
|
21
28
|
end
|
22
29
|
end
|
data/lib/hyperfocal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperfocal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pineworks Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: typhoeus
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|