net-address 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -8
- data/lib/net/address/ipv4.rb +11 -12
- data/lib/net/address/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f80aa575f1a7ad8532b623472413ee836f8f3b0a6536604a81eecf0571311c1c
|
4
|
+
data.tar.gz: 95713dba05b2b2ebd72b41361e1a9147ef0c049718478d4befbdd709a412d376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13c55cec572efc9ca87c5a0014c9b661fa60277215f09784925d078cdb1028500227b47e8830860d8962da1a1468f57d62fae09917b46daef457c287c5849f01
|
7
|
+
data.tar.gz: e339b552134c0e271c3db1d87df6bd16975a15bb9982bf7b781b132ca1d26e926bc07d5a4a81d6e83ad96ce30340cbafed09ed74081fb174d9ba351b0d9dd87e
|
data/README.md
CHANGED
@@ -21,16 +21,9 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
$ gem install net-address
|
23
23
|
|
24
|
-
|
25
|
-
## Development
|
26
|
-
|
27
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
28
|
-
|
29
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
30
|
-
|
31
24
|
## Contributing
|
32
25
|
|
33
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
26
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pwojcieszonek/net-address. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
34
27
|
|
35
28
|
## License
|
36
29
|
|
data/lib/net/address/ipv4.rb
CHANGED
@@ -71,18 +71,17 @@ module Net
|
|
71
71
|
private
|
72
72
|
|
73
73
|
def parse_address(address)
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
raise ArgumentError, "No implicit conversion of #{address.class.name} to #{self.class.name}"
|
74
|
+
if address.kind_of?(self.class)
|
75
|
+
@address = address.to_i
|
76
|
+
@mask = address.mask
|
77
|
+
elsif address.kind_of?(IPAddr)
|
78
|
+
@address = address.to_i
|
79
|
+
elsif address.kind_of?(Integer)
|
80
|
+
parse_integer(address)
|
81
|
+
elsif address.kind_of?(String)
|
82
|
+
parse_string(address)
|
83
|
+
else
|
84
|
+
raise ArgumentError, "No implicit conversion of #{address.class.name} to #{self.class.name}"
|
86
85
|
end
|
87
86
|
end
|
88
87
|
|
data/lib/net/address/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-address
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Wojcieszonek
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|