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 +4 -4
- data/lib/hyperfocal/commands.rb +2 -0
- data/lib/hyperfocal/transmitter.rb +7 -2
- data/lib/hyperfocal/version.rb +1 -1
- data/lib/hyperfocal.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af956ecdf53cc84017a0d1b362646963f321465a
|
4
|
+
data.tar.gz: f702da8eabda2ef0fd808cd5aa336895cc9610ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61450ec87ffc997ba0dc82564273f70cf0960fe32bb31600388355827d322c35a80d024082b46d12421f2c87426deb6f4e60400c695d2205274610a050e5d36c
|
7
|
+
data.tar.gz: 66e679f8e470a22d0c07569f59d286e81150979c5b158453f7c7606d0c56f0fa2bd90cb0a4e3a95ca5f8da13fddc7da05e3fa2a998625cec7cc0adab0c201333
|
data/lib/hyperfocal/commands.rb
CHANGED
@@ -3,8 +3,13 @@ module Hyperfocal
|
|
3
3
|
module_function
|
4
4
|
|
5
5
|
def send(type, params)
|
6
|
-
|
7
|
-
|
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)
|
data/lib/hyperfocal/version.rb
CHANGED
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
|
-
@
|
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
|