mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-16 22:06:43 -06:00
The `Hbc.outdated` boolean was in the way of my implementation of an `outdated` scope for `brew cask outdated`, so I took the opportunity to: * rename the flag internally to `cleanup_outdated` * move the cleanup tests over to rspec and rework them to test in a stubbed cleanroom environment * refactor the implementation of cleanup to make it a bit more testable - most importantly: inject the cache location and outdated config dependencies instead of looking them up from constants Note that there's no change to the user-facing interface, it's still ``` brew cask cleanup --outdated ```
39 lines
628 B
Ruby
39 lines
628 B
Ruby
module Hbc::Options
|
|
def self.included(base)
|
|
base.extend(ClassMethods)
|
|
end
|
|
|
|
module ClassMethods
|
|
def no_binaries
|
|
@no_binaries ||= false
|
|
end
|
|
|
|
def no_binaries=(_no_binaries)
|
|
@no_binaries = _no_binaries
|
|
end
|
|
|
|
def debug
|
|
@debug ||= false
|
|
end
|
|
|
|
def debug=(_debug)
|
|
@debug = _debug
|
|
end
|
|
|
|
def verbose
|
|
@verbose ||= false
|
|
end
|
|
|
|
def verbose=(_verbose)
|
|
@verbose = _verbose
|
|
end
|
|
|
|
def cleanup_outdated
|
|
@cleanup_outdated ||= false
|
|
end
|
|
|
|
def cleanup_outdated=(_cleanup_outdated)
|
|
@cleanup_outdated = _cleanup_outdated
|
|
end
|
|
end
|
|
end
|