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

Improved search #177

Closed
fabiopelosin opened this issue Mar 19, 2012 · 14 comments
Closed

Improved search #177

fabiopelosin opened this issue Mar 19, 2012 · 14 comments
Assignees
Milestone

Comments

@fabiopelosin
Copy link
Member

Inspired by the work of @yas375 I'm proposing some improvements to pod search

  • Colors: I'm not sure if there could be any compatibility issues or ugly coloring with some color schemes.
  • Description wrap: currently long descriptions are wrapped by the terminal and lose indentation. I found a nice way to word split a string at a given colum. However, I'm not sure on how to properly credit a short function.
  • Github watchers and followers: this is very useful for me. However it makes the search slower because a request to GitHub is made for every pod. If accepted I plan to introduce an option to disable it and a very short (2s) timeout.

Here is an example of what I have. Layout needs a bit of fine tuning.
Imgur

@ghost ghost assigned fabiopelosin Mar 19, 2012
@yas375
Copy link
Contributor

yas375 commented Mar 19, 2012

It's very nice!

About github: maybe better to not include watchers and forks by default and only include this info by calling search command with specific flag?

fabiopelosin added a commit that referenced this issue Mar 22, 2012
- colors
- description wrap
- GitHub watchers and followers
@alloy
Copy link
Member

alloy commented Mar 23, 2012

Indeed, it's very nice!

But, I agree with Victor that we hold probably not enable the github info by default, as it is not essential information and obviously adds lag due to each network connection, which you will not want when trying multiple searches.

It’s probably best to work on having an RC file asap so that the users can set their own defaults.

@fabiopelosin
Copy link
Member Author

@yas375 and @alloy what do you think about the option name?

@alloy
Copy link
Member

alloy commented Mar 23, 2012

@irrationalfab What do you think about always including the source, but make the stats part optional and changing the option name to --stats?

fabiopelosin added a commit that referenced this issue Mar 23, 2012
@fabiopelosin
Copy link
Member Author

@alloy this is a much cleaner approach.

@fabiopelosin
Copy link
Member Author

Btw, sorry for the push noise: I missed your comment and then I did a misstake that I realized only after push.

@alloy
Copy link
Member

alloy commented Mar 23, 2012

Awesome! Please merge :)

Btw, sorry for the push noise: I missed your comment and then I did a misstake that I realized only after push.

Don’t worry man, it’s only a sign of someone doing work, I can’t have any problem with that ;)

@yas375
Copy link
Contributor

yas375 commented Mar 23, 2012

cool feature!

thank you, @irrationalfab =)

P.S. I like --stat param name) And sorry for delay with reply: I don't have much free time at work((

@fabiopelosin
Copy link
Member Author

cool feature!

Hahah.. thanks, but you share part of the credit as it was inspired by your changes.

I like --stat param name

Actually it is --stats as suggested by alloy, however I was undecided wether to use the plural or not. Any opinion about that?

@alloy
Copy link
Member

alloy commented Mar 23, 2012

According to wikipedia, ‘stats’ is the more often used form for ‘statistics’ in British English contexts.

Statistics are: ( used with a plural verb ) the numerical facts or data themselves..

So --stats means: ‘shows statistics’.

For some unknown reason I find British English more charming :)

@fabiopelosin
Copy link
Member Author

Such a great explanation would convince even this guy.

@alloy
Copy link
Member

alloy commented Mar 23, 2012

Note that I could very well be wrong, though ;) English is not my native language.

@yas375
Copy link
Contributor

yas375 commented Mar 23, 2012

@irrationalfab something went wrong on showing stats for ASIWebPageRequest.

➜  CocoaPods git:(master) ./bin/pod search --stats asiweb
--> ASIWebPageRequest (1.8.1)
    The ASIWebPageRequest class included with ASIHTTPRequest lets you download
        complete webpages, including external resources like images and stylesheets.
    - Homepage: http://allseeing-i.com/ASIHTTPRequest/ASIWebPageRequest
