active_spy 1.3.1 → 1.3.2

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: 7006fd13356005f9264e46a1726a9637a45d67c3
4
- data.tar.gz: 0c6c044b7403f2ac2d68159604f4615b4759e385
3
+ metadata.gz: 56617f3765e3e7026148c98c1285bec0a7e8d672
4
+ data.tar.gz: 8ec5dd20bda1b57a6ccfbdb504fe55902b11f5e1
5
5
  SHA512:
6
- metadata.gz: 9a035ae2315dd1ac18f423d40cb3fcf88c2b6de0e75b829f0a03ca8dacc4dcd9dafb1d4a9190a9e4a6310cd5b68f15cd841337763e1536cc95a3ce84f572110e
7
- data.tar.gz: 8b48a57cc787c8938d731762f70a1ac6f07cc5aa1997e9df5fa7e9359e051ee93ad5718ee0eb62b0f780a74d287516adfde32f452b1d511cf2d8b73c97dce8be
6
+ metadata.gz: 57d0d785bfa03abedaff77350567b59948338a59b7f2efd05752075127671c81d1b3dedd583759c0c37430949a3de4b15f58d424ec15a1cc15e68ec7018f6e78
7
+ data.tar.gz: 784ec1190721e1b8e235a7a6469bca8676758ee317cc43133e424f73a03f01576bfd9407f3c41d25edd1f5a17314bf0f024b54dd74f4b7e5e47933240155ad16
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.2
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.1 ruby lib
5
+ # stub: active_spy 1.3.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "active_spy"
9
- s.version = "1.3.1"
9
+ s.version = "1.3.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
13
  s.authors = ["Douglas Camata"]
14
- s.date = "2014-08-01"
14
+ s.date = "2014-08-14"
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 = [
@@ -12,6 +12,7 @@ module ActiveSpy
12
12
  listener = "#{hook['post_class']}Listener".constantize
13
13
  result = listener.new.handle(params['event'])
14
14
  if result.errors.present?
15
+ Rails.logger.warn("[EVENT][#{hook['post_class']}] Error on save #{result}: #{result.errors}")
15
16
  render json: result.errors
16
17
  else
17
18
  render json: result
@@ -66,7 +66,11 @@ module ActiveSpy
66
66
  define_method method do |*args, &block|
67
67
  send(:invoke_callback, method, :before)
68
68
  result = old_method.bind(self).call(*args, &block)
69
- send(:invoke_callback, method, :after)
69
+ if defined?(Rails)
70
+ send(:invoke_callback, method, :after) if result
71
+ else
72
+ send(:invoke_callback, method, :after)
73
+ end
70
74
  result
71
75
  end
72
76
  end
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.1
4
+ version: 1.3.2
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-01 00:00:00.000000000 Z
11
+ date: 2014-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport