nexus_cqrs 0.0.8 → 0.0.13

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: 964f3e200ed51f402f7c00973065c34a05122b2f20837476b3f5a55a7e4fc46e
4
- data.tar.gz: 9c4102fef193eda90fa60178ec05c1bafe49f89dff2157eb8e2a850ce773e18b
3
+ metadata.gz: cdfe50446a77c51b914898af69e47f8cb90d5bbaf6b952570722bf22c5f1c216
4
+ data.tar.gz: 50117d1c8c04e2855a966357038ce57c71f39c527b240b36a57c5862058cc64e
5
5
  SHA512:
6
- metadata.gz: 70862cb50dc57a43161aee2f346dc6d6e60061f620a6b194423bfdf4c8d75f766ca3b03d27ba036a213f2247a6d618ac55f13ea35bab1fad2c49a0fe0308835d
7
- data.tar.gz: 5684b39d573edb2d81a1c3dc890ed2bb1de7d9d5d9b9f2e4f3054b34bb215bfc3dbfdf3b89d4a8434cfb48b2647350f1687259cd47a3b392e8b61df03ce756f8
6
+ metadata.gz: 8c2fce71a6eb75cf91a616dbaea01e6cc572a16d2ddc3d58036b61345e0c10d99120d24c15eb2c2fa02590131d4dc89ba2926ebd722a3d0555ff52de8801015b
7
+ data.tar.gz: 582a7d078d000a12fe16959bb20da9c4b65770d6dc6c4dc13e9e6f53aa5dce11768ba4b15771dd7e0c9dbec790fe8b547a35c7b38f4f7bd0b44b371395bf3d4d
data/.gitignore CHANGED
@@ -7,5 +7,5 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /.gem
10
-
10
+ /spec/lib/tmp
11
11
  *.gem
@@ -22,7 +22,7 @@ module NexusCqrs
22
22
  template('register_cqrs_handlers.rb', handler_config)
23
23
  end
24
24
 
25
- code_to_inject = "$COMMAND_EXECUTOR.register_command(#{full_name}, #{full_name}Handler)"
25
+ code_to_inject = "$COMMAND_EXECUTOR.register_command(#{full_name}, #{full_name}Handler.new)\n"
26
26
 
27
27
  inject_into_file(handler_config, code_to_inject, after: "# Register Commands\n")
28
28
  end
@@ -22,7 +22,7 @@ module NexusCqrs
22
22
  template('register_cqrs_handlers.rb', handler_config)
23
23
  end
24
24
 
25
- code_to_inject = "$QUERY_EXECUTOR.register_command(#{full_name}, #{full_name}Handler)"
25
+ code_to_inject = "$QUERY_EXECUTOR.register_command(#{full_name}, #{full_name}Handler.new)\n"
26
26
 
27
27
  inject_into_file(handler_config, code_to_inject, after: "# Register Queries\n")
28
28
  end
@@ -1,4 +1,6 @@
1
1
  module NexusCqrs
2
2
  class BaseQueryHandler
3
+ def call(command)
4
+ end
3
5
  end
4
6
  end
@@ -20,7 +20,7 @@ module NexusCqrs
20
20
  unregistered_handler = proc { raise UnregisteredHandler, "Missing handler for #{command.class}" }
21
21
 
22
22
  handlers
23
- .fetch(command.class, &unregistered_handler)
23
+ .fetch(command.class.name, &unregistered_handler)
24
24
  .call(command)
25
25
  end
26
26
 
@@ -12,7 +12,7 @@ module NexusCqrs
12
12
 
13
13
  def register_command(klass, handler)
14
14
  Rails.logger.debug("Registered #{klass} to #{handler}")
15
- @bus.register(klass.class, handler)
15
+ @bus.register(klass.name, handler)
16
16
  end
17
17
 
18
18
  private
@@ -7,12 +7,16 @@ module NexusCqrs
7
7
 
8
8
  # Executes a CQRS Query
9
9
  def query(query)
10
- command_executor.execute(query)
10
+ query_executor.execute(query)
11
11
  end
12
12
 
13
13
  # Provide access to the CQRS executor
14
14
  def command_executor
15
15
  @command_executor ||= $COMMAND_EXECUTOR
16
16
  end
17
+
18
+ def query_executor
19
+ @query_executor ||= $QUERY_EXECUTOR
20
+ end
17
21
  end
18
22
  end
@@ -1,3 +1,3 @@
1
1
  module NexusCqrs
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus_cqrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Lovett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-25 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: