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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98d5cc54434b7874f694e24cb925916b401d937a
4
- data.tar.gz: 89ba9848150f40306d0aa62c4442feefc51ded66
3
+ metadata.gz: 5046ce4f7fdf2d932fe5b1a097009e5b758d4307
4
+ data.tar.gz: 3306a8afcdd06e0c254b202bc3746f176541ecf2
5
5
  SHA512:
6
- metadata.gz: c0d51fe0663176a610e345ddf1b7d0671fddf4d18579f9e3505c792688298acb26e3ef1fbd76b91a77c386f6b0a7af89050c060c571ed7b70efbe0c5654a4b9c
7
- data.tar.gz: 66ce07622fa0e2131d9a44dff14d1b06941f5b327a24ec39d29e9448cfae7141e2ad8bb3b6129da65e70fd03d46d02d351f40dbe185fc494b1c710e5f434ca49
6
+ metadata.gz: 1c646aeebf4e1c75d73f0de5f9f872aa1a9963d579816ee35941a883bede37b3b819982ebad0931ab9ea64114f56e5901a4348b18ea422eb29ccd60989ed928a
7
+ data.tar.gz: f623089efa9e5bf563ee45280741cffd515b2e36bc2358c2eb99321c10ca79116ff41bc244317b31f72109de5fe42bc942d333f7fc3c169aa21e9130efa74d1b
data/lib/hyperfocal.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "yaml"
2
+ require "logger"
2
3
  require "hyperfocal/version"
3
4
  require "hyperfocal/transmitter"
4
5
 
@@ -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 Hyperfocal.configuration.environments.include?(Hyperfocal.configuration.env)
8
+ if send_event
7
9
  url = URI(url_for(type))
8
10
  params.merge!(environment: Hyperfocal.configuration.env)
9
- Net::HTTP.post_form(url, params)
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 user ].include?(type)
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
@@ -1,3 +1,3 @@
1
1
  module Hyperfocal
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
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.0
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-01-24 00:00:00.000000000 Z
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