diff options
| author | Jack Nagel | 2013-01-23 00:26:22 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-01-26 11:37:01 -0600 |
| commit | a5471a0cb0f461600bc9bfb9f9feb3825c124b84 (patch) | |
| tree | c1e262bcd5b80f96b6d967b29c37224e150cb3ee /Library | |
| parent | f3d3bc436829b5e9212e052cec50cded80cea2df (diff) | |
| download | brew-a5471a0cb0f461600bc9bfb9f9feb3825c124b84.tar.bz2 | |
Options can be used interchangeably with Strings
We want to be able to use Option objects in place of strings and have
this be transparent. Defining to_str means that methods like
Kernel#system and Kernel#exec will be able to perform an implicit
conversion.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_support.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index 9f30afbf7..caf82f765 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -172,6 +172,11 @@ class Option @flag = '--'+name.to_s end + def to_s + flag + end + alias_method :to_str, :to_s + def eql?(other) @name == other.name end |
