informant-rails 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.markdown +14 -2
- data/lib/informant-rails/client.rb +9 -7
- data/lib/informant-rails/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3cd34b55c4fc5c175628f5198184352c708c551
|
4
|
+
data.tar.gz: bfd50eab239dd0a81313ae9c2831f4c6bc2cdaff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eee3dde5157af66a4bf3e319892700306c66e2200058a303e10cc2dde3775977c1cc5f99f939ccddd78f3178d23a9bbe92755573a2e977732d9fc314db04fcc5
|
7
|
+
data.tar.gz: 9fdbeb73d2bcbf0477588b9ee3afe9739c27019239c8de7e02828fcac85219ad764c238e808a2d5d2989a2ac7d00c7ac0b85ff7fbe8243f4fc26344be52d9004
|
data/README.markdown
CHANGED
@@ -4,11 +4,23 @@
|
|
4
4
|
|
5
5
|
The informant-rails gem provides Rails and ActiveRecord hooks for The Informant.
|
6
6
|
|
7
|
-
[](https://addons.heroku.com.com/informant)
|
8
8
|
|
9
9
|
## Compatibility
|
10
10
|
|
11
|
-
|
11
|
+
The informant-rails gem is tested against Ruby 1.9.3, 2.0.0, and Rubinius.
|
12
12
|
|
13
13
|
[](http://travis-ci.org/informant/informant-rails)
|
14
14
|
[](https://codeclimate.com/github/informant/informant-rails)
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Provision the Heroku add-on through their interface. Then add the `informant-rails` gem to your `Gemfile`.
|
19
|
+
|
20
|
+
```
|
21
|
+
gem 'informant-rails', group: :production
|
22
|
+
```
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
By default, any request that causes an ActiveRecord model to be validated will be tracked by the Informant once the gem is added to your project.
|
@@ -5,7 +5,9 @@ module InformantRails
|
|
5
5
|
@requests = {}
|
6
6
|
|
7
7
|
def self.record(env)
|
8
|
-
|
8
|
+
unless env['REQUEST_METHOD'] == 'GET'
|
9
|
+
new_request.request_url = env['HTTP_REFERER']
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
def self.inform_action(controller_name, action)
|
@@ -22,9 +24,13 @@ module InformantRails
|
|
22
24
|
def self.process
|
23
25
|
if Config.api_token.present? && request && request.models.any?
|
24
26
|
Typhoeus::Request.new(
|
25
|
-
api_url,
|
27
|
+
api_url,
|
28
|
+
method: :post,
|
29
|
+
params: { payload: request.as_json },
|
30
|
+
headers: { Authorization: ActionController::HttpAuthentication::Token.encode_credentials(InformantRails::Config.api_token) }
|
26
31
|
).run
|
27
32
|
end
|
33
|
+
ensure
|
28
34
|
remove_request
|
29
35
|
end
|
30
36
|
|
@@ -51,11 +57,7 @@ module InformantRails
|
|
51
57
|
end
|
52
58
|
|
53
59
|
def self.api_url
|
54
|
-
@api_url ||= [
|
55
|
-
'http://api.informantapp.com/api/v1',
|
56
|
-
InformantRails::Config.api_token,
|
57
|
-
InformantRails::Config.server_environment
|
58
|
-
].join('/')
|
60
|
+
@api_url ||= ['http://api.informantapp.com/api/v1', InformantRails::Config.server_environment].join('/')
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: informant-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Elliott
|
@@ -9,34 +9,34 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: typhoeus
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
description: The Informant tells you what's irritating your users.
|
@@ -46,6 +46,10 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
+
- LICENSE
|
50
|
+
- README.markdown
|
51
|
+
- Rakefile
|
52
|
+
- lib/informant-rails.rb
|
49
53
|
- lib/informant-rails/client.rb
|
50
54
|
- lib/informant-rails/config.rb
|
51
55
|
- lib/informant-rails/field_error.rb
|
@@ -55,10 +59,6 @@ files:
|
|
55
59
|
- lib/informant-rails/railtie.rb
|
56
60
|
- lib/informant-rails/request.rb
|
57
61
|
- lib/informant-rails/version.rb
|
58
|
-
- lib/informant-rails.rb
|
59
|
-
- LICENSE
|
60
|
-
- README.markdown
|
61
|
-
- Rakefile
|
62
62
|
homepage: http://www.informantapp.com
|
63
63
|
licenses:
|
64
64
|
- GPL
|
@@ -69,17 +69,17 @@ require_paths:
|
|
69
69
|
- lib
|
70
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- -
|
77
|
+
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.2.2
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: The Informant tells you what's irritating your users.
|