Skip to content

A Crystal client for FOAAS - a modern, RESTful, scalable solution to the common problem of telling people to fuck off

License

Notifications You must be signed in to change notification settings

mamantoha/foaas_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FOAAS Client

Crystal CI Docs

A Crystal client for FOAAS(Fuck Off As A Service) - a modern, RESTful, scalable solution to the common problem of telling people to fuck off.

This library was writter to demonstrate a powerful macro system in Crystal.

Installation

Add this to your application's shard.yml:

dependencies:
  foaas_client:
    github: mamantoha/foaas_client

API Version

Version 2.3.2 of the FOAAS API is supported.

Usage

require "foaas_client"

client = Foaas::Client.new

client.rtfm("Me")
# => Read the fucking manual! - Me

client.awesome("You", accept_type: :text)
# => This is Fucking Awesome. - You

client.you("Nvidia", "Linus Torvalds", accept_type: :text)
# => Fuck you, Nvidia. - Linus Torvalds

client.dosomething("Do", "work", "Ruby", accept_type: :text)
# => Do the fucking work! - Ruby

client.awesome("Everyone", accept_type: :json, i18n: "uk")
# => "{\"message\":\"Це, чорт забирай, класно. Усі \",\"subtitle\":\" undefined\"}"

Will respond to the following accept_type values:

  • :text - Content will be returned as a plain string.
  • :json - Content will be returned as a JSON object.
  • :html - Content will be returned as an HTML page with a twitter bootstrap hero unit, containing the message and the subtitle.
  • :xml - Content will be returned as a XML document.

Development

crystal ./utils/generate_operations.cr

Contributing

  1. Fork it ( https://github.com/mamantoha/foaas_client/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • mamantoha Anton Maminov - creator, maintainer

About

A Crystal client for FOAAS - a modern, RESTful, scalable solution to the common problem of telling people to fuck off

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •