aggregate_root 0.35.0 → 0.36.0

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
  SHA256:
3
- metadata.gz: 832509e71350071d08edb4979b86a55720a7b38066e99d39a6c0a6bea65320fe
4
- data.tar.gz: 5301efab2fa6fb471d99db6b103c88f3cc6ec677eec2a4300dfac57fc58a49a4
3
+ metadata.gz: 6283f565f49164977c767f1861436c0b967454b88343a66eca43a51cbed62bee
4
+ data.tar.gz: '07208fd928b28951bfe984e8bca3cc43755277c5be8c147ab998522adb6ab067'
5
5
  SHA512:
6
- metadata.gz: 31d6bded60450e6bdaf1acd59537ec506b8e1d60a79b1530bf89f36f3783f88b536c77fba457409c18ca9a47bb80964758038c0092bd95b65f711e20f3ed7a24
7
- data.tar.gz: 18a9c27838c0ba303597359442f9a8ae5e20888902bae4804fb5006daddb093435a219cc6210eea282c1aef7b8a182a3fca209385159a1bd4abb37b8c8ca0d6f
6
+ metadata.gz: da972cb63c395d4d7690c5b7ce214c8201ad70c3a5e4991da9b18e4003d16204ec72ea2285067d6e2ef5d2abde90018084e931ca4447284d125f89103e9a6158
7
+ data.tar.gz: dc20159def2f3fe6dd977f2601bea5151b763f9368c9a10dc50e918eff92995b65818c03d83ec2d476b1e2670c527fb4a6f7386ef84eb3a2ac4937ed11e5b886
@@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ['lib']
27
27
 
28
- spec.add_dependency 'ruby_event_store', '= 0.35.0'
28
+ spec.add_dependency 'ruby_event_store', '= 0.36.0'
29
29
  end
@@ -1,5 +1,6 @@
1
1
  require 'aggregate_root/version'
2
2
  require 'aggregate_root/configuration'
3
+ require 'aggregate_root/transform'
3
4
  require 'aggregate_root/default_apply_strategy'
4
5
 
5
6
  module AggregateRoot
@@ -23,16 +23,11 @@ module AggregateRoot
23
23
  end
24
24
 
25
25
  def handler_name_by_class(event_class)
26
- "apply_#{to_snake_case(event_class.name)}"
26
+ "apply_#{Transform.to_snake_case(class_name(event_class))}"
27
27
  end
28
28
 
29
- def to_snake_case(class_name)
30
- class_name
31
- .split("::")
32
- .last
33
- .gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
34
- .gsub(/([a-z\d])([A-Z])/, '\1_\2')
35
- .downcase
29
+ def class_name(event_class)
30
+ event_class.name.split("::").last
36
31
  end
37
32
 
38
33
  private
@@ -0,0 +1,10 @@
1
+ module AggregateRoot
2
+ class Transform
3
+ def self.to_snake_case(name)
4
+ name
5
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
6
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
7
+ .downcase
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module AggregateRoot
2
- VERSION = "0.35.0"
2
+ VERSION = "0.36.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggregate_root
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.35.0
4
+ version: 0.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-07 00:00:00.000000000 Z
11
+ date: 2019-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_event_store
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.35.0
19
+ version: 0.36.0
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
- version: 0.35.0
26
+ version: 0.36.0
27
27
  description: Event sourced (with Rails Event Store) aggregate root implementation
28
28
  email:
29
29
  - dev@arkency.com
@@ -39,6 +39,7 @@ files:
39
39
  - lib/aggregate_root.rb
40
40
  - lib/aggregate_root/configuration.rb
41
41
  - lib/aggregate_root/default_apply_strategy.rb
42
+ - lib/aggregate_root/transform.rb
42
43
  - lib/aggregate_root/version.rb
43
44
  homepage: https://railseventstore.org
44
45
  licenses:
@@ -63,8 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  - !ruby/object:Gem::Version
64
65
  version: '0'
65
66
  requirements: []
66
- rubyforge_project:
67
- rubygems_version: 2.7.6
67
+ rubygems_version: 3.0.2
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: Event sourced (with Rails Event Store) aggregate root implementation