Skip to content

Commit

Permalink
Merge branch 'release/0.18.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Mar 12, 2015
2 parents c0b857e + d012d3b commit 06611c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 39 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,11 @@
## develop (unreleased)


## 0.18.2 (3/12/2015)
### New features
* Add attr writers to `Pio::Match` and `Pio::ExactMatch`.


## 0.18.1 (3/11/2015)
### Changes
* `Lldp#port_number` returns primitive Ruby objects.
Expand Down
20 changes: 3 additions & 17 deletions lib/pio/exact_match.rb
Expand Up @@ -44,22 +44,8 @@ def initialize(packet_in)
# rubocop:enable MethodLength
# rubocop:enable AbcSize

extend Forwardable

def_delegator :@match, :wildcards
def_delegator :@match, :in_port
def_delegator :@match, :dl_src
def_delegator :@match, :dl_dst
def_delegator :@match, :dl_vlan
def_delegator :@match, :dl_vlan_pcp
def_delegator :@match, :dl_type
def_delegator :@match, :nw_tos
def_delegator :@match, :nw_proto
def_delegator :@match, :nw_src
def_delegator :@match, :nw_dst
def_delegator :@match, :tp_src
def_delegator :@match, :tp_dst
def_delegator :@match, :to_binary_s
def_delegator :@match, :to_binary_s, :to_binary
def method_missing(method, *args, &block)
@match.__send__ method, *args, &block
end
end
end
29 changes: 8 additions & 21 deletions lib/pio/match.rb
Expand Up @@ -3,7 +3,6 @@
require 'pio/open_flow'
require 'pio/type/ip_address'
require 'pio/type/mac_address'
require 'forwardable'

module Pio
# Fields to match against flows
Expand Down Expand Up @@ -127,26 +126,6 @@ def self.read(binary)
MatchFormat.read binary
end

extend Forwardable

def_delegators :@format, :wildcards
def_delegators :@format, :in_port
def_delegators :@format, :dl_vlan
def_delegators :@format, :dl_src
def_delegators :@format, :dl_dst
def_delegators :@format, :dl_type
def_delegators :@format, :nw_proto
def_delegators :@format, :tp_src
def_delegators :@format, :tp_dst
def_delegators :@format, :nw_src
def_delegators :@format, :nw_src_all
def_delegators :@format, :nw_dst
def_delegators :@format, :nw_dst_all
def_delegators :@format, :dl_vlan_pcp
def_delegators :@format, :nw_tos
def_delegators :@format, :to_binary_s
def_delegator :@format, :to_binary_s, :to_binary

# rubocop:disable MethodLength
# This method smells of :reek:FeatureEnvy
# This method smells of :reek:DuplicateMethodCall
Expand All @@ -165,9 +144,17 @@ def initialize(user_options)
end
# rubocop:enable MethodLength

def to_binary
@format.to_binary_s
end

def ==(other)
return false unless other
to_binary == other.to_binary
end

def method_missing(method, *args, &block)
@format.__send__ method, *args, &block
end
end
end
2 changes: 1 addition & 1 deletion lib/pio/version.rb
@@ -1,5 +1,5 @@
# Base module.
module Pio
# gem version.
VERSION = '0.18.1'.freeze
VERSION = '0.18.2'.freeze
end

0 comments on commit 06611c9

Please sign in to comment.