larva 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 586b2fb5174324740d8583b8b6b8c033afa44f9f
4
- data.tar.gz: 9b73d51991cc7664660a85d6cacd61500f29f283
3
+ metadata.gz: f3db7d0f91a596e2a801add25f0f555969e3c704
4
+ data.tar.gz: 8270fb1338c2f139f2664378f76b4ec68a3a23ea
5
5
  SHA512:
6
- metadata.gz: 20c5fb5ec779e501424ab581dc30001d8043dc61f512cca4bdee8ae1e38814efe49d14c12b579af2326923bbe4a8b6c8f3e9368a82a08b11158eb982757f47f9
7
- data.tar.gz: bf35e9031228e9690e0a678c964c28c6b1b30d7cf433e9f7a6ae73132963ae0aa6fc6b5c27d69028969a0a14663a67534b8850ea9bfd8bd2d80fd51a9b4a20de
6
+ metadata.gz: 140db924c5d9f6bfc88567bb435a77c2aabdff54eaaa5cdf6982fe606c5e5259bb6e483146475cea8ca7f0ba3b265f75a67dd8dd9fad88cf382e64bdd3a77064
7
+ data.tar.gz: b3968a67fde438970aa85fe768fe9ae158022922107531fa83596d4c4e4a7e4b4ad3c061a3c507a180b1aa3c67b15489c2ee66319a186aed1b305fde98e6249b
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.4.1 / 2014-02-22
2
+ * [FEATURE] Remove need for process method
3
+
1
4
  # 0.4.0 / 2014-02-22
2
5
  * [FEATURE] Add meta-programming-based processors.
3
6
 
@@ -30,7 +30,7 @@ module Larva
30
30
  end
31
31
 
32
32
  def normal_process
33
- if self.process
33
+ if respond_to?(:process) && self.process
34
34
  Propono.config.logger.info "Message Processed: #{message}"
35
35
  else
36
36
  Propono.config.logger.info "Unrecognized event type, entity: #{entity} action: #{action}."
@@ -1,3 +1,3 @@
1
1
  module Larva
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -49,7 +49,7 @@ module Larva
49
49
  NormalProcessor.process(message)
50
50
  end
51
51
 
52
- def test_process_logs_message
52
+ def test_process_logs_error_with_false_handler
53
53
  entity = "media_file"
54
54
  action = "processed"
55
55
  message = {entity: entity, action: action, media_file_id: "8"}
@@ -60,6 +60,17 @@ module Larva
60
60
  NormalProcessor.any_instance.expects(:process).returns(false)
61
61
  NormalProcessor.process(message)
62
62
  end
63
+
64
+ def test_process_logs_error_with_no_handler
65
+ entity = "comment"
66
+ action = "created"
67
+ message = {entity: entity, action: action, media_file_id: "8"}
68
+ output = "Unrecognized event type, entity: #{entity} action: #{action}."
69
+
70
+ Propono.config.logger.stubs(:info)
71
+ Propono.config.logger.expects(:info).with(output)
72
+ MetaProcessor.process(message)
73
+ end
63
74
  end
64
75
  end
65
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: larva
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - iHiD