Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitbourahlavignal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNAL Nicolas
gitbourahlavignal
Commits
d28c3095
Commit
d28c3095
authored
10 years ago
by
kaustubh-d
Browse files
Options
Downloads
Patches
Plain Diff
Modified IPAddress::Prefix128 to allow /0 subnets
parent
e781b98d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ipaddress/prefix.rb
+2
-2
2 additions, 2 deletions
lib/ipaddress/prefix.rb
with
2 additions
and
2 deletions
lib/ipaddress/prefix.rb
+
2
−
2
View file @
d28c3095
...
@@ -214,8 +214,8 @@ module IPAddress
...
@@ -214,8 +214,8 @@ module IPAddress
# #=> 64
# #=> 64
#
#
def
initialize
(
num
=
128
)
def
initialize
(
num
=
128
)
unless
(
1
..
128
).
include?
num
.
to_i
unless
(
0
..
128
).
include?
num
.
to_i
raise
ArgumentError
,
"Prefix must be in range
1
..128, got:
#{
num
}
"
raise
ArgumentError
,
"Prefix must be in range
0
..128, got:
#{
num
}
"
end
end
super
(
num
.
to_i
)
super
(
num
.
to_i
)
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment