Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install twingly-url_cache
Initialize an instance, cache an URL with
#cache! and look if it's cached with
 pry(main)> cache = Twingly::UrlCache.new => #<Twingly::UrlCache:0x007fd58c96b978 ...>  pry(main)> cache.cache!("http://www.twingly.com/") => true  pry(main)> cache.cached?("http://www.twingly.com/") => true  pry(main)> cache.cached?("http://blog.twingly.com/") => false
Optional environment variables:
MEMCACHIER_SERVERS # Defaults to localhost MEMCACHIER_PASSWORD MEMCACHIER_USERNAME
After checking out the repo, run
bin/setup to install dependencies. Start memcached. Then, run
bundle exec rake to run the tests. You can also run
bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run
bundle exec rake install.
Update the examples in this README if needed.
Bump the version in
lib/twingly/url_cache/version.rbin a commit, no need to push (the release task does that).
Ensure you are signed in to RubyGems.org as twingly with
Build and publish the gem. This will create the proper tag in git, push the commit and tag and upload to RubyGems.
bundle exec rake release
Update the changelog with GitHub Changelog Generator (
gem install github_changelog_generatorif you don't have it, set
CHANGELOG_GITHUB_TOKENto a personal access token to avoid rate limiting by GitHub). This command will update
CHANGELOG.md. You need to commit and push manually.
github_changelog_generator -u twingly -p twingly-url_cache
Bug reports and pull requests are welcome on GitHub at https://github.com/twingly/twingly-url_cache.