lib-bootp 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0eba596b6a76e310f08fe03b3e229e64a2867bcd94a39c88a9777dc60165135c
4
- data.tar.gz: ccd6b4385ec0ac74a8aaa1eb72048961d687223202fdad6bfab55d271d872a4b
3
+ metadata.gz: 0454ec37a6fd257c39c21aa40c5da867f4c84e088f87961fc803debe812bef78
4
+ data.tar.gz: e40d949198e0ad111b9ec1800c18dc6781926057403b1f187dcff8f2d1a56bbd
5
5
  SHA512:
6
- metadata.gz: 15d7ed3014191104c8c7ad349510e6a11bdf288979ab889017a164819ed45efed9d5f08055f097704baae6e856cc9bbfabce8f222e50f17d2289bab5bda6771d
7
- data.tar.gz: c16a739bdeda069887641a7d30d92cc49b6fe078b859fc69c37ebe10de60a68ea9437f72f161ec2fdb8160cd2ef12a65a657005707e390c8bdf101437fc7d131
6
+ metadata.gz: 71d32b03690b6d7b24a31e09edca99c836c64080bd64fbfecca468a3802c3f78de31e45304999179387298f152aabcf4ae3273da16768e430c5ff963df11c317
7
+ data.tar.gz: 83b38067d4cd1958a34e8a902ca1d2bda01d32596bc1839a23614d89b76e0a6e85394243b240dabc96ee2155b133b947d71d73ece20690a679516f662680dab4
@@ -26,6 +26,9 @@ jobs:
26
26
 
27
27
  - name: Set up Ruby
28
28
  uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: 3.0.2
31
+
29
32
 
30
33
  - name: Publish to RubyGems
31
34
  run: |
@@ -12,6 +12,9 @@ jobs:
12
12
 
13
13
  - name: Set up Ruby
14
14
  uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 3.0.2
17
+
15
18
 
16
19
  - name: Install dependencies
17
20
  run: bundle install
@@ -1,5 +1,5 @@
1
1
  module Lib
2
2
  module BOOTP
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.6'
4
4
  end
5
5
  end
data/lib/lib/bootp.rb CHANGED
@@ -36,24 +36,21 @@ module Lib
36
36
  hash_attr_reader :packets, :op, :htype, :hlen, :hops, :xid, :secs, :flags, :ciaddr, :yiaddr, :siaddr, :giaddr, :chaddr, :sname, :file
37
37
 
38
38
  def initialize(op: 1, htype: 1, hlen: 6, hops: 0, xid: nil, secs: 0, flags: 0, ciaddr: 0, yiaddr: 0, siaddr: 0, giaddr: 0, chaddr: nil, sname: '.', file: '.')
