arborist 0.0.1.pre20161005112841 → 0.0.1.pre20161005182540

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d6da185674a9541d85ebc47e6fdf1877a6b85930053cc655cff36cc5de74923
4
- data.tar.gz: 15bccf69dd20c885fb1266ec75a1f0f8dfef122a174af87ab2018a0e24edc548
3
+ metadata.gz: 1771e739c3bd2da57549f3319a7a745ab1f93633f2b5008e61419b7d47bf036e
4
+ data.tar.gz: ee38a2f6e1653aecbe9a685d416a5ed2840361e3f5e964aaa490b7a9d00ea589
5
5
  SHA512:
6
- metadata.gz: a5ecc7f5a93aba6b92b0e8b41cbdc206f1c3ddc54b01953174a125b22923222b95dcb9d14832cc4a9432ce4f92625b94e159ca3d5be15f120f18a22c66caadd2
7
- data.tar.gz: 5dcd90e705e8aa8ad6992f6b5bfa625a45e6684d9b19bb7e5a13544a4e18ea40f0ff4eed478f8ad396d0902cbad09881d2d60de74bbb43fa28035be5fd398500
6
+ metadata.gz: 7d90ade9518414adf18f623412b673f1ef3e285438249fcde328701a2c8f48ae91866c5bccca176f3b26f91465aed74e078acb228c6a9c4374fdea56b237c86c
7
+ data.tar.gz: 247ed95856ccd2ae33d239d861bb99245018abe3bbab336532c0cba1431ca3bc34e5b19b62ec516ea60a50c2949f443a4e2ebc5e53b592764800796587ba38e4
@@ -1 +1,2 @@
1
- Lė�u��ֶ[��%��c�!&��X ��He���lJJ�߂>-��� K��(~2�<�T5l����w�����ݤW��t49��`A��c%����qfO-?�]-��`np��\�
1
+ a����RA��vy��mg�ݒ����GN�w�DhE ��������Ӧ��i*u1���2y��yT�
2
+ a���W��:�luRZ�6y
data.tar.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -47,7 +47,7 @@ hoespec = Hoe.spec 'arborist' do |spec|
47
47
  spec.dependency 'simplecov', '~> 0.9', :developer
48
48
  spec.dependency 'timecop', '~> 0.7', :developer
49
49
 
50
- spec.require_ruby_version( '>=2.2.0' )
50
+ spec.require_ruby_version( '>=2.3.1' )
51
51
  spec.hg_sign_tags = true if spec.respond_to?( :hg_sign_tags= )
52
52
 
53
53
  spec.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
@@ -493,11 +493,19 @@ class Arborist::Node
493
493
  # Super to the state machine event method
494
494
  super
495
495
 
496
+ return self.collect_events
497
+ end
498
+
499
+
500
+ ### Collect the events generated by updates and return them after broadcasting
501
+ ### them to any child nodes.
502
+ def collect_events
496
503
  events = self.pending_update_events.clone
497
504
  events << self.make_update_event
498
505
  events << self.make_delta_event unless self.update_delta.empty?
499
506
 
500
507
  self.broadcast_events( *events )
508
+
501
509
  return events
502
510
  ensure
503
511
  self.update_delta.clear
@@ -638,7 +646,7 @@ class Arborist::Node
638
646
 
639
647
  ### Publish the specified +events+ to any subscriptions the node has which match them.
640
648
  def publish_events( *events )
641
- self.log.debug "Got published events: %p" % [ events ]
649
+ self.log.debug "Got events to publish: %p" % [ events ]
642
650
  self.subscriptions.each_value do |sub|
643
651
  sub.on_events( *events )
644
652
  end
@@ -672,9 +680,7 @@ class Arborist::Node
672
680
 
673
681
  super # to state-machine
674
682
 
675
- self.publish_events( event, *self.pending_update_events )
676
- ensure
677
- self.pending_update_events.clear
683
+ return self.collect_events
678
684
  end
679
685
 
680
686
 
@@ -714,6 +720,7 @@ class Arborist::Node
714
720
  end
715
721
 
716
722
 
723
+ ### Handle a 'node.disabled' event received via broadcast.
717
724
  def handle_node_disabled_event( event )
718
725
  self.log.debug "Got a node.disabled event: %p" % [ event ]
719
726
  self.dependencies.mark_down( event.node.identifier )
@@ -8,6 +8,11 @@ require 'arborist/node'
8
8
 
9
9
  describe Arborist::Node do
10
10
 
11
+ before( :all ) do
12
+ Arborist::Event.load_all
13
+ end
14
+
15
+
11
16
  let( :concrete_class ) { TestNode }
12
17
  let( :subnode_class ) { TestSubNode }
13
18
 
@@ -843,6 +848,26 @@ describe Arborist::Node do
843
848
  # :TODO: Quieted description?
844
849
  end
845
850
 
851
+
852
+ it "broadcasts events generated by handled event transitions" do
853
+ vmhost01 = concrete_class.new( 'vmhost01' )
854
+ vm01 = concrete_class.new( 'vm01' ) do
855
+ parent 'vmhost01'
856
+ end
857
+ memcache = described_class.new( 'memcache' ) do
858
+ parent 'vm01'
859
+ end
860
+
861
+ mgr = Arborist::Manager.new
862
+ mgr.load_tree([ vmhost01, vm01, memcache ])
863
+
864
+ events = vmhost01.
865
+ update( ack: {message: "Imma gonna f up yo' sash", sender: "GOD"} )
866
+ vmhost01.publish_events( *events )
867
+
868
+ expect( memcache ).to be_quieted
869
+ end
870
+
846
871
  end
847
872
 
848
873
 
@@ -881,7 +906,6 @@ describe Arborist::Node do
881
906
  expect( node.tags ).to eq( %w[single] )
882
907
  end
883
908
 
884
-
885
909
  end
886
910
 
887
911
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arborist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre20161005112841
4
+ version: 0.0.1.pre20161005182540
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -36,7 +36,7 @@ cert_chain:
36
36
  w8aNA5re5+Rt/Vvjxj5AcEnZnZiz5x959NaddQocX32Z1unHw44pzRNUur1GInfW
37
37
  p4vpx2kUSFSAGjtCbDGTNV2AH8w9OU4xEmNz8c5lyoA=
38
38
  -----END CERTIFICATE-----
39
- date: 2016-10-05 00:00:00.000000000 Z
39
+ date: 2016-10-06 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: schedulability
@@ -405,7 +405,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
405
405
  requirements:
406
406
  - - ">="
407
407
  - !ruby/object:Gem::Version
408
- version: 2.2.0
408
+ version: 2.3.1
409
409
  required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  requirements:
411
411
  - - ">"
metadata.gz.sig CHANGED
Binary file