zenaton 0.5.0 → 0.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 987a8312a73e5b97d12089a115fcfa4cb15876c019dbc671377ea1a8129e024f
4
- data.tar.gz: 9cff61f323b485d832b95d00e3c4d90874966690f334a9f652c3fa41c749b24d
3
+ metadata.gz: bb9ef09f9315adb9ec1cf8e3f7f5911211b6f76f2e2d15e7eab58da614d51432
4
+ data.tar.gz: 11e1db84bbc2ea13f23f1f4a51c2025ac38f1e55b486f7aa70efc3675a91c005
5
5
  SHA512:
6
- metadata.gz: 3482971a72f81d455dd6ff780ed421dbc4f4033d7e45a2b5334ef3da2592d2a983700b6750575147169db0ca94a59d02042742391e654f45e44ddc5a1960b8be
7
- data.tar.gz: 8eca6ac2710232efcb022421fd7f20a9ba64e97716ca2dcc819f6effca6d144403b0941e688ef96ff91d0ea30663911b7c3b223b5ea51a4a8cd237ff9d85fe22
6
+ metadata.gz: 05c36ae6d37a80f6684efa1627e8ec0cda9adc43d07d66de438d2535ce0fd67d9117cdf2de97d759ddf1c852a5806c5f7f6734f684677d53efa0166c323b99e0
7
+ data.tar.gz: c3ea805cbbc2b2532bb61f4f4f8042182da6c024bbe97214720e1347f7a2b1f6f85363b5dca9b7c0d2a99c2a3f7957289fc9e9a796615804aa820e69da161628
data/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
11
11
 
12
12
  ### Fixed
13
13
 
14
+ ## [0.5.1] - 2019-09-18
15
+ ### Added
16
+
17
+ - Added missing documentation for serialization.
18
+ - Added `custom_id` argument for workflow schedule.
19
+
14
20
  ## [0.5.0] - 2019-08-27
15
21
  ### Changes
16
22
  - No longer load JSON core extensions. Use our own refinements to avoid clashes
@@ -111,7 +117,8 @@ available.
111
117
  ### Added
112
118
  - Initial release.
113
119
 
114
- [Unreleased]: https://github.com/zenaton/zenaton-ruby/compare/v0.5.0...HEAD
120
+ [Unreleased]: https://github.com/zenaton/zenaton-ruby/compare/v0.5.1...HEAD
121
+ [0.5.1]: https://github.com/zenaton/zenaton-ruby/compare/v0.5.0...v0.5.1
115
122
  [0.5.0]: https://github.com/zenaton/zenaton-ruby/compare/v0.4.2...v0.5.0
116
123
  [0.4.2]: https://github.com/zenaton/zenaton-ruby/compare/v0.4.1...v0.4.2
117
124
  [0.4.1]: https://github.com/zenaton/zenaton-ruby/compare/v0.4.0...v0.4.1
data/Gemfile.lock CHANGED
@@ -1,18 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zenaton (0.5.0)
4
+ zenaton (0.5.1)
5
5
  activesupport
6
6
  tzinfo-data
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (5.2.3)
11
+ activesupport (6.0.0)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 0.7, < 2)
14
14
  minitest (~> 5.1)
15
15
  tzinfo (~> 1.1)
16
+ zeitwerk (~> 2.1, >= 2.1.8)
16
17
  addressable (2.6.0)
17
18
  public_suffix (>= 2.0.2, < 4.0)
18
19
  appraisal (2.2.0)
@@ -88,6 +89,7 @@ GEM
88
89
  addressable (>= 2.3.6)
89
90
  crack (>= 0.3.2)
90
91
  hashdiff (>= 0.4.0, < 2.0.0)
92
+ zeitwerk (2.1.9)
91
93
 
92
94
  PLATFORMS
93
95
  ruby
@@ -166,6 +166,7 @@ module Zenaton
166
166
  'intentId' => SecureRandom.uuid,
167
167
  'environmentName' => @app_env,
168
168
  'cron' => cron,
169
+ 'customId' => parse_custom_id_from(flow),
169
170
  'workflowName' => class_name(flow),
170
171
  'canonicalName' => canonical_name(flow) || class_name(flow),
171
172
  'programmingLanguage' => PROG.upcase,
@@ -8,6 +8,7 @@ module Zenaton
8
8
  # :nodoc
9
9
  module Refinements
10
10
  refine BigDecimal do
11
+ # Convert to a simple hash
11
12
  def to_zenaton
