pio 0.17.0 → 0.18.0

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
  SHA1:
3
- metadata.gz: adb4a96e523a5a2ee14a1ae1e467820a57d1ecda
4
- data.tar.gz: 16e5ef5fbd1ca5db6d6842adae25c083df64b6b6
3
+ metadata.gz: 33e35f46e186590c9403a06bff892b694e39cb11
4
+ data.tar.gz: 04401c6141404c86a66ef792c9e5bcb4c113005a
5
5
  SHA512:
6
- metadata.gz: 51b278154025ee26b185c8e986c1d3f22a4be577ee00fcb5020724223fdd7824b4f7b3785259a4de11beeb0ffeb2ca6d50e1f3f770faf88c6e0415901672ffdc
7
- data.tar.gz: d751e889d588d75e1d909724711e7e12b47deb16273f56a28eeef72dabbbfdf1319393fce1acb85c06e8dd140134b442b31c112f2948a986b5a936d76ee58a29
6
+ metadata.gz: f8803c90d1dd338c2a8a5ec23242ff3bc828276c1da526c2dbb7bf676799c14ce50eacbf3afac0c56c9e2b5a704502ec0008dfc3a9cb93e7ad6a3c7e941c1df9
7
+ data.tar.gz: 79a9fcd98763f8b5b8c5a18c1d34d2207f5bb27c99887e18c7406e3e124af7daaded7314d203b04708a0074059ce8c4a009a65fb56b707cb27cee8279002a05d
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Changelog
2
2
 
3
3
  ## develop (unreleased)
4
+ ### Changes
5
+ * Deprecated `Pio::Mac#== Integer`.
6
+ * `Pio::PacketIn#source_mac` and `Pio::PacketIn#destination_mac` returns `Pio::Mac`.
4
7
 
5
8
 
6
9
  ## 0.17.0 (3/6/2015)
@@ -4,17 +4,19 @@ Feature: Pio::PacketIn.read
4
4
  When I try to parse the file with "PacketIn" class
5
5
  Then it should finish successfully
6
6
  And the parsed data have the following field and value:
7
- | field | value |
8
- | class | Pio::PacketIn |
9
- | ofp_version | 1 |
10
- | message_type | 10 |
11
- | message_length | 78 |
12
- | transaction_id | 0 |
13
- | xid | 0 |
14
- | buffer_id | 4294967040 |
15
- | total_len | 60 |
16
- | in_port | 1 |
17
- | reason | no_match |
18
- | raw_data.length | 60 |
19
- | source_mac | ac:5d:10:31:37:79 |
20
- | destination_mac | ff:ff:ff:ff:ff:ff |
7
+ | field | value |
8
+ | class | Pio::PacketIn |
9
+ | ofp_version | 1 |
10
+ | message_type | 10 |
11
+ | message_length | 78 |
12
+ | transaction_id | 0 |
13
+ | xid | 0 |
14
+ | buffer_id | 4294967040 |
15
+ | total_len | 60 |
16
+ | in_port | 1 |
17
+ | reason | no_match |
18
+ | raw_data.length | 60 |
19
+ | source_mac | ac:5d:10:31:37:79 |
20
+ | source_mac.class | Pio::Mac |
21
+ | destination_mac | ff:ff:ff:ff:ff:ff |
22
+ | destination_mac.class | Pio::Mac |
data/lib/pio/mac.rb CHANGED
@@ -136,23 +136,23 @@ module Pio
136
136
 
137
137
  #
138
138
  # Returns +true+ if +other+ can be converted to a {Mac}
139
- # object and its numeric representation is equal to +obj+'s.
139
+ # object and its string representation is equal to +obj+'s.
140
140
  #
141
141
  # @example
142
142
  # mac_address = Mac.new("11:22:33:44:55:66")
143
143
  #
144
144
  # mac_address == Mac.new("11:22:33:44:55:66") #=> true
145
145
  # mac_address == "11:22:33:44:55:66" #=> true
146
- # mac_address == 0x112233445566 #=> true
147
146
  # mac_address == "INVALID_MAC_ADDRESS" #=> false
148
147
  #
149
- # @param other [#to_str, #to_int] a {Mac} object or an object
150
- # that can be converted to an Ethernet address.
148
+ # @param other [#to_s] a {Mac} object or an object that can be
149
+ # converted to an Ethernet address.
151
150
  #
152
151
  # @return [Boolean]
