Permalink
Commits on Oct 21, 2015
  1. Move ruby gem not found message in i18n

    JuanitoFatas committed Oct 21, 2015
    so we don’t have to repeat
Commits on Oct 20, 2015
  1. Consistent API error message when a rubygem cannot be found (anymore)

    JuanitoFatas committed Oct 20, 2015
    This Pull Request changes the error message of `api/v1/rubygems_controller.rb` to provide a consistent error message for https://rubygems.org users.
    
    Why?
    
    When a gem cannot be found, the current codebase has two kinds of error messages:
    
    - `"This rubygem could not be found"`
    - `"This gem does not exist."`
    
    Here are the places use `"This rubygem could not be found"` error message before this Pull Request:
    
    [app/controllers/api/v1/downloads_controller#L21](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/downloads_controller.rb#L21)
    [app/controllers/api/v1/versions/downloads_controller.rb#L10](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/versions/downloads_controller.rb#L10)
    [app/controllers/api/v1/versions/downloads_controller.rb#L26](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/versions/downloads_controller.rb#L26)
    [app/controllers/api/v1/versions_controller.rb#L13](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/versions_controller.rb#L13)
    [app/controllers/api/v1/application_controller.rb#L53](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/application_controller.rb#L53)
    
    And here are the places use `"This gem does not exist."`:
    
    [app/controllers/api/v1/deletions_controller.rb#L30](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/deletions_controller.rb#L30)
    [app/controllers/api/v1/rubygems_controller.rb#L23](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/rubygems_controller.rb#L23)
    
    I recently met a bug with this error message: `"This gem does not exist."`.
    
    Here is the case:
    
    This gem [rails-assets-angular](https://rubygems.org/gems/rails-assets-angular) used to host on https://rubygems.org but [yanked](tenex/rails-assets#220).
    
    I use [GEM METHODS](http://guides.rubygems.org/rubygems-org-api/#gem-methods) endpoint to get information of this gem. So when I hit this endpoint, the code will first execute [this before action](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/application_controller.rb#L48-L59) to [find given ruby gem](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/rubygems_controller.rb#L6), and because it used to host on https://rubygems.org, so no problems.
    
    It then executes [Api::V1::RubygemsController#show line 1](https://github.com/rubygems/rubygems.org/blob/f55fb1/app/controllers/api/v1/rubygems_controller.rb#L17) and it failed the check:
    
    ```ruby
    if @rubygem.hosted? && @rubygem.public_versions.indexed.count.nonzero?
    ```
    
    Because it no longer hosted on https://rubygems.org. It then renders `"This gem does not exist."`.
    
    I originally play with the API, when it cannot found a gem, it will return `"This rubygem could not be found"`. I was thinking this is the only kind of error message when a rubygem cannot be found.
    
    So I think we should provide a consistent gem not found message.
  2. Translate Chinese footer services

    JuanitoFatas committed Oct 20, 2015
Commits on Oct 18, 2015
  1. Link to API on homepage

    JuanitoFatas committed Oct 17, 2015
Commits on Sep 3, 2015
  1. Fix wrong translation of month

    JuanitoFatas committed Sep 3, 2015
Commits on Aug 12, 2015
  1. Use delete instead of gsub from stripping protocol

    JuanitoFatas committed Aug 12, 2015
Commits on Jun 23, 2015
Commits on Mar 5, 2015