12
13
  {
13
14
  'b' => _dump
@@ -19,6 +20,7 @@ end
19
20
 
20
21
  # Reimplements `json/add/bigdecimal`
21
22
  class BigDecimal
23
+ # Parse from simple hash
22
24
  def self.from_zenaton(props)
23
25
  BigDecimal._load props['b']
24
26
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Class do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  {
9
10
  'n' => name
@@ -15,6 +16,7 @@ end
15
16
 
16
17
  # Load an instance of class from zenaton properties
17
18
  class Class
19
+ # Parse from simple hash
18
20
  def self.from_zenaton(props)
19
21
  Object.const_get(props['n'])
20
22
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Complex do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  {
9
10
  'r' => real,
@@ -16,6 +17,7 @@ end
16
17
 
17
18
  # Reimplements `json/add/complex`
18
19
  class Complex
20
+ # Parse from simple hash
19
21
  def self.from_zenaton(props)
20
22
  Complex(props['r'], props['i'])
21
23
  end
@@ -6,6 +6,7 @@ module Zenaton
6
6
  # :nodoc
7
7
  module Refinements
8
8
  refine Date do
9
+ # Convert to a simple hash
9
10
  def to_zenaton
10
11
  {
11
12
  'y' => year,
@@ -20,6 +21,7 @@ end
20
21
 
21
22
  # Reimplements `json/add/date`
22
23
  class Date
24
+ # Parse from simple hash
23
25
  def self.from_zenaton(props)
24
26
  civil(*props.values_at('y', 'm', 'd', 'sg'))
25
27
  end
@@ -6,6 +6,7 @@ module Zenaton
6
6
  # :nodoc
7
7
  module Refinements
8
8
  refine DateTime do
9
+ # Convert to a simple hash
9
10
  def to_zenaton
10
11
  {
11
12
  'y' => year,
@@ -24,6 +25,7 @@ end
24
25
 
25
26
  # Reimplements `json/add/date_time`
26
27
  class DateTime
28
+ # Parse from simple hash
27
29
  def self.from_zenaton(props)
28
30
  args = props.values_at('y', 'm', 'd', 'H', 'M', 'S')
29
31
  of_a, of_b = props['of'].split('/')
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Exception do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  {
9
10
  'm' => message,
@@ -16,6 +17,7 @@ end
16
17
 
17
18
  # Reimplements `json/add/exception`
18
19
  class Exception
20
+ # Parse from simple hash
19
21
  def self.from_zenaton(props)
20
22
  result = new(props['m'])
21
23
  result.set_backtrace props['b']
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Object do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  instance_variables.map do |ivar|
9
10
  value = instance_variable_get(ivar)
@@ -6,6 +6,7 @@ module Zenaton
6
6
  # :nodoc
7
7
  module Refinements
8
8
  refine OpenStruct do
9
+ # Convert to a simple hash
9
10
  def to_zenaton
10
11
  class_name = self.class.name.to_s
11
12
  error_message = 'Only named structs are supported'
@@ -20,6 +21,7 @@ end
20
21
 
21
22
  # Reimplements `json/add/ostruct`
22
23
  class OpenStruct
24
+ # Parse from simple hash
23
25
  def self.from_zenaton(props)
24
26
  new(props['t'] || props[:t])
25
27
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Range do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  {
9
10
  'a' => [first, last, exclude_end?]
@@ -15,6 +16,7 @@ end
15
16
 
16
17
  # Reimplements `json/add/range`
17
18
  class Range
19
+ # Parse from simple hash
18
20
  def self.from_zenaton(props)
19
21
  new(*props['a'])
20
22
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Rational do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  {
9
10
  'n' => numerator,
@@ -16,6 +17,7 @@ end
16
17
 
17
18
  # Reimplements `json/add/rational`
18
19
  class Rational
20
+ # Parse from simple hash
19
21
  def self.from_zenaton(props)
20
22
  Rational(props['n'], props['d'])
21
23
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Regexp do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  {
9
10
  'o' => options,
@@ -16,6 +17,7 @@ end
16
17
 
17
18
  # Reimplements `json/add/regexp`
18
19
  class Regexp
20
+ # Parse from simple hash
19
21
  def self.from_zenaton(props)
20
22
  new(props['s'], props['o'])
21
23
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Struct do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  class_name = self.class.name.to_s
9
10
  error_message = 'Only named structs are supported'
@@ -18,6 +19,7 @@ end
18
19
 
19
20
  # Reimplements `json/add/struct`
20
21
  class Struct
22
+ # Parse from simple hash
21
23
  def self.from_zenaton(props)
22
24
  new(*props['v'])
23
25
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Symbol do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  {
9
10
  's' => to_s
@@ -15,6 +16,7 @@ end
15
16
 
16
17
  # Reimplements `json/add/symbol`
17
18
  class Symbol
19
+ # Parse from simple hash
18
20
  def self.from_zenaton(props)
19
21
  props['s'].to_sym
20
22
  end
@@ -4,6 +4,7 @@ module Zenaton
4
4
  # :nodoc
5
5
  module Refinements
6
6
  refine Time do
7
+ # Convert to a simple hash
7
8
  def to_zenaton
8
9
  nanoseconds = [tv_usec * 1000]
9
10
  respond_to?(:tv_nsec) && nanoseconds << tv_nsec
@@ -19,6 +20,7 @@ end
19
20
 
20
21
  # Reimplements `json/add/time`
21
22
  class Time
23
+ # Parse from simple hash
22
24
  def self.from_zenaton(props)
23
25
  if (usec = props.delete('u')) # used to be tv_usec -> tv_nsec
24
26
  props['n'] = usec * 1000
@@ -14,3 +14,9 @@ require 'zenaton/refinements/regexp'
14
14
  require 'zenaton/refinements/struct'
15
15
  require 'zenaton/refinements/symbol'
16
16
  require 'zenaton/refinements/time'
17
+
18
+ module Zenaton
19
+ # Reimplements json encoding from `json/add` as refinements
20
+ module Refinements
21
+ end
22
+ end
@@ -24,7 +24,7 @@ module Zenaton
24
24
  end
25
25
 
26
26
  # Calculates the timestamp based on either timestamp or duration methods
27
- # @return Array<Integer, NilClass>
27
+ # @return [Array<Integer, NilClass>]
28
28
  def _get_timestamp_or_duration
29
29
  return [nil, nil] unless @buffer
30
30
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Zenaton
4
4
  # This gem's current version
5
- VERSION = '0.5.0'
5
+ VERSION = '0.5.1'
6
6
  end
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.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zenaton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-27 00:00:00.000000000 Z
11
+ date: 2019-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport