active_spy 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1732d9b22155f6b8762ffef93232642a03c07605
4
- data.tar.gz: ba46f9dde95f707d572518ff00ea04e4e43e50c3
3
+ metadata.gz: b5bdc4f494f15604512b34cf95f3d8f29f93a35d
4
+ data.tar.gz: 7725bf3e5a23b29f123fdaff4aa0c69cb10571de
5
5
  SHA512:
6
- metadata.gz: f44a21ca9d0f213636d60ae01a598d98a55c6fd71104c00c9d475be6d94aca872bed2dd435bbac743ca7bdf8c404fdd6d8a7673ec1676576feef688dbcd72631
7
- data.tar.gz: 3d264f47f021d5512328b170c6df093262b6105016bfad1fad36a799bc7e732e18c0a2767e4a679aa3914f52783c1830424f5974b5ed3a4c13dadf8a27311d33
6
+ metadata.gz: 8bd72597fd3fdb2c0abd938dee0ab60f4782f03c5617ddad7f0522aa40f3e471f7028eccf81837d7dc41ada6c2a48a2025c05d5d684796d7ed1a415c66fc61f7
7
+ data.tar.gz: 1ef8d6d17c5a8e6476b4c188cac1f190462a3e44e7c95d9df73a3048217c7c56d7b37a5e17bddc3cb8b765528a89af3324f451dce3c2e0f345ed4398a8e71ce0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.5
1
+ 1.3.6
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.3.5 ruby lib
5
+ # stub: active_spy 1.3.6 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "active_spy"
9
- s.version = "1.3.5"
9
+ s.version = "1.3.6"
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-08-28"
14
+ s.date = "2014-09-30"
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 = [
@@ -27,7 +27,6 @@ module ActiveSpy
27
27
  end
28
28
  end
29
29
 
30
-
31
30
  def get_result(hook, params)
32
31
  listener = "#{hook['post_class']}Listener".constantize
33
32
  result = listener.new.handle(params['event'])
@@ -50,6 +49,7 @@ module ActiveSpy
50
49
  model_with_errors.each do |model|
51
50
  ::Rails.logger.warn("[EVENT][#{hook['post_class']}] #{model} errors: #{model.errors}")
52
51
  end
52
+ render nothing: true, status: :internal_server_error
53
53
  else
54
54
  render nothing: true
55
55
  end
@@ -66,8 +66,13 @@ module ActiveSpy
66
66
  def send_event_request
67
67
  host = ActiveSpy::Configuration.event_host
68
68
  port = ActiveSpy::Configuration.event_port
69
- RestClient.post "#{host}:#{port}/events", @event_json,
69
+ response = RestClient.post "#{host}:#{port}/events", @event_json,
70
70
  content_type: :json
71
+ if defined?(Rails)
72
+ ::Rails.logger.info('[SPY] Event sent to event-runner.')
73
+ ::Rails.logger.info("[SPY] Event-runner response code: #{response.code}")
74
+ ::Rails.logger.info("[SPY] Event-runner response: #{response.body}")
75
+ end
71
76
  end
72
77
 
73
78
  # Get the event request params for a given +method+.
@@ -102,7 +102,7 @@ module ActiveSpy
102
102
  end
103
103
  end
104
104
 
105
- # # Properly creates the +hooks_to_add+ in the event runner..
105
+ # # Properly creates the +hooks_to_add+ in the event runner.
106
106
  #
107
107
  def add_hooks(hooks_to_add)
108
108
  hooks_to_add.each do |hook|
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.3.5
4
+ version: 1.3.6
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-08-28 00:00:00.000000000 Z
11
+ date: 2014-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport