Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
da0a6535
Commit
da0a6535
authored
10 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
Add DeprecatedOption class.
Used to capture options that are being renamed.
parent
b91b23f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/options.rb
+17
-0
17 additions, 0 deletions
Library/Homebrew/options.rb
Library/Homebrew/test/test_options.rb
+14
-0
14 additions, 0 deletions
Library/Homebrew/test/test_options.rb
with
31 additions
and
0 deletions
Library/Homebrew/options.rb
+
17
−
0
View file @
da0a6535
...
...
@@ -32,6 +32,23 @@ class Option
end
end
class
DeprecatedOption
attr_reader
:old
,
:current
def
initialize
(
old
,
current
)
@old
=
old
@current
=
current
end
def
old_flag
"--
#{
old
}
"
end
def
current_flag
"--
#{
current
}
"
end
end
class
Options
include
Enumerable
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/test_options.rb
+
14
−
0
View file @
da0a6535
...
...
@@ -25,6 +25,20 @@ class OptionTests < Homebrew::TestCase
end
end
class
DeprecatedOptionTests
<
Homebrew
::
TestCase
def
setup
@deprecated_option
=
DeprecatedOption
.
new
(
"foo"
,
"bar"
)
end
def
test_old
assert_equal
"foo"
,
@deprecated_option
.
old
end
def
test_current
assert_equal
"bar"
,
@deprecated_option
.
current
end
end
class
OptionsTests
<
Homebrew
::
TestCase
def
setup
@options
=
Options
.
new
...
...
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