mashape-analytics 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/README.md +5 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/mashape-analytics/frameworks/rack.rb +7 -3
- data/mashape-analytics.gemspec +7 -7
- data/test/helper.rb +2 -1
- data/test/test_capture.rb +1 -1
- data/test/test_rack.rb +2 -2
- data/test/test_sinatra.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 250f90de0c62a79b8bb236f960e08d2bc8561901
|
4
|
+
data.tar.gz: a1cfe8f56a5aad8f5d37d31b92889547e5039acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 750577b3c2cc0ffa9ca40e6c7a460bce92482fe120003f0bc40312d4fbbd2411bb8d4c48a658d2d3fcbdddb2ac16ed0e89c0a4fb04dfc5718eddd00eb7edf22d
|
7
|
+
data.tar.gz: 84f6dd47a13cdd9d169ac406958ec7bc0363df2a764d7f6b419ee404331d249fc7cc3e50531629000fdfe70998b30ec28a8348a50e4f43ac476b4ac193570cc7
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ require 'rake'
|
|
14
14
|
require 'jeweler'
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
-
gem.name = "
|
17
|
+
gem.name = "mashape-analytics"
|
18
18
|
gem.homepage = "http://github.com/Mashape/analytics-agent-ruby"
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = %Q{Ruby agent for Mashape API Analytics}
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
@@ -19,9 +19,9 @@ module MashapeAnalytics::Frameworks
|
|
19
19
|
@service_token = options[:service_token]
|
20
20
|
@environment = options[:environment] || ''
|
21
21
|
@send_body = options[:send_body] || false
|
22
|
-
host = options[:host] || 'socket.analytics.mashape.com:5500'
|
22
|
+
host = options[:host] || 'tcp://socket.analytics.mashape.com:5500'
|
23
23
|
|
24
|
-
MashapeAnalytics::Capture.setOptions(host:
|
24
|
+
MashapeAnalytics::Capture.setOptions(host: host)
|
25
25
|
end
|
26
26
|
|
27
27
|
def call(env)
|
@@ -102,7 +102,11 @@ module MashapeAnalytics::Frameworks
|
|
102
102
|
if request['HTTP_CONTENT_LENGTH']
|
103
103
|
request['HTTP_CONTENT_LENGTH'].to_i
|
104
104
|
else
|
105
|
-
request['rack.input'].size
|
105
|
+
if request['rack.input'].respond_to? :size
|
106
|
+
request['rack.input'].size
|
107
|
+
else
|
108
|
+
-1 # Not available
|
109
|
+
end
|
106
110
|
end
|
107
111
|
end
|
108
112
|
|
data/mashape-analytics.gemspec
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: mashape-analytics 1.0.
|
5
|
+
# stub: mashape-analytics 1.0.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "mashape-analytics"
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["
|
13
|
+
s.authors = ["Kenneth Lee"]
|
14
14
|
s.date = "2015-06-25"
|
15
|
-
s.description = "The ruby agent
|
16
|
-
s.email = "
|
15
|
+
s.description = "The ruby agent reports API traffic to http://apianalytics.com"
|
16
|
+
s.email = "kennethkl@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE",
|
19
19
|
"README.md"
|
@@ -27,7 +27,6 @@ Gem::Specification.new do |s|
|
|
27
27
|
"README.md",
|
28
28
|
"Rakefile",
|
29
29
|
"VERSION",
|
30
|
-
"mashape-analytics.gemspec",
|
31
30
|
"lib/mashape-analytics.rb",
|
32
31
|
"lib/mashape-analytics/capture.rb",
|
33
32
|
"lib/mashape-analytics/frameworks.rb",
|
@@ -37,6 +36,7 @@ Gem::Specification.new do |s|
|
|
37
36
|
"lib/mashape-analytics/message.rb",
|
38
37
|
"lib/mashape-analytics/message/alf.rb",
|
39
38
|
"lib/mashape-analytics/utils.rb",
|
39
|
+
"mashape-analytics.gemspec",
|
40
40
|
"test/helper.rb",
|
41
41
|
"test/test_capture.rb",
|
42
42
|
"test/test_rack.rb",
|
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
|
|
45
45
|
s.homepage = "http://github.com/Mashape/analytics-agent-ruby"
|
46
46
|
s.licenses = ["MIT"]
|
47
47
|
s.rubygems_version = "2.4.6"
|
48
|
-
s.summary = "Ruby agent for Mashape Analytics"
|
48
|
+
s.summary = "Ruby agent for Mashape API Analytics"
|
49
49
|
|
50
50
|
if s.respond_to? :specification_version then
|
51
51
|
s.specification_version = 4
|
data/test/helper.rb
CHANGED
@@ -39,7 +39,8 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
39
39
|
require 'mashape-analytics'
|
40
40
|
|
41
41
|
class MiniTest::Test
|
42
|
-
@@host = 'tcp://127.0.0.1:
|
42
|
+
@@host = 'tcp://127.0.0.1:' << (56000 + rand(999)).to_s
|
43
|
+
puts 'Using test zmq server ' << @@host
|
43
44
|
|
44
45
|
MashapeAnalytics::Capture.setOptions(host: @@host) # Set default host
|
45
46
|
|
data/test/test_capture.rb
CHANGED
data/test/test_rack.rb
CHANGED
@@ -9,7 +9,7 @@ class TestRack < MiniTest::Test
|
|
9
9
|
sleep 0.05
|
10
10
|
[200, {'CONTENT-TYPE' => 'application/json'}, ['{"messages": "Test Response"}']]
|
11
11
|
end
|
12
|
-
stack = MashapeAnalytics::Frameworks::Rack.new app, service_token: 'SERVICE-TOKEN', host:
|
12
|
+
stack = MashapeAnalytics::Frameworks::Rack.new app, service_token: 'SERVICE-TOKEN', host: @@host, send_body: @send_body
|
13
13
|
Rack::MockRequest.new(stack)
|
14
14
|
end
|
15
15
|
|
@@ -20,7 +20,7 @@ class TestRack < MiniTest::Test
|
|
20
20
|
|
21
21
|
def teardown
|
22
22
|
MashapeAnalytics::Capture.disconnect
|
23
|
-
@zmq_pull.close
|
23
|
+
@zmq_pull.close if @zmq_pull != nil
|
24
24
|
@send_body = false
|
25
25
|
end
|
26
26
|
|
data/test/test_sinatra.rb
CHANGED
@@ -11,7 +11,7 @@ class TestSinatra < MiniTest::Test
|
|
11
11
|
Sinatra.new do
|
12
12
|
register MashapeAnalytics::Frameworks::Sinatra
|
13
13
|
|
14
|
-
mashapeAnalytics! 'MY-API-KEY', host:
|
14
|
+
mashapeAnalytics! 'MY-API-KEY', host: @@host, send_body: true
|
15
15
|
|
16
16
|
get('/get') { 'GET Endpoint' }
|
17
17
|
post('/post') { 'POST Endpoint' }
|
@@ -20,7 +20,7 @@ class TestSinatra < MiniTest::Test
|
|
20
20
|
|
21
21
|
def setup
|
22
22
|
# Create our socket server
|
23
|
-
@zmq_pull = zmq_pull_socket(
|
23
|
+
@zmq_pull = zmq_pull_socket(@@host)
|
24
24
|
end
|
25
25
|
|
26
26
|
def teardown
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mashape-analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Kenneth Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -134,8 +134,8 @@ dependencies:
|
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '1.4'
|
137
|
-
description: The ruby agent
|
138
|
-
email:
|
137
|
+
description: The ruby agent reports API traffic to http://apianalytics.com
|
138
|
+
email: kennethkl@gmail.com
|
139
139
|
executables: []
|
140
140
|
extensions: []
|
141
141
|
extra_rdoc_files:
|
@@ -187,5 +187,5 @@ rubyforge_project:
|
|
187
187
|
rubygems_version: 2.4.6
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
|
-
summary: Ruby agent for Mashape Analytics
|
190
|
+
summary: Ruby agent for Mashape API Analytics
|
191
191
|
test_files: []
|