aws_cron 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +40 -11
- data/lib/aws_cron/identity.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e27104d0b2a0ec1698327f6b41a7af179770b3b6
|
4
|
+
data.tar.gz: 2e5ebe6f3633a7f7eb7b5b03a988a9e2ee1c0ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1252104291260f1c91a8d8318a8d238e6c194daaee75f9d045bf56786f6edff156ef350beff2842eae30b7203c233eb4258d26030e606107401204a8604d333f
|
7
|
+
data.tar.gz: 46b0aef02dc3d2fc892fd174ca74b4528ccc96122ad84ff85c27522d876a0911d70672369582f06c7e9edb0d8d6199538ce8be8e5433f87d2e7e3910402aa9ef
|
data/README.md
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
# AwsCron
|
2
2
|
|
3
|
-
[](https://circleci.com/gh/wealthsimple/aws_cron) [](https://codeclimate.com/github/wealthsimple/aws_cron) [](http://badge.fury.io/rb/aws_cron)
|
4
4
|
|
5
5
|
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
6
6
|
|
7
7
|
# Table of Contents
|
8
8
|
|
9
9
|
- [Features](#features)
|
10
|
-
- [
|
10
|
+
- [Examples](#examples)
|
11
11
|
- [Requirements](#requirements)
|
12
12
|
- [Setup](#setup)
|
13
|
-
- [Usage](#usage)
|
14
13
|
- [Tests](#tests)
|
15
14
|
- [Versioning](#versioning)
|
16
15
|
- [Code of Conduct](#code-of-conduct)
|
@@ -23,11 +22,43 @@
|
|
23
22
|
|
24
23
|
# Features
|
25
24
|
|
26
|
-
#
|
25
|
+
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).
|
26
|
+
* Handles HTTP responses, even in case of exceptions
|
27
|
+
* Reliable error logging, using your preferred logger
|
28
|
+
* Timezone-aware cron scheduling
|
29
|
+
* AWS only allows UTC scheduling. AwsCron helps you use your desired timezone instead.
|
30
|
+
|
31
|
+
## Examples
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
class MyAwsControllerResponsibleForCronCalls
|
35
|
+
include AwsCron::Controller
|
36
|
+
|
37
|
+
def foo_endpoint
|
38
|
+
run { GenericTask.run }
|
39
|
+
end
|
40
|
+
|
41
|
+
def timezoned_9am_endpoint
|
42
|
+
run_in_tz '0 9 * * *' do
|
43
|
+
TimezoneSpecific9AMTask.run
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
protected
|
48
|
+
|
49
|
+
def time_provider # This is the default timezone for all `run_in_tz` calls
|
50
|
+
ActiveSupport::TimeZone.new('America/New_York')
|
51
|
+
end
|
52
|
+
|
53
|
+
def return_object # AWS Scheduler always expects ok, even in case of errors
|
54
|
+
render :json => {message: 'ok'}
|
55
|
+
end
|
56
|
+
end
|
57
|
+
```
|
27
58
|
|
28
59
|
# Requirements
|
29
60
|
|
30
|
-
0. [Ruby 2.3.
|
61
|
+
0. [Ruby 2.3.0](https://www.ruby-lang.org)
|
31
62
|
|
32
63
|
# Setup
|
33
64
|
|
@@ -48,8 +79,6 @@ Add the following to your Gemfile:
|
|
48
79
|
|
49
80
|
gem "aws_cron"
|
50
81
|
|
51
|
-
# Usage
|
52
|
-
|
53
82
|
# Tests
|
54
83
|
|
55
84
|
To test, run:
|
@@ -75,8 +104,9 @@ Read [CONTRIBUTING](CONTRIBUTING.md) for details.
|
|
75
104
|
|
76
105
|
# License
|
77
106
|
|
78
|
-
|
79
|
-
|
107
|
+
[MIT License](LICENSE.md)
|
108
|
+
|
109
|
+
Copyright (c) 2016 [Wealthsimple](https://wealthsimple.com).
|
80
110
|
|
81
111
|
# History
|
82
112
|
|
@@ -85,5 +115,4 @@ Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
|
85
115
|
|
86
116
|
# Credits
|
87
117
|
|
88
|
-
Developed by [Marco Costa]() at
|
89
|
-
[]().
|
118
|
+
Developed by [Marco Costa](http://marcotc.com) at [Wealthsimple](https://wealthsimple.com).
|
data/lib/aws_cron/identity.rb
CHANGED
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_cron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: parse-cron
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.1.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.1.4
|
41
41
|
- !ruby/object:Gem::Dependency
|