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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9a6f3059fad7497734bf84b1a3cbc78424ca9a4ad464cc148f4b282e924a5f9
4
- data.tar.gz: 40aa89ebcb5576d5a6e441eb5eb96ff55188f7156f64a949f19e664b6d5eb850
3
+ metadata.gz: f80aa575f1a7ad8532b623472413ee836f8f3b0a6536604a81eecf0571311c1c
4
+ data.tar.gz: 95713dba05b2b2ebd72b41361e1a9147ef0c049718478d4befbdd709a412d376
5
5
  SHA512:
6
- metadata.gz: 8957098a515056b4dd8f358f25defd22c7edea00ace7b7be35f9eb996aa49210993c3c0c3cf1a59ff4b8a2dae1fa5afe0c31c93acfbd053c6047899e29c17fef
7
- data.tar.gz: 3e6d3b82fa4c971d3d3fa579ece667ea383d5bc2cc410fdbb06583be2a6d9bd5dfcf418261eb0ad666299d3feaae3b4f3b5efaf90ece48b1ae1ece604fa6b5cc
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/[USERNAME]/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.
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
 
@@ -71,18 +71,17 @@ module Net
71
71
  private
72
72
 
73
73
  def parse_address(address)
74
- case address
75
- when self.class
76
- @address = address.to_i
77
- @mask = address.mask
78
- when IPAddr
79
- @address = address.to_i
80
- when Integer
81
- parse_integer(address)
82
- when String
83
- parse_string(address)
84
- else
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
 
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  module Address
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
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.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-01-08 00:00:00.000000000 Z
11
+ date: 2018-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler