Improved search #177

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

Comments

Projects
None yet
3 participants
@fabiopelosin
Member

fabiopelosin commented Mar 19, 2012

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

This comment has been minimized.

Show comment Hide comment
@yas375

yas375 Mar 19, 2012

Contributor

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?

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

[#177] Search command improvements
- colors
- description wrap
- GitHub watchers and followers
@alloy

This comment has been minimized.

Show comment Hide comment
@alloy

alloy Mar 23, 2012

Member

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.

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

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin Mar 23, 2012

Member

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

Member

fabiopelosin commented Mar 23, 2012

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

@alloy

This comment has been minimized.

Show comment Hide comment
@alloy

alloy Mar 23, 2012

Member

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

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

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin Mar 23, 2012

Member

@alloy this is a much cleaner approach.

Member

fabiopelosin commented Mar 23, 2012

@alloy this is a much cleaner approach.

@fabiopelosin

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin Mar 23, 2012

Member

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

Member

fabiopelosin commented Mar 23, 2012

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

@alloy

This comment has been minimized.

Show comment Hide comment
@alloy

alloy Mar 23, 2012

Member

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 ;)

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

This comment has been minimized.

Show comment Hide comment
@yas375

yas375 Mar 23, 2012

Contributor

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((

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

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin Mar 23, 2012

Member

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?

Member

fabiopelosin commented Mar 23, 2012

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

This comment has been minimized.

Show comment Hide comment
@alloy

alloy Mar 23, 2012

Member

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 :)

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

This comment has been minimized.

Show comment Hide comment
@fabiopelosin

fabiopelosin Mar 23, 2012

Member

Such a great explanation would convince even this guy.

Member

fabiopelosin commented Mar 23, 2012

Such a great explanation would convince even this guy.

@alloy

This comment has been minimized.

Show comment Hide comment
@alloy

alloy Mar 23, 2012

Member

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

Member

alloy commented Mar 23, 2012

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

@yas375

This comment has been minimized.

Show comment Hide comment
@yas375

yas375 Mar 23, 2012

Contributor

@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)

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

fix creating error report when pod was ran not from project dir
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

This comment has been minimized.

Show comment Hide comment
@yas375

yas375 Mar 23, 2012

Contributor

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>'
```
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 in 745ca34 Mar 24, 2012

kommen pushed a commit to kommen/CocoaPods that referenced this issue Apr 4, 2012

Merge branch 'master', remote-tracking branch 'origin'
* origin:
  Erroneously deleted + on self.options
  [#177] @alloy's suggestions
  Revert .git behaviour and refactoring
  [fix] Support for dashes in GitHub repo and author
  [#177] Fix for GitHub repos missing final .git in the source
  [#177] Added --extended option
  Tweaks to regex and coloring
  [#177] Search command improvements

* master:

fabiopelosin added a commit that referenced this issue Oct 25, 2014

[#177] Search command improvements
- 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

fix creating error report when pod was ran not from project dir
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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment