trackets 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/README.md +12 -1
- data/Rakefile +13 -0
- data/features/step_definitions/rails_steps.rb +3 -3
- data/features/support/env.rb +1 -1
- data/lib/trackets.rb +8 -2
- data/lib/trackets/configuration.rb +3 -1
- data/lib/trackets/jobs/notice_job.rb +14 -0
- data/lib/trackets/plugins/sidekiq.rb +13 -0
- data/lib/trackets/version.rb +1 -1
- data/trackets.gemspec +1 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7d548db30dc736130eda8fc2b503d74b43a467b
|
4
|
+
data.tar.gz: 8b35ff2ab836564178cc7a745acf582f41484f5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c631c43b76d4c45a27bdb357ec3d39bf23eb80068ae1bee9f7cd4dd4f65fcf7883e8329b5bc5791a621582e5f9958be8272e57f25890d49e98ca065ad7bb95b
|
7
|
+
data.tar.gz: ce27dad218703ac4153629e0d64484b96b430962e380909cb1a56ecfd80c6ff33f86decebadcbf60d51281e30266e917522bc60aa0aba8d789a13a141acab291
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Trackets
|
1
|
+
# Trackets [![Build Status](https://travis-ci.org/sensible/trackets-ruby.svg?branch=master)](https://travis-ci.org/sensible/trackets-ruby)
|
2
2
|
|
3
3
|
WIP gem for Trackets.com service
|
4
4
|
|
@@ -25,6 +25,17 @@ To include JavaScript tracking code in your app just add this line to your `app/
|
|
25
25
|
<%= trackets_include_tag %>
|
26
26
|
```
|
27
27
|
|
28
|
+
### Configuration
|
29
|
+
|
30
|
+
Can be found in `config/initializers/trackets.rb`
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
Trackets.setup do |config|
|
34
|
+
config.api_key = "ebf6d706b29ca4e176012a3dc3b017a8" # API key for your Project
|
35
|
+
config.async = true # [Default: false] Send notification in a separate thread (Uses Sucker Punch gem)
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
28
39
|
## Rack
|
29
40
|
|
30
41
|
Simple `example.ru`
|
data/Rakefile
CHANGED
@@ -1,2 +1,15 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
+
begin
|
4
|
+
require 'cucumber/rake/task'
|
5
|
+
rescue LoadError
|
6
|
+
$stderr.puts "Cucumber not installed, please run"
|
7
|
+
$stderr.puts "$ gem install cucumber"
|
8
|
+
exit 1
|
9
|
+
end
|
10
|
+
|
11
|
+
Cucumber::Rake::Task.new(:cucumber) do |t|
|
12
|
+
t.fork = true
|
13
|
+
end
|
14
|
+
|
15
|
+
task :default => :cucumber
|
@@ -51,12 +51,12 @@ end
|
|
51
51
|
|
52
52
|
Then(/^last notice params should (?:(not ))?contain "(.*?)"$/) do |negator, string|
|
53
53
|
if negator
|
54
|
-
last_notice_serialized_data.
|
54
|
+
expect(last_notice_serialized_data).to_not match string
|
55
55
|
else
|
56
|
-
last_notice_serialized_data.
|
56
|
+
expect(last_notice_serialized_data).to match string
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
Then(/^last notice params for key "(.*?)" is "(.*?)"$/) do |key, val|
|
61
|
-
last_notice_params_for(key).
|
61
|
+
expect(last_notice_params_for(key)).to eq val
|
62
62
|
end
|
data/features/support/env.rb
CHANGED
data/lib/trackets.rb
CHANGED
@@ -2,13 +2,16 @@ require "trackets/version"
|
|
2
2
|
require "trackets/railtie" if defined?(Rails)
|
3
3
|
require "trackets/middleware/rack_exception_handler"
|
4
4
|
require "trackets/configuration"
|
5
|
-
require "trackets/
|
5
|
+
require "trackets/plugins/sidekiq"
|
6
|
+
require "trackets/jobs/notice_job"
|
6
7
|
|
7
8
|
module Trackets
|
8
9
|
class << self
|
9
10
|
|
10
11
|
def setup
|
11
12
|
yield(configuration)
|
13
|
+
|
14
|
+
Plugins::Sidekiq.new if defined?(::Sidekiq)
|
12
15
|
end
|
13
16
|
|
14
17
|
def configuration
|
@@ -16,7 +19,10 @@ module Trackets
|
|
16
19
|
end
|
17
20
|
|
18
21
|
def notify(exception, env = nil)
|
19
|
-
|
22
|
+
job = NoticeJob.new
|
23
|
+
job = job.async if Trackets.configuration.async?
|
24
|
+
|
25
|
+
job.perform(exception, env)
|
20
26
|
end
|
21
27
|
|
22
28
|
class TracketsCustomException < StandardError; end
|
@@ -27,12 +27,14 @@ module Trackets
|
|
27
27
|
|
28
28
|
DEFAULT_API_URL = "https://trackets.com"
|
29
29
|
|
30
|
-
attr_accessor :api_url, :api_key, :environment_name, :project_root, :framework, :whitelisted_env, :blacklisted_params
|
30
|
+
attr_accessor :api_url, :api_key, :environment_name, :project_root, :framework, :whitelisted_env, :blacklisted_params, :async
|
31
|
+
alias_method :async?, :async
|
31
32
|
|
32
33
|
def initialize
|
33
34
|
@api_url = DEFAULT_API_URL
|
34
35
|
@whitelisted_env = DEFAULT_WHITELISTED_ENV_KEYS
|
35
36
|
@blacklisted_params = DEFAULT_BLACKLISTED_PARAMS
|
37
|
+
@async = false
|
36
38
|
end
|
37
39
|
|
38
40
|
def rack_filter_keys(rack_env = nil)
|
data/lib/trackets/version.rb
CHANGED
data/trackets.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_runtime_dependency "json"
|
22
22
|
spec.add_runtime_dependency "httparty", "~> 0.13"
|
23
23
|
spec.add_runtime_dependency "rack"
|
24
|
+
spec.add_runtime_dependency "sucker_punch", "~> 1.0.5"
|
24
25
|
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.6"
|
26
27
|
spec.add_development_dependency "cucumber-rails", "~> 1.4.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Votava
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sucker_punch
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.5
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.0.5
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,6 +144,7 @@ extensions: []
|
|
130
144
|
extra_rdoc_files: []
|
131
145
|
files:
|
132
146
|
- ".gitignore"
|
147
|
+
- ".travis.yml"
|
133
148
|
- Gemfile
|
134
149
|
- LICENSE.txt
|
135
150
|
- README.md
|
@@ -148,9 +163,11 @@ files:
|
|
148
163
|
- lib/trackets/backtrace.rb
|
149
164
|
- lib/trackets/client.rb
|
150
165
|
- lib/trackets/configuration.rb
|
166
|
+
- lib/trackets/jobs/notice_job.rb
|
151
167
|
- lib/trackets/middleware/rack_exception_handler.rb
|
152
168
|
- lib/trackets/null_env.rb
|
153
169
|
- lib/trackets/params.rb
|
170
|
+
- lib/trackets/plugins/sidekiq.rb
|
154
171
|
- lib/trackets/rack_env_sanitizer.rb
|
155
172
|
- lib/trackets/railtie.rb
|
156
173
|
- lib/trackets/version.rb
|