Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More efficient listing of installed Casks #1778

Closed
wants to merge 1 commit into from

Conversation

hanxue
Copy link
Contributor

@hanxue hanxue commented Nov 18, 2013

Fix for #911

@hanxue
Copy link
Contributor Author

hanxue commented Nov 18, 2013

Replace older pull request #1416 due to changes from a1fa264

Need opinion and assistance from @phinze :

  1. Listing the content of Caskroom is significantly faster.

Using existing code puts_columns Cask::CLI.nice_listing(Cask.installed) it takes 0.5 seconds on my machine

$ time brew cask list
caffeine        jd-gui      macupdate-desktop   spotifree
chicken         jdownloader     nosleep         spotify
colloquy        jitsi       oovoo           transmission
diffmerge       lastfm      picasa          vagrant
dradio          lastpass-universal  rdio
haskell-platform    litecoin        retroshare

real    0m0.507s
user    0m0.438s
sys 0m0.067s

Simply listing the contents of Caskroom system "ls", "/opt/homebrew-cask/Caskroom" takes 0.1 seconds

$ time brew cask list
alfred          jd-gui          opera-next
bluestacks      jdownloader     picasa
caffeine        jitsi           privoxy
chicken         kdiff3          rdio
cocktail        lastfm          remotebox
cocktail-mavericks  lastpass-universal  retroshare
colloquy        lime-chat       spotifree
deeper          lion-disk-maker     spotify
diffmerge       litecoin        squidman
dradio          macpilot        sublime-text-dev
growl-fork      macupdate-desktop   tinkertool
haskell-platform    mnpp            transmission
intellij13beta      nosleep         vagrant
itweakx         onyx
itweax          oovoo

real    0m0.114s
user    0m0.078s
sys 0m0.035s

  1. Using the directory listing approach, the first test will not work https://github.com/phinze/homebrew-cask/blob/master/test/cask/cli/list_test.rb?source=cc

Does it make sense to make the test run

 it 'lists the installed casks in a pretty fashion' do
    lambda {
      Cask::CLI::List.run
    }.must_output puts_columns Cask::CLI.nice_listing(Cask.installed)`

?

@fanquake
Copy link
Contributor

If you think that tests need to be updated/removed, you should include those commits in this pull.

@muescha
Copy link
Contributor

muescha commented Nov 18, 2013

since app names and filenames can be different i dont like this hack.

i would prefer a more detailed listing with file name, app name, description ( #1790 )

@phinze
Copy link
Contributor

phinze commented Nov 18, 2013

I'm working on new code around brew list that will address this issue - it will also properly list casks that have been installed then renamed. I'll close this once that code is pushed.

@phinze
Copy link
Contributor

phinze commented Dec 6, 2013

Okay modified brew list has landed so closing this guy. Thanks for helping push this functionality forward! 🍴

@phinze phinze closed this Dec 6, 2013
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants