hyperfocal 0.2.2 → 0.3.0

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: 748ec2dc0d47db1fc7452ff42c54039227a313f5
4
- data.tar.gz: 66449c63dc648703fc034d49da6b4c1e094716f3
3
+ metadata.gz: af956ecdf53cc84017a0d1b362646963f321465a
4
+ data.tar.gz: f702da8eabda2ef0fd808cd5aa336895cc9610ed
5
5
  SHA512:
6
- metadata.gz: 19f36d2d8ccf18ccfa74574014edcbbecc9c64354c50e0ca9f286584f82015f2862de761405f33b0750d0cdf39a2b3575bf12cf12ab565bdda9caee8975288dd
7
- data.tar.gz: e456ebd12d51db1c84bc54dabcf5684b1b5f544b1c2737b6cf01dea0f019f5f15fdff84d07af968ddb7c7777cab0e49eedc9faa54c08a80e1bf47cbb375268cc
6
+ metadata.gz: 61450ec87ffc997ba0dc82564273f70cf0960fe32bb31600388355827d322c35a80d024082b46d12421f2c87426deb6f4e60400c695d2205274610a050e5d36c
7
+ data.tar.gz: 66e679f8e470a22d0c07569f59d286e81150979c5b158453f7c7606d0c56f0fa2bd90cb0a4e3a95ca5f8da13fddc7da05e3fa2a998625cec7cc0adab0c201333
@@ -49,6 +49,8 @@ module Hyperfocal
49
49
  f.puts <<-CONF
50
50
  Hyperfocal.configure do |config|
51
51
  config.app_id = '#{token}'
52
+ # Configure Tracking Environments, as an array
53
+ # config.environments = [ 'production' ]
52
54
  end
53
55
  CONF
54
56
  end
@@ -3,8 +3,13 @@ module Hyperfocal
3
3
  module_function
4
4
 
5
5
  def send(type, params)
6
- url = URI(url_for(type))
7
- Net::HTTP.post_form(url, params)
6
+ if Hyperfocal.configuration.environments.include?(Hyperfocal.configuration.env)
7
+ url = URI(url_for(type))
8
+ params.merge!(environment: Hyperfocal.configuration.env)
9
+ Net::HTTP.post_form(url, params)
10
+ else
11
+ Hyperfocal.logger.info "Logging #{type} params: #{params}"
12
+ end
8
13
  end
9
14
 
10
15
  def url_for(type)
@@ -1,3 +1,3 @@
1
1
  module Hyperfocal
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/hyperfocal.rb CHANGED
@@ -45,14 +45,22 @@ module Hyperfocal
45
45
  thr.join
46
46
  thr.exit
47
47
  end
48
+
49
+ def logger
50
+ Logger.new(STDOUT)
51
+ end
48
52
  end
49
53
 
50
54
  class Configuration
51
55
  attr_accessor :app_id
56
+ attr_accessor :environments
57
+ attr_reader :env
52
58
  attr_reader :host
53
59
 
54
60
  def initialize
55
- @host = 'https://api.hyperfocal.io'
61
+ @env = (ENV['RAILS_ENV'] || ENV['RACK_ENV'])
62
+ @host = 'https://api.hyperfocal.io'.freeze
63
+ @environments = %w[ production ].freeze
56
64
  end
57
65
  end
58
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperfocal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pineworks Inc.