Permalink
Browse files

Updated gemspec; added and fixed Reference

  • Loading branch information...
1 parent a58c09c commit 7785233983274f6b58474d8804ec289e34168de9 @krakatoa krakatoa committed Nov 16, 2012
Showing with 18 additions and 5 deletions.
  1. +6 −1 cucub-protocol.gemspec
  2. +2 −0 lib/cucub-protocol.rb
  3. +2 −2 lib/message.rb
  4. +2 −2 lib/reference.rb
  5. +6 −0 msg_testing.rb
View
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Fernando Alonso"]
- s.date = "2012-10-24"
+ s.date = "2012-11-16"
s.description = "longer description of your gem"
s.email = "krakatoa1987@gmail.com"
s.extra_rdoc_files = [
@@ -27,12 +27,17 @@ Gem::Specification.new do |s|
"cucub-protocol.gemspec",
"lib/cucub-protocol.rb",
"lib/message.rb",
+ "lib/message/body.rb",
+ "lib/message/header.rb",
"lib/protocol.rb",
"lib/protocol/action_specification.rb",
"lib/protocol/loader.rb",
"lib/protocol/object_specification.rb",
"lib/protocol/specification.rb",
"lib/protocol/specification_set.rb",
+ "lib/reference.rb",
+ "msg_testing.rb",
+ "protocol.yml",
"spec/mock/protocol.ini",
"spec/protocol_spec.rb",
"spec/spec_helper.rb",
View
@@ -1,4 +1,6 @@
require 'inifile'
+require 'msgpack'
+require 'reference'
require 'message'
require 'protocol'
View
@@ -11,8 +11,8 @@
# > Message.body = Body (without attrs loaded, crypted/serialized string)
#
-require './lib/message/header'
-require './lib/message/body'
+require 'message/header'
+require 'message/body'
module Cucub
class Message
View
@@ -4,8 +4,8 @@ class Reference
attr_reader :class_name
def initialize(opts={})
- @object_uuid = opts[:object_uuid]
- @class_name = opts[:class_name]
+ @object_uuid = opts["object_uuid"]
+ @class_name = opts["class_name"]
end
def to_hash
View
@@ -2,6 +2,8 @@
require './lib/reference'
require 'msgpack'
+# action deberia automaticamente parsearse como symbol, para poder mandar por send
+
ref = Cucub::Reference.new({:object_uuid => 1, :class_name => "Core"})
ref2 = Cucub::Reference.new({:object_uuid => 2, :class_name => "Engine"})
@@ -18,3 +20,7 @@
message2.unlock(:msgpack)
puts "action: #{message2.action} | additionals: #{message2.additionals}"
message2.locked?
+
+# testear header.parse
+# testear reference.parse
+# testear message.parse

0 comments on commit 7785233

Please sign in to comment.