153
152
  #
154
153
  def ==(other)
155
- to_i == Mac.new(other).to_i
154
+ return false if other.is_a?(Integer)
155
+ to_s == Mac.new(other).to_s
156
156
  rescue InvalidValueError
157
157
  false
158
158
  end
data/lib/pio/packet_in.rb CHANGED
@@ -109,7 +109,7 @@ module Pio
109
109
  end
110
110
 
111
111
  def method_missing(method, *args)
112
- data.__send__ method, *args
112
+ data.__send__(method, *args).snapshot
113
113
  end
114
114
  end
115
115
  end
data/lib/pio/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Base module.
2
2
  module Pio
3
3
  # gem version.
4
- VERSION = '0.17.0'.freeze
4
+ VERSION = '0.18.0'.freeze
5
5
  end
data/pio.gemspec CHANGED
@@ -43,7 +43,7 @@ Gem::Specification.new do |gem|
43
43
  # Guard
44
44
  gem.add_development_dependency 'guard', '~> 2.12.4'
45
45
  gem.add_development_dependency 'guard-bundler', '~> 2.1.0'
46
- gem.add_development_dependency 'guard-cucumber', '~> 1.5.3'
46
+ gem.add_development_dependency 'guard-cucumber', '~> 1.5.4'
47
47
  gem.add_development_dependency 'guard-rspec', '~> 4.5.0'
48
48
  gem.add_development_dependency 'guard-rubocop', '~> 1.2.0'
49
49
  gem.add_development_dependency 'rb-fchange', '~> 0.0.6'
data/spec/pio/mac_spec.rb CHANGED
@@ -12,8 +12,7 @@ describe Pio::Mac do
12
12
  it { is_expected.to eq '11:22:33:44:55:66' }
13
13
  it { is_expected.not_to eq Pio::Mac.new('66:55:44:33:22:11') }
14
14
  it { is_expected.not_to eq '66:55:44:33:22:11' }
15
- it { is_expected.to eq 0x112233445566 }
16
- it { is_expected.not_to eq 42 }
15
+ it { is_expected.not_to eq 0x112233445566 }
17
16
  it { is_expected.not_to eq 'INVALID_MAC_ADDRESS' }
18
17
  end
19
18
 
@@ -22,8 +21,7 @@ describe Pio::Mac do
22
21
  it { expect(subject).to eql '11:22:33:44:55:66' }
23
22
  it { expect(subject).not_to eql Pio::Mac.new('66:55:44:33:22:11') }
24
23
  it { expect(subject).not_to eql '66:55:44:33:22:11' }
25
- it { expect(subject).to eql 0x112233445566 }
26
- it { expect(subject).not_to eql 42 }
24
+ it { expect(subject).not_to eql 0x112233445566 }
27
25
  it { expect(subject).not_to eql 'INVALID_MAC_ADDRESS' }
28
26
  end
29
27
 
@@ -81,8 +79,7 @@ describe Pio::Mac do
81
79
  it { is_expected.not_to eq Pio::Mac.new('66:55:44:33:22:11') }
82
80
  it { is_expected.not_to eq '6655.4433.2211' }
83
81
  it { is_expected.not_to eq '66:55:44:33:22:11' }
84
- it { is_expected.to eq 0x112233445566 }
85
- it { is_expected.not_to eq 42 }
82
+ it { is_expected.not_to eq 0x112233445566 }
86
83
  it { is_expected.not_to eq 'INVALID_MAC_ADDRESS' }
87
84
  end
88
85
 
@@ -95,8 +92,7 @@ describe Pio::Mac do
95
92
  it { expect(subject).not_to eql Pio::Mac.new('66:55:44:33:22:11') }
96
93
  it { expect(subject).not_to eql '6655.4433.2211' }
97
94
  it { expect(subject).not_to eql '66:55:44:33:22:11' }
98
- it { expect(subject).to eql 0x112233445566 }
99
- it { expect(subject).not_to eql 42 }
95
+ it { expect(subject).not_to eql 0x112233445566 }
100
96
  it { expect(subject).not_to eql 'INVALID_MAC_ADDRESS' }
101
97
  end
102
98
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhito Takamiya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-06 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 1.5.3
103
+ version: 1.5.4
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 1.5.3
110
+ version: 1.5.4
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: guard-rspec
113
113
  requirement: !ruby/object:Gem::Requirement