xronor 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a84f15e3c030dbd392186868300feda765110d43
4
- data.tar.gz: 8518a06f03ad8497b974ec905675514a0640fbe4
3
+ metadata.gz: 0e2bebda2a6ecdc3f00b13174c1c6e50656902de
4
+ data.tar.gz: f0a8ffff76c41b6b5829ea2fae41aa2c6b56b280
5
5
  SHA512:
6
- metadata.gz: 69c07bc4a9d62ece7df82fae1176b382a2960e12aecbe16ff7dc07506bc08efb312dbc4c3833d284cba1c585d6ecb56fac999f03bfa5fa597203eae2776a2ecb
7
- data.tar.gz: 40946a172b8f3a384256237f3a15085e9836eb5648fbe09377a6b12d6c05a6b0f539c375bbc2f6df5e2ef469a19611d8d8949c6e9f6ff744258d01c098509085
6
+ metadata.gz: bf298ad2554461fcac63119dd5c7d6fb6399233f2627ff216fcfdccded67aeeccaf4b3884fd0e29d6d2c0cf876c1e9fe35b77050656331173326edf1db980d0a
7
+ data.tar.gz: 121aa259aee3fc77d7cdac1a17d983a4b79b9d6eb152c8c00756aa77dbad646995a2566a15fc84e1b3716cee1864ebc8c43ff2a70b4c11c3ab56a745625f8ec9
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- # [v0.1.1](https://github.com/dtan4/xronor/releases/tag/v0.1.0) (2017-03-24)
1
+ # [v0.1.2](https://github.com/dtan4/xronor/releases/tag/v0.1.2) (2017-03-28)
2
+
3
+ ## Updated
4
+
5
+ - Add helper method `Job#k8s_pod_name` [#15](https://github.com/dtan4/xronor/pull/15)
6
+ - Normalize generated file names [#14](https://github.com/dtan4/xronor/pull/14)
7
+
8
+ # [v0.1.1](https://github.com/dtan4/xronor/releases/tag/v0.1.1) (2017-03-24)
2
9
 
3
10
  ## Fixed
4
11
 
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/dtan4/xronor.svg?branch=master)](https://travis-ci.org/dtan4/xronor)
4
4
  [![codecov](https://codecov.io/gh/dtan4/xronor/branch/master/graph/badge.svg)](https://codecov.io/gh/dtan4/xronor)
5
+ [![Gem Version](https://badge.fury.io/rb/xronor.svg)](https://badge.fury.io/rb/xronor)
6
+ [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
5
7
 
6
8
  Timezone-aware Job Scheduler DSL and Converter
7
9
 
@@ -48,6 +50,7 @@ end
48
50
  * [Scheduled job execution system](#scheduled-job-execution-system)
49
51
  * [Scheduler DSL](#scheduler-dsl)
50
52
  * [:point_right:](#point_right)
53
+ - [Requirements](#requirements)
51
54
  - [Installation](#installation)
52
55
  - [Usage](#usage)
53
56
  - [Xronor DSL](#xronor-dsl)
@@ -82,6 +85,9 @@ To resolve above problems, we need:
82
85
  - Just like an enhance of Whenever
83
86
  - a DSL converter which is easy to register CloudWatch Events rule
84
87
 
88
+ ## Requirements
89
+
90
+ Ruby 2.2.2 or above
85
91
 
86
92
  ## Installation
87
93
 
data/docs/dsl.md CHANGED
@@ -130,6 +130,16 @@ default do
130
130
  end
131
131
  ```
132
132
 
133
+ :warning: __NOTE:__ If the specified timezone has DST, generated crontab expression may differ depending on the date you executed Xronor converter.
134
+ For example, `every :day, at: 10:30 am` in `Europe/Berlin` will be converted as
135
+
136
+ - `30 9 * * *` if you execute Xronor converter from the last Sunday of October to the last Sunday of March
137
+ - `30 8 * * *` if you execute Xronor converter during other period
138
+
139
+ This difference is derived from [Central European Summer Time (CEST)](https://en.wikipedia.org/wiki/Central_European_Summer_Time).
140
+
141
+ To avoid this, please specify _the difference from GMT_, like `Etc/GMT-2` (equal to `UTC+2`).
142
+
133
143
  ## Job definition
134
144
 
135
145
  ```ruby
@@ -162,12 +172,13 @@ Available `<options>`:
162
172
  |key|description|
163
173
  |---|---|
164
174
  |`at`|Invocation time|
165
- |`timezone`|Timezone of described time in DSL|
166
- |`cron_timezone`|Timezone of the machine where schedule engine runs|
175
+ |`timezone`|Timezone of described time in DSL. This overrides default `timezone` value.|
176
+ |`cron_timezone`|Timezone of the machine where schedule engine runs. This overrides default `cron_timezone` value.|
167
177
 
168
178
  ### `name` (Required)
169
179
 
170
- Define job name
180
+ Define job name.
181
+ Job name must contain alphabets, numbers, hyphen (`-`), underscore (`_`) and period (`.`) only.
171
182
 
172
183
  ### `description`
173
184
 
@@ -14,7 +14,7 @@ module Xronor
14
14
 
15
15
  jobs.inject({}) do |result, job|
16
16
  @job = job
17
- result[job.name.gsub(/[^\.\-_A-Za-z0-9]/, "_").downcase] = ::ERB.new(erb, nil, "-").result(binding)
17
+ result[job.name.gsub(/[^\.\-A-Za-z0-9]/, "-").downcase] = ::ERB.new(erb, nil, "-").result(binding)
18
18
  result
19
19
  end
20
20
  end
data/lib/xronor/job.rb CHANGED
@@ -3,6 +3,8 @@ module Xronor
3
3
  DOM_INDEX = 2
4
4
  DOW_INDEX = 4
5
5
 
6
+ POD_NAME_MAX_LENGTH = 253
7
+
6
8
  def initialize(name, description, schedule, command)
7
9
  @name = name
8
10
  @description = description
@@ -35,6 +37,10 @@ module Xronor
35
37
  "#{prefix}#{@name}-#{hashcode}".gsub(/[^\.\-_A-Za-z0-9]/, "-").downcase
36
38
  end
37
39
 
40
+ def k8s_pod_name
41
+ @name.gsub(/[^\.\-A-Za-z0-9]/, "-").downcase[0...POD_NAME_MAX_LENGTH]
42
+ end
43
+
38
44
  private
39
45
 
40
46
  def hashcode
@@ -1,3 +1,3 @@
1
1
  module Xronor
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xronor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Fujita
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport