Add random quotes to your app effortlessly
How to install
gem install quotify
Then start using it:
You can generate a new quote quickly by calling the
puts Quotify.generate => You must be the change you wish to see in the world. - Logan Paul super_fancy_quote = Quotify.generate puts super_fancy_quote.author => Sarah Palin puts super_fancy_quote.quote => C++ supports OOP
generate returns a
Quotify::Quote object. You can then use your favorite methods on it (
to_json). Currently XML is not supported. If there is a demand, we will consider adding it in the next release.
You can also use the fancy
spacer option in
to_s to create majestic quotes:
Quotify::Quote.new.to_s(spacer: " 🔥 ") => Those were alternative facts 🔥 Soulja Boy
Quotify the quote list and spacer can be updated at runtime using the
Quotify.configure(spacer: ' -OG- ') Quotify.configure(authors: ['Justin', 'Michel']) ... Quotify.reset_config # returns to default configurations
You can also load your own config file using
configure_with. Here is an example of a valid config file
Update the quote database
To pull the newest database version with all those spicy quotes, run
quotify update or
quotify u in the terminal.
You can run all the tests with:
bundle exec rake
If you wish to add new quotes, head over to
quotes.yml and do a PR to add new ones. I'll merge pretty much everything for this file (given that it doesn't mess up the yaml).
Since maintaining quotify is my full time job, I need money to pay the bills. Please donate your crypto pocket change to these addresses.
This gem is MIT licensed, please see LICENSE for more information.