Class: OneCmd::Command::Macosx::HidenFiles
- Inherits:
-
OneCmd::Command::Macosx
- Object
- CLAide::Command
- OneCmd::Command
- OneCmd::Command::Macosx
- OneCmd::Command::Macosx::HidenFiles
- Defined in:
- lib/onecmd/command/macosx/hiden_files.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ HidenFiles
constructor
A new instance of HidenFiles.
- #run ⇒ Object
Methods inherited from OneCmd::Command
Constructor Details
#initialize(argv) ⇒ HidenFiles
Returns a new instance of HidenFiles.
15 16 17 18 |
# File 'lib/onecmd/command/macosx/hiden_files.rb', line 15 def initialize(argv) @hide = argv.flag?('hide', true) super end |
Class Method Details
.options ⇒ Object
11 12 13 |
# File 'lib/onecmd/command/macosx/hiden_files.rb', line 11 def self. [['--hide', 'hide system hiden files']].concat(super) end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/onecmd/command/macosx/hiden_files.rb', line 20 def run if @hide system('defaults write com.apple.finder AppleShowAllFiles No && killall Finder') else system('defaults write com.apple.finder AppleShowAllFiles Yes && killall Finder') end end |