39
- if block_given?
40
- yield self
41
- else
42
- packets[:op] = (op.is_a? Lib::BOOTP::Packet::OpCode) ? op : Lib::BOOTP::Packet::OpCode.new(op)
43
- packets[:htype] = (htype.is_a? Lib::BOOTP::Packet::HardwareAddressType) ? htype : Lib::BOOTP::Packet::HardwareAddressType.new(htype)
44
- packets[:hlen] = (hlen.is_a? Lib::BOOTP::Packet::HardwareAddressLength) ? hlen : Lib::BOOTP::Packet::HardwareAddressLength.new(hlen)
45
- packets[:hops] = (hops.is_a? Lib::BOOTP::Packet::HopCount) ? hops : Lib::BOOTP::Packet::HopCount.new(hops)
46
- packets[:xid] = (xid.is_a? Lib::BOOTP::Packet::TransactionID) ? xid : Lib::BOOTP::Packet::TransactionID.new(xid)
47
- packets[:secs] = (secs.is_a? Lib::BOOTP::Packet::Seconds) ? secs : Lib::BOOTP::Packet::Seconds.new(secs)
48
- packets[:flags] = (flags.is_a? Lib::BOOTP::Packet::Flags) ? flags : Lib::BOOTP::Packet::Flags.new(flags)
49
- packets[:ciaddr] = (ciaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? ciaddr : Lib::BOOTP::Packet::IPAddress.new(ciaddr)
50
- packets[:yiaddr] = (yiaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? yiaddr : Lib::BOOTP::Packet::IPAddress.new(yiaddr)
51
- packets[:siaddr] = (siaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? siaddr : Lib::BOOTP::Packet::IPAddress.new(siaddr)
52
- packets[:giaddr] = (giaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? giaddr : Lib::BOOTP::Packet::IPAddress.new(giaddr)
53
- packets[:chaddr] = (chaddr.is_a? Lib::BOOTP::Packet::ClientHardwareAddress) ? chaddr : Lib::BOOTP::Packet::ClientHardwareAddress.new(chaddr)
54
- packets[:sname] = (sname.is_a? Lib::BOOTP::Packet::ServerHostName) ? sname : Lib::BOOTP::Packet::ServerHostName.new(sname)
55
- packets[:file] = (file.is_a? Lib::BOOTP::Packet::BootFile) ? file : Lib::BOOTP::Packet::BootFile.new(file)
56
- end
39
+ packets[:op] = (op.is_a? Lib::BOOTP::Packet::OpCode) ? op : Lib::BOOTP::Packet::OpCode.new(op)
40
+ packets[:htype] = (htype.is_a? Lib::BOOTP::Packet::HardwareAddressType) ? htype : Lib::BOOTP::Packet::HardwareAddressType.new(htype)
41
+ packets[:hlen] = (hlen.is_a? Lib::BOOTP::Packet::HardwareAddressLength) ? hlen : Lib::BOOTP::Packet::HardwareAddressLength.new(hlen)
42
+ packets[:hops] = (hops.is_a? Lib::BOOTP::Packet::HopCount) ? hops : Lib::BOOTP::Packet::HopCount.new(hops)
43
+ packets[:xid] = (xid.is_a? Lib::BOOTP::Packet::TransactionID) ? xid : Lib::BOOTP::Packet::TransactionID.new(xid)
44
+ packets[:secs] = (secs.is_a? Lib::BOOTP::Packet::Seconds) ? secs : Lib::BOOTP::Packet::Seconds.new(secs)
45
+ packets[:flags] = (flags.is_a? Lib::BOOTP::Packet::Flags) ? flags : Lib::BOOTP::Packet::Flags.new(flags)
46
+ packets[:ciaddr] = (ciaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? ciaddr : Lib::BOOTP::Packet::IPAddress.new(ciaddr)
47
+ packets[:yiaddr] = (yiaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? yiaddr : Lib::BOOTP::Packet::IPAddress.new(yiaddr)
48
+ packets[:siaddr] = (siaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? siaddr : Lib::BOOTP::Packet::IPAddress.new(siaddr)
49
+ packets[:giaddr] = (giaddr.is_a? Lib::BOOTP::Packet::IPAddress) ? giaddr : Lib::BOOTP::Packet::IPAddress.new(giaddr)
50
+ packets[:chaddr] = (chaddr.is_a? Lib::BOOTP::Packet::ClientHardwareAddress) ? chaddr : Lib::BOOTP::Packet::ClientHardwareAddress.new(chaddr)
51
+ packets[:sname] = (sname.is_a? Lib::BOOTP::Packet::ServerHostName) ? sname : Lib::BOOTP::Packet::ServerHostName.new(sname)
52
+ packets[:file] = (file.is_a? Lib::BOOTP::Packet::BootFile) ? file : Lib::BOOTP::Packet::BootFile.new(file)
53
+ yield self if block_given?
57
54
  end
58
55
 
59
56
  def op=(op)
@@ -176,10 +173,10 @@ module Lib
176
173
  end
177
174
 
178
175
  def self.from_json(json)
179
- json = json.is_a?(Hash) ? json: JSON.parse(json)
176
+ json = json.is_a?(Hash) ? JSON.parse(json.to_json, symbolize_names: true) : JSON.parse(json, symbolize_names: true)
180
177
  self.new do |p|
181
178
  json.each_pair do |k,v|
182
- p.send("#{k}=".to_sym, v) rescue NoMethodError
179
+ p.send("#{k}=".to_sym, v) unless k == :options
183
180
  end
184
181
  end
185
182
  end
data/lib-bootp.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "rspec"
26
26
 
27
- spec.add_dependency 'net-address', '~> 0.2.2'
27
+ spec.add_dependency 'net-address', '~> 0.2.3'
28
28
 
29
29
  spec.required_ruby_version = '>= 3.0.0'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lib-bootp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Wojcieszonek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-14 00:00:00.000000000 Z
11
+ date: 2025-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.2.2
61
+ version: 0.2.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.2.2
68
+ version: 0.2.3
69
69
  description: Set of classes to low level handle the BOOTP protocol
70
70
  email:
71
71
  - piotr@wojcieszonek.pl
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.2.32
122
+ rubygems_version: 3.2.22
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: BOOTP protocol library