rflow-components-amqp 0.0.2 → 1.0.0a2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f7711f3181b4561373feb82633d1cb4629703a1a
4
+ data.tar.gz: a296d163cdc9709e2aaa97e1608edf98bd7f5d63
5
+ SHA512:
6
+ metadata.gz: 297fa6b20a1f234ed31e9d1497f38c871f4f02502f9c0bffb89b773916ff0bd7ab30ef5b3b77a346feeb741f53d8fd08d9466b13249e383856d1df945ea3e1bd
7
+ data.tar.gz: 2f87018d12c6956a7ed1d26f615110c2c13d333feacd679e4d904e97d0034efb886626960365ff060196fb47119522621b11588d76dc2f643fec2a5893a15222
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color -fd
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ rflow-dev
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.1.1
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - 2.1.0
7
+
8
+ before_install:
9
+ - sudo apt-get install libtool autoconf automake uuid-dev build-essential
10
+ - wget http://download.zeromq.org/zeromq-3.2.4.tar.gz && tar zxvf zeromq-3.2.4.tar.gz && cd zeromq-3.2.4 && ./configure && make && sudo make install && cd ..
11
+ # Only has 4.0.4, need 3.2 version due to old em-zeromq
12
+ # - sudo add-apt-repository -y ppa:chris-lea/zeromq
13
+ # - sudo apt-get update
14
+ # - sudo apt-get install libzmq3 libzmq3-dev
15
+
16
+ script: bundle exec rspec spec
17
+
18
+ notifications:
19
+ hipchat:
20
+ rooms:
21
+ secure: Ppa74CkFd+RY8fCZ7raLmwoAICMx5CvZyydWTetp6vQ/9i7Ezs/UXTv8bht3QPo+eszxZAA96aPERRNKYFN+VnW+eeLeB+KPBvrOOetcBLJIyZKxnpjg3EJBTS5EWJd9eVHPs393nkL64bL3vZPjeWFyw0nfhLnDeU7kHAOJ5Cw=
data/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2014 RedJack LLC
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # RFlow-Components-AMQP
2
+
3
+ [![Build Status](https://travis-ci.org/redjack/rflow-components-amqp.png?branch=master)](https://travis-ci.org/redjack/rflow-components-amqp)
4
+
5
+ A gem containing AMQP-specific components and data types for RFlow
6
+ (https://github.com/redjack/rflow).
7
+
8
+ ## Data Types
9
+
10
+ * `RFlow::Message::Data::AMQP::Message` - an AMQP message
11
+
12
+ ## Subscriber
13
+
14
+ The subscriber component (`RFlow::Components::AMQP::Subscriber`)
15
+ implements a AMQP subscriber using the
16
+ [amqp gem](https://github.com/ruby-amqp/amqp) and operates as an RFlow
17
+ source (i.e. it does not have any input ports). The component connects
18
+ to an AMQP broker, establishes a (default transient) queue, and
19
+ registers a message binding pattern to accept deliver messages to the
20
+ queue, all based on the component configuration (which mirrors the
21
+ underlying amqp gem's configuration).
22
+
23
+ The subscriber uses two ports for sending messages, an `amqp_port`
24
+ (which sends `RFlow::Message::Data::AMQP::Message` messages) and a
25
+ `raw_port` (which sends relatively unstructured
26
+ `RFlow::Message::Data::Raw` messages).
27
+
28
+ ### Configuration
29
+
30
+ * 'server' => '127.0.0.1'
31
+ * 'port' => 5672
32
+ * 'username' => 'guest'
33
+ * 'password' => 'guest'
34
+ * 'vhost' => '/'
35
+ * 'queue_name' => 'asdf'
36
+ * 'queue_passive' => false
37
+ * 'queue_durable' => false
38
+ * 'queue_exclusive' => true
39
+ * 'queue_auto_delete' => true
40
+ * 'binding_pattern' => ''
41
+
42
+ ### Examples
43
+
44
+ ### Limitations
45
+
46
+
47
+ ## Publisher
48
+
49
+ Not yet implemented
50
+
51
+
52
+ ## License
53
+
54
+ Copyright 2014 RedJack LLC
55
+
56
+ Licensed under the Apache License, Version 2.0 (the "License");
57
+ you may not use this file except in compliance with the License.
58
+ You may obtain a copy of the License at
59
+
60
+ http://www.apache.org/licenses/LICENSE-2.0
61
+
62
+ Unless required by applicable law or agreed to in writing, software
63
+ distributed under the License is distributed on an "AS IS" BASIS,
64
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
65
+ See the License for the specific language governing permissions and
66
+ limitations under the License.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
9
9
  end
10
10
 
11
11
  Rake::RDocTask.new do |rd|
12
- rd.main = "README"
13
- rd.rdoc_files.include("README", "lib/**/*.rb")
12
+ rd.main = "README.md"
13
+ rd.rdoc_files.include("README.md", "lib/**/*.rb")
14
14
  rd.rdoc_dir = File.join('doc', 'html')
15
15
  end
@@ -1,26 +1,22 @@
1
1
  class RFlow
2
2
  module Components
3
3
  module AMQP
4
-
5
- # The set of extensions to add capability to AMQP data types
6
4
  module Extensions
7
-
8
5
  module AMQPMessageExtension
9
6
  def self.extended(base_data)
10
7
  base_data.data_object ||= {'header' => {}, 'payload' => ''}
11
8
  end
12
9
 
13
10
  # Default accessors
14
- ['header', 'payload'].each do |name|
15
- define_method name do |*args|
16
- data_object[name]
17
- end
18
- define_method :"#{name}=" do |*args|
19
- data_object[name] = args.first
20
- end
21
- end
11
+ ['header', 'payload'].each do |name|
12
+ define_method name do |*args|
13
+ data_object[name]
14
+ end
15
+ define_method :"#{name}=" do |*args|
16
+ data_object[name] = args.first
17
+ end
18
+ end
22
19
  end
23
-
24
20
  end
25
21
  end
26
22
  end
@@ -5,8 +5,7 @@ require 'rflow'
5
5
  class RFlow
6
6
  module Components
7
7
  module AMQP
8
-
9
- # By default will use and exclusive, non-durable, auto-deleting,
8
+ # By default will use an exclusive, non-durable, auto-deleting,
10
9
  # randomly named queue for subscribing to topic messages with an
11
10
  # empty-string pattern
12
11
  class Subscriber < RFlow::Component
@@ -15,7 +14,7 @@ class RFlow
15
14
 
16
15
  attr_accessor :config, :queue_config
17
16
 
18
- DEFAULT_CONFIG = {
17
+ DEFAULT_CONFIG = {
19
18
  'server' => '127.0.0.1',
20
19
  'port' => 5672,
21
20
  'username' => 'guest',
@@ -35,23 +34,19 @@ class RFlow
35
34
  @config = DEFAULT_CONFIG.merge config
36
35
  @config['port'] = @config['port'].to_i
37
36
 
38
- ['durable', 'passive', 'exclusive', 'auto_delete'].each do |queue_bool_opt|
39
- @config["queue_#{queue_bool_opt}"] = to_boolean(@config["queue_#{queue_bool_opt}"])
37
+ ['durable', 'passive', 'exclusive', 'auto_delete'].each do |opt|
38
+ @config["queue_#{opt}"] = to_boolean(@config["queue_#{opt}"])
40
39
  end
41
40
 
42
41
  # Convert the queue parameters into AMQP-friendly sym-keyed
43
42
  # Hash that can be passed directly to underlying AMQP gem
44
43
  # methods
45
- @queue_config = {}
46
- @config.each do |key, value|
44
+ @queue_config = @config.each_with_object({}) do |(key, value), result|
47
45
  md = /queue_(.*)/.match(key.to_s)
48
- unless md.nil?
49
- @queue_config[md[1].to_sym] = value
50
- end
46
+ result[md[1].to_sym] = value unless md.nil?
51
47
  end
52
48
  end
53
49
 
54
-
55
50
  def run!
56
51
  ::AMQP.connect(:host => @config['server'], :port => @config['port'], :vhost => @config['vhost'], :username => @config['username'], :password => @config['password']) do |conn|
57
52
  @amqp_connection = conn
@@ -64,50 +59,37 @@ class RFlow
64
59
  @amqp_queue = queue
65
60
  @amqp_queue.bind(@amqp_exchange, :routing_key => @config['binding_pattern']).subscribe(:ack => true) do |header, payload|
66
61
  RFlow.logger.debug "AMQP message received"
67
- processing_event = RFlow::Message::ProcessingEvent.new(instance_uuid, Time.now.utc)
62
+ processing_event = RFlow::Message::ProcessingEvent.new(instance_uuid, Time.now.utc).tap do |e|
63
+ e.completed_at = Time.now.utc
64
+ end
68
65
 
69
- amqp_message = RFlow::Message.new('RFlow::Message::Data::AMQP::Message')
70
- header.to_hash.each {|k,v| amqp_message.data.header[k.to_s] = v}
71
- amqp_message.data.payload = payload
66
+ amqp_port.send_message(RFlow::Message.new('RFlow::Message::Data::AMQP::Message').tap do |m|
67
+ header.to_hash.each {|k,v| m.data.header[k.to_s] = v }
68
+ m.data.payload = payload
69
+ m.provenance << processing_event
70
+ end)
72
71
 
73
72
  # TODO: Optimize out if not connected
74
- raw_message = RFlow::Message.new('RFlow::Message::Data::Raw')
75
- raw_message.data.raw = payload
76
-
77
- processing_event.completed_at = Time.now.utc
78
- amqp_message.provenance << processing_event
79
- raw_message.provenance << processing_event
80
-
81
- amqp_port.send_message amqp_message
82
- raw_port.send_message raw_message
73
+ raw_port.send_message(RFlow::Message.new('RFlow::Message::Data::Raw').tap do |m|
74
+ m.data.raw = payload
75
+ m.provenance << processing_event
76
+ end)
83
77
 
84
78
  header.ack
85
79
  end
86
80
  end
87
-
88
81
  end
89
82
  end
90
-
91
- # EM.add_timer(2) do
92
- # EM.add_periodic_timer(0) do
93
- # @amqp_exchange.publish Array.new(rand(1000)) { rand(256) }.pack('c*'), :routing_key => ""
94
- # end
95
- # end
96
83
  end
97
84
 
98
85
  def to_boolean(string)
99
86
  case string
100
- when /^true$/i, '1', true
101
- true
102
- when /^false/i, '0', false
103
- false
104
- else
105
- raise ArgumentError, "'#{string}' cannot be coerced to a boolean value"
87
+ when /^true$/i, '1', true; true
88
+ when /^false/i, '0', false; false
89
+ else raise ArgumentError, "'#{string}' cannot be coerced to a boolean value"
106
90
  end
107
91
  end
108
-
109
92
  end
110
-
111
93
  end
112
94
  end
113
95
  end
@@ -1,7 +1,7 @@
1
1
  class RFlow
2
2
  module Components
3
3
  module AMQP
4
- VERSION = "0.0.2"
4
+ VERSION = "1.0.0a2"
5
5
  end
6
6
  end
7
7
  end
@@ -19,7 +19,6 @@ class RFlow
19
19
  # Load the data extensions
20
20
  RFlow::Configuration.add_available_data_extension('RFlow::Message::Data::AMQP::Message',
21
21
  RFlow::Components::AMQP::Extensions::AMQPMessageExtension)
22
-
23
22
  end
24
23
  end
25
24
  end
@@ -6,10 +6,11 @@ Gem::Specification.new do |s|
6
6
  s.name = "rflow-components-amqp"
7
7
  s.version = RFlow::Components::AMQP::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
- s.required_ruby_version = '~> 1.9'
9
+ s.required_ruby_version = '>= 1.9'
10
10
  s.authors = ["Michael L. Artz"]
11
11
  s.email = ["michael.artz@redjack.com"]
12
12
  s.homepage = "https://github.com/redjack/rflow-components-amqp"
13
+ s.license = "Apache-2.0"
13
14
  s.summary = %q{AMQP publisher and subscriber component for the RFlow FBP framework}
14
15
  s.description = %q{AMQP publisher and subscriber component for the RFlow FBP framework. Also includes the necessary AMQP::Message message type}
15
16
 
@@ -20,9 +21,10 @@ Gem::Specification.new do |s|
20
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
22
  s.require_paths = ["lib"]
22
23
 
23
- s.add_dependency 'rflow', '~> 0.0.1'
24
- s.add_dependency 'amqp', '>= 0.8.0.rc12'
24
+ s.add_dependency 'rflow', '~> 1.0.0a2'
25
+ s.add_dependency 'amqp', '>= 0.8.0'
25
26
 
26
- s.add_development_dependency 'rspec', '~> 2.5.0'
27
- s.add_development_dependency 'rake', '~> 0.8.7'
27
+ s.add_development_dependency 'rspec', '~> 2.99'
28
+ s.add_development_dependency 'rspec-collection_matchers', '~> 0.0.4'
29
+ s.add_development_dependency 'rake', '~> 0.8'
28
30
  end
data/spec/schema_spec.rb CHANGED
@@ -1,12 +1,10 @@
1
1
  require 'spec_helper.rb'
2
2
 
3
3
  describe 'RFlow::Message::Data::AMQP::Message Avro Schema' do
4
- before(:each) do
5
- @schema_string = RFlow::Configuration.available_data_types['RFlow::Message::Data::AMQP::Message']['avro']
6
- end
4
+ let(:schema) { RFlow::Configuration.available_data_types['RFlow::Message::Data::AMQP::Message']['avro'] }
7
5
 
8
6
  it "should encode and decode an object" do
9
- amqp_message = {
7
+ message = {
10
8
  'header' => {
11
9
  'content_type' => 'application/octet-stream',
12
10
  'delivery_mode' => 2,
@@ -15,15 +13,13 @@ describe 'RFlow::Message::Data::AMQP::Message Avro Schema' do
15
13
  'payload' =>'PAYLOAD',
16
14
  }
17
15
 
18
- expect {encode_avro(@schema_string, amqp_message)}.to_not raise_error
19
- avro_encoded_amqp_message = encode_avro(@schema_string, amqp_message)
20
-
21
- expect {decode_avro(@schema_string, avro_encoded_amqp_message)}.to_not raise_error
22
- decoded_amqp_message = decode_avro(@schema_string, avro_encoded_amqp_message)
16
+ expect { encode_avro(schema, message)}.to_not raise_error
17
+ encoded_message = encode_avro(schema, message)
23
18
 
24
- decoded_amqp_message['payload'].should == amqp_message['payload']
25
- decoded_amqp_message['header'].should == amqp_message['header']
19
+ expect { decode_avro(schema, encoded_message) }.to_not raise_error
20
+ decoded_message = decode_avro(schema, encoded_message)
26
21
 
22
+ decoded_message['payload'].should == message['payload']
23
+ decoded_message['header'].should == message['header']
27
24
  end
28
25
  end
29
-
metadata CHANGED
@@ -1,80 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rflow-components-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 1.0.0a2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael L. Artz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-17 00:00:00.000000000 Z
11
+ date: 2014-06-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rflow
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 0.0.1
19
+ version: 1.0.0a2
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 0.0.1
26
+ version: 1.0.0a2
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: amqp
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
- version: 0.8.0.rc12
33
+ version: 0.8.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
- version: 0.8.0.rc12
40
+ version: 0.8.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: 2.5.0
47
+ version: '2.99'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: 2.5.0
54
+ version: '2.99'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-collection_matchers
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.0.4
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.0.4
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: rake
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ~>
73
+ - - "~>"
68
74
  - !ruby/object:Gem::Version
69
- version: 0.8.7
75
+ version: '0.8'
70
76
  type: :development
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
- - - ~>
80
+ - - "~>"
76
81
  - !ruby/object:Gem::Version
77
- version: 0.8.7
82
+ version: '0.8'
78
83
  description: AMQP publisher and subscriber component for the RFlow FBP framework. Also
79
84
  includes the necessary AMQP::Message message type
80
85
  email:
@@ -83,8 +88,14 @@ executables: []
83
88
  extensions: []
84
89
  extra_rdoc_files: []
85
90
  files:
86
- - .gitignore
91
+ - ".gitignore"
92
+ - ".rspec"
93
+ - ".ruby-gemset"
94
+ - ".ruby-version"
95
+ - ".travis.yml"
87
96
  - Gemfile
97
+ - LICENSE
98
+ - README.md
88
99
  - Rakefile
89
100
  - lib/rflow-components-amqp.rb
90
101
  - lib/rflow/components/amqp.rb
@@ -93,34 +104,33 @@ files:
93
104
  - lib/rflow/components/amqp/version.rb
94
105
  - rflow-components-amqp.gemspec
95
106
  - schema/amqp_message.avsc
96
- - spec/extensions_spec.rb
97
107
  - spec/schema_spec.rb
98
108
  - spec/spec_helper.rb
99
109
  homepage: https://github.com/redjack/rflow-components-amqp
100
- licenses: []
110
+ licenses:
111
+ - Apache-2.0
112
+ metadata: {}
101
113
  post_install_message:
102
114
  rdoc_options: []
103
115
  require_paths:
104
116
  - lib
105
117
  required_ruby_version: !ruby/object:Gem::Requirement
106
- none: false
107
118
  requirements:
108
- - - ~>
119
+ - - ">="
109
120
  - !ruby/object:Gem::Version
110
121
  version: '1.9'
111
122
  required_rubygems_version: !ruby/object:Gem::Requirement
112
- none: false
113
123
  requirements:
114
- - - ! '>='
124
+ - - ">"
115
125
  - !ruby/object:Gem::Version
116
- version: '0'
126
+ version: 1.3.1
117
127
  requirements: []
118
128
  rubyforge_project: rflow-components-amqp
119
- rubygems_version: 1.8.24
129
+ rubygems_version: 2.2.2
120
130
  signing_key:
121
- specification_version: 3
131
+ specification_version: 4
122
132
  summary: AMQP publisher and subscriber component for the RFlow FBP framework
123
133
  test_files:
124
- - spec/extensions_spec.rb
125
134
  - spec/schema_spec.rb
126
135
  - spec/spec_helper.rb
136
+ has_rdoc:
@@ -1,47 +0,0 @@
1
- require 'spec_helper.rb'
2
-
3
- # describe RFlow::Components::File::Extensions::FileExtension do
4
- # before(:each) do
5
- # @schema_string = RFlow::Configuration.available_data_types['RFlow::Message::Data::File']['avro']
6
- # end
7
- #
8
- # it "should add the extension to RFlow::Configuration" do
9
- # RFlow::Configuration.available_data_extensions['RFlow::Message::Data::File'].should include(described_class)
10
- # end
11
- #
12
- # it "should set the defaults" do
13
- # file = RFlow::Message.new('RFlow::Message::Data::File')
14
- #
15
- # file.data.path.should == '/'
16
- # file.data.size.should == 0
17
- # file.data.content.should == ''
18
- # file.data.creation_timestamp.should == nil
19
- # file.data.modification_timestamp.should == nil
20
- # file.data.accessed_timestamp.should == nil
21
- # end
22
- #
23
- # it "should correctly use integers or strings for size field" do
24
- # file = RFlow::Message.new('RFlow::Message::Data::File')
25
- #
26
- # file.data.size.should == 0
27
- # file.data.size = 10
28
- # file.data.size.should == 10
29
- # file.data.size = '20'
30
- # file.data.size == 20
31
- # end
32
- #
33
- # it "should correctly use Time or xmlschema strings for timestamp fields" do
34
- # file = RFlow::Message.new('RFlow::Message::Data::File')
35
- #
36
- # file.data.creation_timestamp.should == nil
37
- # now = Time.now
38
- #
39
- # file.data.creation_timestamp = now
40
- # file.data.creation_timestamp.should == Time.xmlschema(now.xmlschema(9))
41
- #
42
- # file.data.creation_timestamp = now.xmlschema
43
- # file.data.creation_timestamp.should == Time.xmlschema(now.xmlschema)
44
- # end
45
- #
46
- #
47
- # end