module docs

5 views
Skip to first unread message

Peter Alvaro

unread,
Nov 13, 2011, 11:43:05 PM11/13/11
to program...@googlegroups.com
I compiled the submitted YARD docs.  You can view them here:



Amber Feng

unread,
Nov 14, 2011, 4:16:05 AM11/14/11
to program...@googlegroups.com
Any chance we could get the Bloom YARD plugin you wrote (or did you send it out already)?

Amber

Peter Alvaro

unread,
Nov 14, 2011, 4:43:51 AM11/14/11
to program...@googlegroups.com
here's the handler for state blocks.  remember that you need ruby 1.9.

class StateBlockHandler < YARD::Handlers::Ruby::Base
  handles method_call(:state)

  def process
    statement.last.last.each do |stm|
      # regexps for expediency.  please rethink
      if stm.show =~ /(interface (\w+),|(\w+))\s*:(\w+),\s*\[([^]]*)\]\s*(=>\s*\[([^]]+)\])?/
        object = YARD::CodeObjects::MethodObject.new(namespace, $4)
        register(object)
        object.dynamic = true
        object.parameters = [["[#{$5}]", nil], [$7, nil]]
        object.source = stm.source
        str = stm.comments.nil? ? "" :  stm.comments + "\n@return [#{$2}]"
        object.docstring = YARD::Docstring.new(str, object)
        parse_block(stm, :owner => object)
      end
    end
  end
end

Jonathan Dinu

unread,
Nov 15, 2011, 5:17:26 AM11/15/11
to program...@googlegroups.com
Hi Peter,

So I implemented Heartbeats but realized that it depended on Alarms and Sequences.  I was not able to test the code and was not sure if we were supposed to write our own code to make our module work, or if we were supposed to wait for the other modules to get implemented.  Anyways, here is heartbeats.  

I changed the interfaces as people in class on Thursday suggested and  hope this doesn't impact anyone else.  I figured this would be ok for now since no one (that I know of) depends on Heartbeats.  Let me know if you would like the interface we went over on Thursday implemented instead, I took out the add_members, remove_members, and unresponsive_nodes interfaces.  I also moved the heartbeats channel into a protocol that is shared between the manager and clients (basically made HeartbeatClient into HeartbeatProtocol).  I also changed the implementation a bit to reflect more of a peer-to-peer setup where the manager keeps broadcasts at the set heartbeat interval rather than reliably broadcast once and wait.

-Jonathan


heartbeat.rb
Reply all
Reply to author
Forward
0 new messages