active_spy 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/active_spy.gemspec +3 -3
- data/lib/active_spy/rails/base.rb +3 -2
- data/lib/active_spy/rails/hook_list.rb +4 -1
- data/lib/active_spy.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487e7b4bb3a32adf8e90b3357570676559d4309e
|
4
|
+
data.tar.gz: 4ec129a358e2a34f8e389a7778f3082464e364c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01ed958c5635e6f9ebd815fcb9ae9baa83b46c91e281ebc08c1030e1be3c92f4d076b2f9ae9dc2c5dc5c959f3c407ff1f7d8bc5e311d3b39bfcb830cae9f6932
|
7
|
+
data.tar.gz: 20a75cce79f9be9b9263438bf96ca0bfb3b22413784b45f8ae5597157feaff1b8f539b479b85713ca92171e815cb418acd1424ad9a304c8ad0858d1fd5c3ec70
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/active_spy.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
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: active_spy 1.1.
|
5
|
+
# stub: active_spy 1.1.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "active_spy"
|
9
|
-
s.version = "1.1.
|
9
|
+
s.version = "1.1.1"
|
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
13
|
s.authors = ["Douglas Camata"]
|
14
|
-
s.date = "2014-07-
|
14
|
+
s.date = "2014-07-23"
|
15
15
|
s.description = " Watch for a method call in any class and run before/after callbacks.\n You can even watch your Rails models for events (like create, update,\n destroy), send these events to a event-runner instance and it redirect these\n events to other apps that are subscrived for them. This gem also provides\n classes that you can use to process the received events too.\n"
|
16
16
|
s.email = "d.camata@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -43,8 +43,9 @@ module ActiveSpy
|
|
43
43
|
host = ActiveSpy::Configuration.event_host
|
44
44
|
port = ActiveSpy::Configuration.event_port
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
event_json = { event: get_request_params(method) }.to_json
|
47
|
+
RestClient.post "#{host}:#{port}/events", event_json,
|
48
|
+
content_type: :json
|
48
49
|
remove_is_new_method(@object)
|
49
50
|
end
|
50
51
|
|
@@ -106,11 +106,14 @@ module ActiveSpy
|
|
106
106
|
#
|
107
107
|
def add_hooks(hooks_to_add)
|
108
108
|
hooks_to_add.each do |hook|
|
109
|
-
|
109
|
+
hook = {
|
110
110
|
'hook'=> {
|
111
111
|
'class'=> hook['class'],
|
112
112
|
'post_path' => ActiveSpy::Engine.routes.url_helpers.notifications_path(hook['post_class'].downcase),
|
113
113
|
}
|
114
|
+
}
|
115
|
+
RestClient.post "#{@base_service_url}/hooks", hook.to_json,
|
116
|
+
content_type: :json
|
114
117
|
end
|
115
118
|
end
|
116
119
|
end
|
data/lib/active_spy.rb
CHANGED
@@ -32,7 +32,8 @@ module ActiveSpy
|
|
32
32
|
@@base_url = "#{host}:#{port}/services"
|
33
33
|
|
34
34
|
return if self.service_registered?
|
35
|
-
|
35
|
+
service = { service: ActiveSpy::Configuration.settings }.to_json
|
36
|
+
RestClient.post(@@base_url, service.to_json, content_type: :json)
|
36
37
|
end
|
37
38
|
|
38
39
|
# @!method self.service_registered?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_spy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Douglas Camata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|