README.md in aws_cron-0.1.1 vs README.md in aws_cron-0.1.2

- old
+ new

@@ -1,18 +1,17 @@ # AwsCron -[![CircleCI](https://circleci.com/gh/wealthsimple/aws_cron.svg?style=svg)](https://circleci.com/gh/wealthsimple/aws_cron) [![Gem Version](https://badge.fury.io/rb/aws_cron.svg)](http://badge.fury.io/rb/aws_cron) +[![CircleCI](https://circleci.com/gh/wealthsimple/aws_cron.svg?style=shield)](https://circleci.com/gh/wealthsimple/aws_cron) [![Code Climate](https://codeclimate.com/github/wealthsimple/aws_cron/badges/gpa.svg)](https://codeclimate.com/github/wealthsimple/aws_cron) [![Gem Version](https://badge.fury.io/rb/aws_cron.svg)](http://badge.fury.io/rb/aws_cron) <!-- Tocer[start]: Auto-generated, don't remove. --> # Table of Contents - [Features](#features) -- [Screencasts](#screencasts) + - [Examples](#examples) - [Requirements](#requirements) - [Setup](#setup) -- [Usage](#usage) - [Tests](#tests) - [Versioning](#versioning) - [Code of Conduct](#code-of-conduct) - [Contributions](#contributions) - [License](#license) @@ -21,15 +20,47 @@ <!-- Tocer[finish]: Auto-generated, don't remove. --> # Features -# Screencasts +AwsCron does all the housekeeping related to handling [AWS Elastic Beanstalk Periodic Tasks](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#worker-periodictasks). +* Handles HTTP responses, even in case of exceptions +* Reliable error logging, using your preferred logger +* Timezone-aware cron scheduling + * AWS only allows UTC scheduling. AwsCron helps you use your desired timezone instead. +## Examples + +```ruby +class MyAwsControllerResponsibleForCronCalls + include AwsCron::Controller + + def foo_endpoint + run { GenericTask.run } + end + + def timezoned_9am_endpoint + run_in_tz '0 9 * * *' do + TimezoneSpecific9AMTask.run + end + end + + protected + + def time_provider # This is the default timezone for all `run_in_tz` calls + ActiveSupport::TimeZone.new('America/New_York') + end + + def return_object # AWS Scheduler always expects ok, even in case of errors + render :json => {message: 'ok'} + end +end +``` + # Requirements -0. [Ruby 2.3.1](https://www.ruby-lang.org) +0. [Ruby 2.3.0](https://www.ruby-lang.org) # Setup For a secure install, type the following (recommended): @@ -46,12 +77,10 @@ Add the following to your Gemfile: gem "aws_cron" -# Usage - # Tests To test, run: bundle exec rake @@ -73,17 +102,17 @@ Read [CONTRIBUTING](CONTRIBUTING.md) for details. # License -Copyright (c) 2016 [](). -Read [LICENSE](LICENSE.md) for details. +[MIT License](LICENSE.md) +Copyright (c) 2016 [Wealthsimple](https://wealthsimple.com). + # History Read [CHANGES](CHANGES.md) for details. Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith). # Credits -Developed by [Marco Costa]() at -[](). +Developed by [Marco Costa](http://marcotc.com) at [Wealthsimple](https://wealthsimple.com).