plexus 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -110,7 +110,7 @@ module Plexus
110
110
  n = u.number if u.class.include? ArcNumber and n.nil?
111
111
  u, v, l = u.source, u.target, u.label if u.is_a? Plexus::Arc
112
112
 
113
- return self if not @allow_loops and u == v
113
+ return self if !@allow_loops && u == v
114
114
 
115
115
  n = (@next_edge_number += 1) unless n if @parallel_edges
116
116
  add_vertex!(u)
@@ -13,7 +13,8 @@ module Plexus
13
13
 
14
14
  # Ignore labels for equality.
15
15
  def eql?(other)
16
- self.class == other.class and target == other.target and source == other.source
16
+ same_class = (self.class.ancestors.include? other.class)
17
+ same_class && target == other.target && source == other.source
17
18
  end
18
19
  alias == eql?
19
20
 
@@ -3,9 +3,11 @@ module Plexus
3
3
  # undirected graphs. Edge[u,v] == Edge[v,u]
4
4
  class Edge < Arc
5
5
 
6
- # Equality allows for the swapping of source and target
6
+ # Edge equality allows for the swapping of source and target.
7
+ #
7
8
  def eql?(other)
8
- super or (self.class == other.class and target == other.source and source == other.target)
9
+ same_class = (self.class.ancestors.include? other.class)
10
+ super || (same_class && target == other.source && source == other.target)
9
11
  end
10
12
  alias == eql?
11
13
 
@@ -1,6 +1,6 @@
1
1
  module Plexus
2
2
  MAJOR = 0
3
3
  MINOR = 5
4
- PATCH = 6
4
+ PATCH = 7
5
5
  VERSION = [MAJOR, MINOR, PATCH].join('.')
6
6
  end
@@ -48,11 +48,11 @@ module AncestryHelper
48
48
  end
49
49
 
50
50
  RSpec.configure do |config|
51
+ config.include AncestryHelper
51
52
  # Remove this line if you don't want RSpec's should and should_not
52
53
  # methods or matchers
53
54
  require 'rspec/expectations'
54
55
  config.include RSpec::Matchers
55
- config.include AncestryHelper
56
56
 
57
57
  # == Mock Framework
58
58
  config.mock_with :rspec
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: plexus
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.6
5
+ version: 0.5.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Bruce Williams
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-07-08 00:00:00 +02:00
14
+ date: 2011-07-10 00:00:00 +02:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency