ipaddress_link_local 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.rock.yml +5 -0
- data/.travis.yml +21 -0
- data/CHANGELOG.rdoc +115 -0
- data/CONTRIBUTING.md +39 -0
- data/Gemfile +11 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +995 -0
- data/Rakefile +68 -0
- data/VERSION +1 -0
- data/ipaddress_link_local.gemspec +82 -0
- data/lib/ipaddress/ipv4.rb +1114 -0
- data/lib/ipaddress/ipv6.rb +909 -0
- data/lib/ipaddress/mongoid.rb +75 -0
- data/lib/ipaddress/prefix.rb +265 -0
- data/lib/ipaddress/version.rb +3 -0
- data/lib/ipaddress.rb +227 -0
- data/tasks/jeweler.rake +16 -0
- data/test/ipaddress/ipv4_test.rb +625 -0
- data/test/ipaddress/ipv6_test.rb +450 -0
- data/test/ipaddress/mongoid_test.rb +70 -0
- data/test/ipaddress/prefix_test.rb +153 -0
- data/test/ipaddress_test.rb +82 -0
- data/test/test_helper.rb +37 -0
- metadata +179 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cba0234965a119b778b684905ee19ebb231408a6
|
4
|
+
data.tar.gz: 2190fca4b7a6d25fcb7bf52b89c58fcb70f78632
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 523535ae39a8993af90b016fde28c0e729fc06483e92f51bccce071b10befcca13d082c0156c180786d9223aec92e3328d5ebecda29a5cf5a7268f650408650b
|
7
|
+
data.tar.gz: ef3a0bea3760c84f0a9cc6748f65ea8860399fd0c2223c50f3f77a55b6d5327653a152b34634ff4fab1723de767b645c9d3d1d351118b8efb6f9c23bce4ccbac
|
data/.document
ADDED
data/.rock.yml
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.3.0
|
4
|
+
- 2.2.4
|
5
|
+
- 2.2.0
|
6
|
+
- 2.1.8
|
7
|
+
- 2.1.3
|
8
|
+
- 2.0.0
|
9
|
+
- 1.9.3
|
10
|
+
install:
|
11
|
+
- gem install bundler
|
12
|
+
- gem uninstall rake -x
|
13
|
+
- gem install rake
|
14
|
+
- bundle install
|
15
|
+
script:
|
16
|
+
- uname -s
|
17
|
+
- rake test
|
18
|
+
addons:
|
19
|
+
code_climate:
|
20
|
+
repo_token:
|
21
|
+
secure: Na2Ghl3W0IpUWAWx66V9skLie5MqiJWfn7muCSRkAYIVL/j9fR6jhhawOKlX0R6bg4byouOyLieDu9HWsv2EY5L7JweVspodRuuaJndxDQ1E5rOp0mU6vDl7kIqBeboX3AsivXDgcc8C8qvE+WD++vr3oEMg22c2/RIbt6ecJGs=
|
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
== ipaddress 0.8.2
|
2
|
+
|
3
|
+
CHANGED:: merged bundler branch to cleanup gemspec and Rakefiles
|
4
|
+
FIXED:: IPAddress::IPv4.split handling (Issue #40)
|
5
|
+
NEW:: Added #[]= method to IPv4/6 classes to add octet writing support. (Issue #24)
|
6
|
+
NEW:: IPV4#multicast?
|
7
|
+
NEW:: IPV4#loopback?
|
8
|
+
NEW:: IPV4#to()
|
9
|
+
|
10
|
+
== ipaddress 0.8.1
|
11
|
+
|
12
|
+
CHANGED:: ipaddress now uses minitest for testing, all tests passing
|
13
|
+
|
14
|
+
== ipaddress 0.8.0
|
15
|
+
|
16
|
+
CHANGED:: ipaddress now uses this[https://gist.github.com/cpetschnig/294476] regexp to validate IPv6 addresses. Thanks to Christoph Petschnig for his regexp and to Bronislav Robenek for fixing this.
|
17
|
+
CHANGED:: Removed extension methods and extension directory to facilitate integration with the stdlib
|
18
|
+
CHANGED:: Reworked IPv4#<=>, now intuitively sorts objects based on the prefix
|
19
|
+
CHANGED:: IPv4#supernet now returns "0.0.0.0/0" if supernetting with a prefix less than 1
|
20
|
+
CHANGED:: IPv4#subnet now accept a new prefix instead of number of subnets (as per RFC3531)
|
21
|
+
NEW:: IPv6#network
|
22
|
+
NEW:: Prefix128#host_prefix
|
23
|
+
NEW:: IPv6#broadcast_u128
|
24
|
+
NEW:: IPv6#each
|
25
|
+
NEW:: IPv6#<=>
|
26
|
+
NEW:: IPv4#split
|
27
|
+
NEW:: IP#ntoa
|
28
|
+
|
29
|
+
== ipaddress 0.7.5
|
30
|
+
|
31
|
+
CHANGED:: IPAddress::IPv4#each_host to improve speed
|
32
|
+
FIXED:: IPAddress::IPv4::summarize bug (summarization should now work properly)
|
33
|
+
NEW:: IPAddress::IPv4#include_all?
|
34
|
+
NEW:: #ipv4? and #ipv6?
|
35
|
+
|
36
|
+
== ipaddress 0.7.0
|
37
|
+
|
38
|
+
NEW:: IPAddress::IPv6#include?
|
39
|
+
NEW:: IPAddress::IPv6#network_u128
|
40
|
+
NEW:: Modified IPAddress::IPv6::Mapped to accept IPv4 mapped addresses in IPv6 format
|
41
|
+
NEW:: IPAddress::IPv4#private?
|
42
|
+
NEW:: IPAddress::IPv4::parse_classful
|
43
|
+
|
44
|
+
== ipaddress 0.6.0
|
45
|
+
|
46
|
+
=== API changes
|
47
|
+
* IPv4#to_s now returns the address portion only,
|
48
|
+
to retain compatibility with IPAddr. Example:
|
49
|
+
|
50
|
+
IPAddress("172.16.10.1/24").to_s
|
51
|
+
#=> "172.16.10.1" # ipaddress 0.6.0
|
52
|
+
|
53
|
+
IPAddress("172.16.10.1/24").to_s
|
54
|
+
#=> "172.16.10.1/24" # ipaddress 0.5.0
|
55
|
+
|
56
|
+
* IPv6#to_s now returns the address portion only,
|
57
|
+
to retain compatibility with IPAddr. Example:
|
58
|
+
|
59
|
+
IPAddress "2001:db8::8:800:200c:417a/64".to_s
|
60
|
+
#=> "2001:db8::8:800:200c:417a" # ipaddress 0.6.0
|
61
|
+
|
62
|
+
IPAddress "2001:db8::8:800:200c:417a/64".to_s
|
63
|
+
#=> "2001:db8::8:800:200c:417a/64" # ipaddress 0.6.0
|
64
|
+
|
65
|
+
* IPv6::Unspecified#to_s, IPv6::Loopback and
|
66
|
+
IPv6::Mapped#to_s now return the address portion only,
|
67
|
+
to retain compatibility with IPAddr.
|
68
|
+
* IPv4::summarize now returns an array even if the
|
69
|
+
result is a single subnet, to keep consistency
|
70
|
+
and avoid confusion
|
71
|
+
|
72
|
+
=== New methods
|
73
|
+
* IPv4#to_string and IPv6#to_string: print the address
|
74
|
+
with the prefix portion, like the #to_s method in
|
75
|
+
ipaddress 0.5.0
|
76
|
+
* IPAddress::parse, for those who don't like the wrapper
|
77
|
+
method IPAddress()
|
78
|
+
* IPv6#to_string_uncompressed, returns a string with the
|
79
|
+
uncompressed IPv6 and the prefix
|
80
|
+
* IPv6::Mapped#to_string, returns the IPv6 Mapped address
|
81
|
+
with IPv4 notation and the prefix
|
82
|
+
* IPv6#reverse, returns the ip6.arpa DNS reverse lookup
|
83
|
+
string
|
84
|
+
* IPv4#arpa and IPv6#arpa, alias of the respective #reverse
|
85
|
+
methods
|
86
|
+
* Prefix#+, Prefix#-
|
87
|
+
|
88
|
+
=== Library structure
|
89
|
+
* Moved all the IPAddress module methods from
|
90
|
+
lib/ipaddress/ipbase.rb to lib/ipaddress.rb
|
91
|
+
* Removed IPBase superclass
|
92
|
+
* IPv4 and IPv6 classes no longer inherit from IPBase
|
93
|
+
* Removed lib/ipaddress/ipbase.rb
|
94
|
+
* Removed test/ipaddress/ipbase_test.rb
|
95
|
+
|
96
|
+
=== Minor fixes
|
97
|
+
* Replaced Ruby 1.9 deprecated Hash#index with Hash#key
|
98
|
+
* Removed require ruby-prof from tests which was causing
|
99
|
+
users to install ruby-prof or manually remove the line
|
100
|
+
* Removed "must" method from tests, replaced by normal
|
101
|
+
Test::Unit methods
|
102
|
+
* Removed duplicate Jeweler entry in Rakefile
|
103
|
+
* Made Integer#closest_power_of_2 more general by adding
|
104
|
+
an optional limit parameter
|
105
|
+
* Fixed summarization algorithm (thanks to nicolas fevrier)
|
106
|
+
* Fixed bug in prefix_from_ip (thanks to jdpace)
|
107
|
+
|
108
|
+
=== Documentation
|
109
|
+
* Normalized README rdoc headers
|
110
|
+
* Added documentation for IPAddress::Prefix
|
111
|
+
* Added documentation for IPAddress::IPv4 and
|
112
|
+
IPAddress::IPv6
|
113
|
+
* Fixed formatting
|
114
|
+
* Fixed lots of typos
|
115
|
+
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Contributing to the IPAddress Gem
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/ipaddress-gem/ipaddress.svg?branch=master)](https://travis-ci.org/ipaddress-gem/ipaddress) [![Code Climate](https://codeclimate.com/github/ipaddress-gem/ipaddress/badges/gpa.svg)](https://codeclimate.com/github/ipaddress-gem/ipaddress) [![Dependency Status](https://www.versioneye.com/user/projects/57001305fcd19a0051853bde/badge.svg?style=flat)](https://www.versioneye.com/user/projects/57001305fcd19a0051853bde)
|
4
|
+
|
5
|
+
This gem is run by people who have jobs. So please understand if we can't always prioritize PRs and issues.
|
6
|
+
|
7
|
+
You can help by making your code submissions. We can't promise a specific turnaround time, or that your code will be incorporated but all submissions are appreciated.
|
8
|
+
|
9
|
+
## Steps to Submit a Pull Request
|
10
|
+
|
11
|
+
* [Fork](https://help.github.com/articles/fork-a-repo) the project on GitHub.
|
12
|
+
* Make your feature addition or bug fix [in a feature branch](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches). (Include a description of your changes in the PR)
|
13
|
+
* Push your feature branch to GitHub.
|
14
|
+
* Send a [Pull Request](https://help.github.com/articles/using-pull-requests)
|
15
|
+
|
16
|
+
## Style Guide
|
17
|
+
|
18
|
+
We will require that you adhere to the [ruby-style-guide](https://github.com/bbatsov/ruby-style-guide) for your code submissions.
|
19
|
+
|
20
|
+
## Test Coverage
|
21
|
+
|
22
|
+
All submissions of code must include test coverage which describes intent and expected behavior. The test suite used by this gem is [Minitest](https://github.com/seattlerb/minitest)
|
23
|
+
|
24
|
+
Unit tests are expected to execute quickly. We will ask you to revise any long-running tests.
|
25
|
+
|
26
|
+
We intend to add [Travis CI](https://travis-ci.org/) for automatic execution of branch tests.
|
27
|
+
|
28
|
+
## Versioning: Jeweler and Semantic Versioning
|
29
|
+
|
30
|
+
This repo uses [semantic versioning](http://semver.org/) implemented by the [Jeweler Gem](https://github.com/technicalpickles/jeweler). Please do not update the version by editting files, instead, you may increment or modify the version using the Rake tasks added by Jeweler.
|
31
|
+
|
32
|
+
```
|
33
|
+
$ rake -T | grep version
|
34
|
+
rake version # Displays the current version
|
35
|
+
rake version:bump:major # Bump the major version by 1
|
36
|
+
rake version:bump:minor # Bump the a minor version by 1
|
37
|
+
rake version:bump:patch # Bump the patch version by 1
|
38
|
+
rake version:write # Writes out an explicit version
|
39
|
+
```
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'bundler', '>= 1.0'
|
5
|
+
gem 'rake', '10.5.0'
|
6
|
+
gem 'minitest', '~> 5.8', '>= 5.8.4'
|
7
|
+
gem 'pry', '>= 0.10.1'
|
8
|
+
gem 'travis', '>= 1.8.2'
|
9
|
+
gem 'jeweler', '>=2.0.1'
|
10
|
+
gem 'codeclimate-test-reporter'
|
11
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009-2015 Marco Ceresa
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|