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

DRAFT: Adds web command #1

Closed
wants to merge 25 commits into from
Closed

DRAFT: Adds web command #1

wants to merge 25 commits into from

Conversation

MatheusRich
Copy link
Owner

@MatheusRich MatheusRich commented Jun 11, 2019

Description:

Closes rubygems#2784.

Ruby claims to be "a programmer's best friend", and focus on "simplicity and productivity". As rubygems is now part of Ruby, I think it should follow those principles too.

I'm integrating gem-web into rubygems as part of GSoC 2019. This new command allows user to quickly find documentation of a gem.

I think this is specially good when one's not sure about what a gem does, or is confused with its name. Maybe the user wants to quickly check the rubygems' page of some gem (to check versions, dependencies, etc). With this command the access will be faster and easier with just one command on the terminal. Other use case could be opening the documentation for a gem, which improves productivity.

The usage would be like this:

gem web rails # Opens github
Options:
  -g, --github                     Open GitHub page of gem, this searches all urls for a GitHub page. This is the default.
  -c, --sourcecode                 Open sourcecode gem
  -d, --doc                        Open documentation of gem
  -w, --webpage                    Open webpage of gem
  -t, --rubytoolbox                Open the rubytoolbox page for that gem
  -r, --rubygems                   Open the rubygems page for that gem

Let me hear some feedback about this.

Platforms manually tested:

  • aix
  • cygwin
  • darwin
  • macruby
  • freebsd
  • hpux
  • java
  • dalvik
  • dotnet
  • linux
  • mingw32
  • netbsdelf
  • openbsd
  • bitrig
  • solaris

Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

Copy link

@zoras zoras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍
Do make sure to add opener command for all supported OS.
Platform is already detected/known from here: https://github.com/rubygems/rubygems/blob/master/lib/rubygems/platform.rb#L79

lib/rubygems/executor.rb Outdated Show resolved Hide resolved
lib/rubygems/executor.rb Outdated Show resolved Hide resolved
Copy link

@zoras zoras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Matheus. It would be great if we could do QA test on the various supported platforms as well as unsupported ones. Maybe you can try it out for various OS with VirtualBox?

Now this command uses the BROWSER env variable to open links. If it is unset, the command just outputs the URL
@MatheusRich MatheusRich changed the title Adds web command DRAFT: Adds web command Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants