evt-command_line-component_generator 1.0.0.1 → 1.0.1.0
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 +4 -4
- data/lib/command_line/component_generator/commands/component.rb +10 -0
- data/source/lib/%component_name%.rb.tt +5 -0
- data/source/lib/%component_name%/consumers/commands.rb.tt +11 -0
- data/source/lib/%component_name%/consumers/events.rb.tt +11 -0
- data/source/lib/%component_name%/start.rb.tt +10 -0
- data/source/script/start.tt +9 -0
- data/source/script/test-database-connection +28 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03be3fe6a6daa6cee340f343ec02b0e736760e53e84d263f935d15208f555633
|
4
|
+
data.tar.gz: 3010dc1958047c7535267a013b180455a7258ae6d4a811513a919e4fe445dcf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34a652e48e8b455462d692ce95e97b0021648a39200611525f8070c61f2c392f1c8ccbed633c8a0b35f790ced73513a1d045a898ede62a7f86f911db567bb62f
|
7
|
+
data.tar.gz: 55cf0963e525d1044ae41caf6ddd122bb96055c47703e04a8eefef478294cf1eceb95677d4864b982bea3b92c12d7ae623b70f0a452cd7a29e53c576eed7a1a8
|
@@ -22,10 +22,18 @@ module CommandLine
|
|
22
22
|
@entity_name ||= Casing::Underscore.(entity_constant_name)
|
23
23
|
end
|
24
24
|
|
25
|
+
def entity_stream_name
|
26
|
+
@entity_stream_name ||= Casing::Camel.(entity_name)
|
27
|
+
end
|
28
|
+
|
25
29
|
def entity_constant_name
|
26
30
|
@entity_constant_name ||= Casing::Pascal.(component_name.gsub('_component', ''))
|
27
31
|
end
|
28
32
|
|
33
|
+
def service_name
|
34
|
+
@service_name ||= entity_name.gsub('_', '-')
|
35
|
+
end
|
36
|
+
|
29
37
|
def self.source_root
|
30
38
|
File.dirname(__FILE__) + '/../../../../source'
|
31
39
|
end
|
@@ -42,6 +50,8 @@ module CommandLine
|
|
42
50
|
def assign_executable_attribute
|
43
51
|
chmod './install-gems.sh', 0755
|
44
52
|
chmod './test.sh', 0755
|
53
|
+
chmod 'script/test-database-connection', 0755
|
54
|
+
chmod 'script/start', 0755
|
45
55
|
end
|
46
56
|
end
|
47
57
|
end
|
@@ -10,3 +10,8 @@ require '<%= component_name %>/store'
|
|
10
10
|
|
11
11
|
require '<%= component_name %>/handlers/commands'
|
12
12
|
require '<%= component_name %>/handlers/events'
|
13
|
+
|
14
|
+
require '<%= component_name %>/consumers/commands'
|
15
|
+
require '<%= component_name %>/consumers/events'
|
16
|
+
|
17
|
+
require '<%= component_name %>/start'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Component initiator user guide: http://docs.eventide-project.org/user-guide/component-host.html#component-initiator
|
2
|
+
|
3
|
+
module <%= component_constant_name %>
|
4
|
+
module Start
|
5
|
+
def self.call
|
6
|
+
Consumers::Commands.start('<%= entity_stream_name %>:command')
|
7
|
+
Consumers::Events.start('<%= entity_stream_name %>')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative '../init'
|
4
|
+
|
5
|
+
puts 'Testing Message Store Database Connection'
|
6
|
+
puts '= = ='
|
7
|
+
|
8
|
+
session = MessageStore::Postgres::Session.build
|
9
|
+
|
10
|
+
puts "Connection Status: #{session.open? ? 'open' : 'closed' }"
|
11
|
+
|
12
|
+
session.open
|
13
|
+
|
14
|
+
puts 'Opening connection'
|
15
|
+
puts "Connection Status: #{session.open? ? 'open' : 'closed' }"
|
16
|
+
|
17
|
+
sql_command = 'SELECT 1;'
|
18
|
+
puts "Executing test command: #{sql_command}"
|
19
|
+
|
20
|
+
session.execute(sql_command)
|
21
|
+
|
22
|
+
puts 'Closing connection'
|
23
|
+
session.close
|
24
|
+
|
25
|
+
puts "Connection Status: #{session.open? ? 'open' : 'closed' }"
|
26
|
+
|
27
|
+
puts '- - -'
|
28
|
+
puts 'done'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-command_line-component_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: executable
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -71,6 +71,8 @@ files:
|
|
71
71
|
- source/install-gems.sh
|
72
72
|
- source/lib/%component_name%.rb.tt
|
73
73
|
- source/lib/%component_name%/%entity_name%.rb.tt
|
74
|
+
- source/lib/%component_name%/consumers/commands.rb.tt
|
75
|
+
- source/lib/%component_name%/consumers/events.rb.tt
|
74
76
|
- source/lib/%component_name%/controls.rb.tt
|
75
77
|
- source/lib/%component_name%/controls/%entity_name%.rb.tt
|
76
78
|
- source/lib/%component_name%/controls/id.rb.tt
|
@@ -81,8 +83,11 @@ files:
|
|
81
83
|
- source/lib/%component_name%/messages/commands/.empty_directory
|
82
84
|
- source/lib/%component_name%/messages/events/.empty_directory
|
83
85
|
- source/lib/%component_name%/projection.rb.tt
|
86
|
+
- source/lib/%component_name%/start.rb.tt
|
84
87
|
- source/lib/%component_name%/store.rb.tt
|
85
88
|
- source/load_path.rb
|
89
|
+
- source/script/start.tt
|
90
|
+
- source/script/test-database-connection
|
86
91
|
- source/settings/message_store_postgres.json.example
|
87
92
|
- source/test.sh
|
88
93
|
- source/test/automated.rb
|