/Users/yas/code/CocoaPods/lib/cocoapods/command/error_report.rb:38:in `report': undefined method `read' for nil:NilClass (NoMethodError)
    from /Users/yas/code/CocoaPods/lib/cocoapods/command.rb:62:in `rescue in run'
    from /Users/yas/code/CocoaPods/lib/cocoapods/command.rb:54:in `run'
    from ./bin/pod:11:in `<main>'

I will fix in a minute error with undefined method in error_report. But last error occur on creating nice error report and there are problem in lib/cocoapods/command.rb:62 (

cool feature!

Hahah.. thanks, but you share part of the credit as it was inspired by your changes.

I talked about colored output and repo stats)

yas375 added a commit that referenced this issue Mar 23, 2012
I run pod search not from directory with xcode project and it there was
an error with reading podfile. Than I added check for existence of
podfile. [#177]
@yas375
Copy link
Contributor

yas375 commented Mar 23, 2012

here is details of problem mentioned in my previous post:

➜  CocoaPods git:(master) ./bin/pod search --stats asiweb
--> ASIWebPageRequest (1.8.1)
    The ASIWebPageRequest class included with ASIHTTPRequest lets you download
        complete webpages, including external resources like images and stylesheets.
    - Homepage: http://allseeing-i.com/ASIHTTPRequest/ASIWebPageRequest
Oh no, an error occurred. 

Search for existing github issues similar to yours:

  https://github.com/CocoaPods/CocoaPods/issues/search?q=%22undefined+method+%60match%27+for+nil%3ANilClass%22

If none exists, create a ticket with the following information to:

  https://github.com/CocoaPods/CocoaPods/issues/new

Don't forget to anonymize any private data!


### Stack

* Host version: Mac OS X 10.7.3 (11D50)
* Xcode version: 4.3.2 (4E2002)
* Ruby version: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
* Ruby lib dir: /Users/yas/.rvm/rubies/ruby-1.9.3-p125/lib
* RubyGems version: 1.8.19
* CocoaPods version: 0.5.1
* Specification repositories:
  - master - git://github.com/CocoaPods/Specs.git @ 2799f8dcb3285134fa27d84ae8dc1e902717c367


### Podfile

```ruby

```


### Error

```
undefined method `match' for nil:NilClass
  /Users/yas/code/CocoaPods/lib/cocoapods/command/search.rb:57:in `puts_github_info'
  /Users/yas/code/CocoaPods/lib/cocoapods/command/search.rb:36:in `block in run'
  /Users/yas/code/CocoaPods/lib/cocoapods/command/search.rb:29:in `each'
  /Users/yas/code/CocoaPods/lib/cocoapods/command/search.rb:29:in `run'
  /Users/yas/code/CocoaPods/lib/cocoapods/command.rb:56:in `run'
  ./bin/pod:11:in `<main>'
```

@yas375 yas375 reopened this Mar 23, 2012
@alloy alloy closed this as completed in 745ca34 Mar 24, 2012
kommen pushed a commit to kommen/CocoaPods that referenced this issue Apr 4, 2012
* origin:
  Erroneously deleted + on self.options
  [CocoaPods#177] @alloy's suggestions
  Revert .git behaviour and refactoring
  [fix] Support for dashes in GitHub repo and author
  [CocoaPods#177] Fix for GitHub repos missing final .git in the source
  [CocoaPods#177] Added --extended option
  Tweaks to regex and coloring
  [CocoaPods#177] Search command improvements

* master:
fabiopelosin added a commit that referenced this issue Oct 25, 2014
- colors
- description wrap
- GitHub watchers and followers
fabiopelosin added a commit that referenced this issue Oct 25, 2014
fabiopelosin added a commit that referenced this issue Oct 25, 2014
yas375 added a commit that referenced this issue Oct 25, 2014
I run pod search not from directory with xcode project and it there was
an error with reading podfile. Than I added check for existence of
podfile. [#177]
amorde pushed a commit that referenced this issue Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants