gorg_message_sender 0.1.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e68f2f686bf3eb417c77a14b7513c7c48bea617e
4
- data.tar.gz: b4d09677ad706cb8479046b9293a584caabc173f
3
+ metadata.gz: bc785309b06fc2b58995f9abd052f94759513c52
4
+ data.tar.gz: 3d4f5e059c7a1e5051347d18bb067f87691260b6
5
5
  SHA512:
6
- metadata.gz: 5f90356b84fdc3bd72d61172c806253d8fdc01fe202a8bd35d5f2b75409fa5ab975b2196649da5bcd68712c514396de8766b5f4b3f7df4ddf556c8a047201385
7
- data.tar.gz: 97daa3108e4ef78ed9c70416ce5d9d12da8c1c23be9a7071a622c0479e5b674e2ebb7940edc0b731c89d5cb570a8cd0c71105a7ef1c7a6d25c79f80e70a7d107
6
+ metadata.gz: cbdd689841e327b3781703efab815a2d67066c361e560a50bfb63d666a609d170dd0cf2d69beb3bcf04ce10f3b979c2d7c12147326e7f0ef679f31f585169774
7
+ data.tar.gz: 41675d6f4324c60ef9234eb78ab0ae31406e2615e634d4f713106200aef11548b8f388638708982158903ae2164796a149c4de1fbdd098370ee60f11754119a9
data/README.md CHANGED
@@ -137,9 +137,17 @@ sender.message({this_is: "my data hash"},
137
137
  `send`also accepts the `verbose` params to print sending informations in SDOUT
138
138
 
139
139
  ```ruby
140
- sender.message({this_is: "my data hash"},
140
+ sender.send({this_is: "my data hash"},
141
+ "some.routing.key",
142
+ verbose: true
143
+ )
144
+ ```
145
+ ###Sending a raw message
146
+ You can also send any raw string with `send_raw`
147
+
148
+ ```ruby
149
+ sender.send_raw("my message content",
141
150
  "some.routing.key",
142
- event_uuid: "this is not a valid uuid",
143
151
  verbose: true
144
152
  )
145
153
  ```
@@ -161,4 +169,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Zooip/
161
169
 
162
170
  ## License
163
171
 
164
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
172
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,3 +1,3 @@
1
1
  class GorgMessageSender
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -47,6 +47,16 @@ class GorgMessageSender
47
47
  msg
48
48
  end
49
49
 
50
+ def send_raw(msg,routing_key,opts={})
51
+ self.start(verbose: opts[:verbose])
52
+ p_opts={}
53
+ p_opts[:routing_key]= routing_key if routing_key
54
+ @x.publish(msg, p_opts)
55
+ puts " [#] Message sent to exchange '#{@r_exchange}' (#{@r_durable ? "" : "not "}durable) with routing key '#{routing_key}'" if opts[:verbose]
56
+ self.stop(verbose: opts[:verbose])
57
+ msg
58
+ end
59
+
50
60
  protected
51
61
 
52
62
  def start(opts)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorg_message_sender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Narbonne