Skip to content

🤷‍♂️ An API for lazy coders’ excuses

License

Notifications You must be signed in to change notification settings

michelegera/devexcuses-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devexcuses-api

Build status

What’s your excuse?

devexcuses-api provides a modern, RESTful, scalable solution to developers’ common problem of finding an excuse to justify their sloppy work.

Visit https://api.devexcus.es/ to get your random excuse!

Translations

The API is currently available in the following languages:

  • English (default)
  • French

To get a random excuse in a specific language, use a locale query parameter:

curl "https://api.devexcus.es/?locale=fr"

Installation

bundle install

# SSL support in development, defaults to port 9292
brew install mkcert
brew install nss
mkcert -install
mkcert localhost

Run

rails server

Test

bundle exec rspec

Contributing

To add new excuses:

  1. Fork the repository into your account

  2. Branch into a feature branch feature/your-excuse

  3. Add excuses at the bottom of data/excuses.yml using the following format:

    - id: 55
      text_en: "I’m not getting any error codes."
      # …
  4. Push to your fork and submit a PR.

To add a new language:

  1. Fork the repository into your account

  2. Branch into a feature branch, e.g. i8n/it

  3. Add a new locale in config/application.rb

    config.i18n.available_locales = %i[en fr it]
  4. Add translated excuses in data/excuses.yml using the following format:

    - id: 55
      text_en: "I’m not getting any error codes."
      # …
      text_it: "Non ricevo alcun codice di errore."
  5. Edit models/excuse.rb to add a field for the new language:

    field :text_it
  6. Push to your fork and submit a PR.

All contributions are very welcome.

About

🤷‍♂️ An API for lazy coders’ excuses

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •