Class: Bcupgrade::Cask
- Inherits:
-
Object
- Object
- Bcupgrade::Cask
- Defined in:
- lib/bcupgrade/cask.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
-
#initialize(options, args, config) ⇒ Cask
constructor
A new instance of Cask.
- #list_ignore ⇒ Object
- #upgrade(casks) ⇒ Object
- #upgrade_target ⇒ Object
Constructor Details
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
7 8 9 |
# File 'lib/bcupgrade/cask.rb', line 7 def args @args end |
Instance Method Details
#list_ignore ⇒ Object
27 28 29 |
# File 'lib/bcupgrade/cask.rb', line 27 def list_ignore @config.ignore.join(' ') end |
#upgrade(casks) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bcupgrade/cask.rb', line 16 def upgrade(casks) return if @options[:dry_run] casks.each do |cask| next unless prompt_answer_yes?(cask) puts "\n==> Upgrade #{cask}" BrewCask.install(cask) end end |
#upgrade_target ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/bcupgrade/cask.rb', line 31 def upgrade_target if @args.any? @args else exclude_ignore_casks(@outdated) end end |