zenaton 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/Gemfile.lock +1 -1
- data/lib/zenaton/client.rb +6 -5
- data/lib/zenaton/services/http.rb +2 -1
- data/lib/zenaton/traits/with_timestamp.rb +4 -4
- data/lib/zenaton/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5cce9b70fd66d65689088c10c1d83006828eb43b46cd3dbb4be204a71cea03e
|
4
|
+
data.tar.gz: 472e812fd74694cec984751063ee6bd45101427b624fb5e682cc878e3f819f64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d11faf842c2d97c1eb3332acb62f6a0e948fa45bbfbb21cd97c976a9f1d5201281f35799c81f36e90b5ad1785e2a16a7ff9bb9117b022ac0815d544710348ae
|
7
|
+
data.tar.gz: 1f080e9eeacd16d09c7b87dfbfbdb846c70fb573990e4721c084be4ec41a5a735b1f6efeb1eae9d332aa63db0765bda7f7443f1a5fae2c7d346d5760d53c32ef
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.3.0] - 2018-09-24
|
10
|
+
### Changed
|
11
|
+
- Rename `on_day` method to `day_of_month`
|
12
|
+
- Improve error messages by using the message contained in the API response when
|
13
|
+
available.
|
14
|
+
- Rescue from new engine error when finding non existing workflow
|
15
|
+
|
9
16
|
## [0.2.3] - 2018-08-13
|
10
17
|
### Added
|
11
18
|
- Introduce this changelog file.
|
@@ -47,7 +54,8 @@ serializing.
|
|
47
54
|
### Added
|
48
55
|
- Initial release.
|
49
56
|
|
50
|
-
[Unreleased]: https://github.com/zenaton/zenaton-ruby/compare/v0.
|
57
|
+
[Unreleased]: https://github.com/zenaton/zenaton-ruby/compare/v0.3.0...HEAD
|
58
|
+
[0.3.0]: https://github.com/zenaton/zenaton-ruby/compare/v0.2.3...v0.3.0
|
51
59
|
[0.2.3]: https://github.com/zenaton/zenaton-ruby/compare/v0.2.2...v0.2.3
|
52
60
|
[0.2.2]: https://github.com/zenaton/zenaton-ruby/compare/v0.2.1...v0.2.2
|
53
61
|
[0.2.1]: https://github.com/zenaton/zenaton-ruby/compare/v0.2.0...v0.2.1
|
data/Gemfile.lock
CHANGED
data/lib/zenaton/client.rb
CHANGED
@@ -120,17 +120,18 @@ module Zenaton
|
|
120
120
|
|
121
121
|
# Finds a workflow
|
122
122
|
# @param workflow_name [String] the class name of the workflow
|
123
|
-
# @param custom_id [String] the custom ID of the workflow
|
124
|
-
# @return [Zenaton::Interfaces::Workflow]
|
123
|
+
# @param custom_id [String] the custom ID of the workflow
|
124
|
+
# @return [Zenaton::Interfaces::Workflow, nil]
|
125
125
|
def find_workflow(workflow_name, custom_id)
|
126
|
-
# rubocop:disable Metrics/LineLength
|
127
|
-
params = "#{ATTR_ID}=#{custom_id}&#{ATTR_NAME}=#{workflow_name}&#{ATTR_PROG}=#{PROG}"
|
128
|
-
# rubocop:enable Metrics/LineLength
|
126
|
+
params = "#{ATTR_ID}=#{custom_id}&#{ATTR_NAME}=#{workflow_name}&#{ATTR_PROG}=#{PROG}" # rubocop:disable Metrics/LineLength
|
129
127
|
data = @http.get(instance_website_url(params))['data']
|
130
128
|
data && @properties.object_from(
|
131
129
|
data['name'],
|
132
130
|
@serializer.decode(data['properties'])
|
133
131
|
)
|
132
|
+
rescue Zenaton::InternalError => exception
|
133
|
+
return nil if exception.message =~ /No workflow instance found/
|
134
|
+
raise exception
|
134
135
|
end
|
135
136
|
|
136
137
|
# Sends an event to a workflow
|
@@ -37,7 +37,7 @@ module Zenaton
|
|
37
37
|
end
|
38
38
|
|
39
39
|
%i[
|
40
|
-
timestamp at
|
40
|
+
timestamp at day_of_month monday tuesday wednesday thursday
|
41
41
|
friday saturday sunday
|
42
42
|
]. each do |method_name|
|
43
43
|
define_method method_name do |value = 1|
|
@@ -56,8 +56,8 @@ module Zenaton
|
|
56
56
|
_timestamp(value)
|
57
57
|
elsif method == :at
|
58
58
|
_at(value, now, now_dup)
|
59
|
-
elsif method == :
|
60
|
-
|
59
|
+
elsif method == :day_of_month
|
60
|
+
_day_of_month(value, now, now_dup)
|
61
61
|
else
|
62
62
|
_apply_duration(method, value, now_dup)
|
63
63
|
end
|
@@ -96,7 +96,7 @@ module Zenaton
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
def
|
99
|
+
def _day_of_month(day, now, now_dup)
|
100
100
|
_set_mode(MODE_MONTH_DAY)
|
101
101
|
now_dup = now_dup.change(day: day)
|
102
102
|
now_dup += 1.month if now > now_dup
|
data/lib/zenaton/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zenaton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zenaton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|