eztek-mediat_r 1.0.0 → 1.0.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 +4 -4
- data/lib/ez/mediat_r/version.rb +1 -1
- data/lib/generators/commands/USAGE +0 -0
- data/lib/generators/commands/commands_generator.rb +33 -0
- data/lib/generators/commands/templates/command_handler_template.template +7 -0
- data/lib/generators/commands/templates/command_template.template +11 -0
- data/lib/generators/commands/templates/command_validator_template.template +6 -0
- data/lib/generators/queries/USAGE +0 -0
- data/lib/generators/queries/queries_generator.rb +33 -0
- data/lib/generators/queries/templates/queries_handler_template.template +7 -0
- data/lib/generators/queries/templates/queries_template.template +11 -0
- data/lib/generators/queries/templates/queries_validator_template.template +6 -0
- metadata +11 -2
- data/eztek-mediat_r.gemspec +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c66221e78adb55cce7b38b481a32ae12a8f4f22e5c4b25b8d12a1435fa3b98d
|
4
|
+
data.tar.gz: 381eb46fbd9daedee47f246368214b5805a9433c59b8b20c27de6010a2876bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9475134a35c04b01e42b7ae2b47d031821c3e8bc51056f679abbaf7ed5fe09bf5650134fc3d3fce6f402f30f3742fd9d29bcf78ccfa0dcd036d8452cb111082f
|
7
|
+
data.tar.gz: 3f8a32363b4df0da42eba84d7598dc0eda50aeb283fc5e7375da48886ea0997490edd75fe340135bae76bcbdbd782ed162b1839170c799c9c2e879ab23bdbf6d
|
data/lib/ez/mediat_r/version.rb
CHANGED
File without changes
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class CommandsGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
argument :model, type: :string
|
4
|
+
argument :name, type: :string
|
5
|
+
class_option :validator, type: :boolean, default: false, desc: "Generate validator."
|
6
|
+
class_option :doc, type: :boolean, default: true, desc: "Include documentation."
|
7
|
+
|
8
|
+
def generate_init
|
9
|
+
generate_command
|
10
|
+
end
|
11
|
+
|
12
|
+
def generate_validator
|
13
|
+
generate_validator if validator
|
14
|
+
end
|
15
|
+
|
16
|
+
def generate_handler
|
17
|
+
generate_handler unless model == 'init'
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def generate_command
|
23
|
+
template 'commands_template.template', "app/cqrs/#{model.underscore}/commands/#{{name.underscore}_command.rb}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def generate_validator
|
27
|
+
template 'commands_validator_template.template', "app/cqrs/#{model.underscore}/commands/validators/#{{name.underscore}_command_validator.rb}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def generate_handler
|
31
|
+
template 'commands_handler_template.template', "app/cqrs/#{model.underscore}/commands/handlers/#{{name.underscore}_command_handler.rb}"
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module <%= model.camelcase %>::Commands
|
2
|
+
class <%= name.camelcase %>Command
|
3
|
+
include ActiveModel::Validations
|
4
|
+
<%- options.validator -%>
|
5
|
+
validates_with Validators::<%= name.camelcase %>CommandValidator
|
6
|
+
<%- end -%>
|
7
|
+
|
8
|
+
def initialize()
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
File without changes
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class QueriesGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
argument :model, type: :string
|
4
|
+
argument :name, type: :string
|
5
|
+
class_option :validator, type: :boolean, default: false, desc: "Generate validator."
|
6
|
+
class_option :doc, type: :boolean, default: true, desc: "Include documentation."
|
7
|
+
|
8
|
+
def generate_init
|
9
|
+
generate_query
|
10
|
+
end
|
11
|
+
|
12
|
+
def generate_validator
|
13
|
+
generate_validator if validator
|
14
|
+
end
|
15
|
+
|
16
|
+
def generate_handler
|
17
|
+
generate_handler unless model == 'init'
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def generate_query
|
23
|
+
template 'queries_template.template', "app/cqrs/#{model.underscore}/queries/#{{name.underscore}_query.rb}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def generate_validator
|
27
|
+
template 'queries_validator_template.template', "app/cqrs/#{model.underscore}/queries/validators/#{{name.underscore}_query_validator.rb}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def generate_handler
|
31
|
+
template 'queries_handler_template.template', "app/cqrs/#{model.underscore}/queries/handlers/#{{name.underscore}_query_handler.rb}"
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eztek-mediat_r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yeucon02vn
|
@@ -76,10 +76,19 @@ files:
|
|
76
76
|
- Gemfile
|
77
77
|
- README.md
|
78
78
|
- Rakefile
|
79
|
-
- eztek-mediat_r.gemspec
|
80
79
|
- lib/ez/mediat_r.rb
|
81
80
|
- lib/ez/mediat_r/alias.rb
|
82
81
|
- lib/ez/mediat_r/version.rb
|
82
|
+
- lib/generators/commands/USAGE
|
83
|
+
- lib/generators/commands/commands_generator.rb
|
84
|
+
- lib/generators/commands/templates/command_handler_template.template
|
85
|
+
- lib/generators/commands/templates/command_template.template
|
86
|
+
- lib/generators/commands/templates/command_validator_template.template
|
87
|
+
- lib/generators/queries/USAGE
|
88
|
+
- lib/generators/queries/queries_generator.rb
|
89
|
+
- lib/generators/queries/templates/queries_handler_template.template
|
90
|
+
- lib/generators/queries/templates/queries_template.template
|
91
|
+
- lib/generators/queries/templates/queries_validator_template.template
|
83
92
|
- sig/ez/mediat_r.rbs
|
84
93
|
homepage: https://github.com/yeucon02vn/eztek-mediat_r
|
85
94
|
licenses:
|
data/eztek-mediat_r.gemspec
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require_relative "lib/ez/mediat_r/version"
|
2
|
-
|
3
|
-
lib = File.expand_path('../lib', __FILE__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "eztek-mediat_r"
|
8
|
-
spec.version = EZ::MediatR::VERSION
|
9
|
-
spec.authors = ["yeucon02vn"]
|
10
|
-
spec.email = ["phiphuqn1@gmail.com"]
|
11
|
-
|
12
|
-
spec.summary = "This is an async implementation of Mediator pattern with pipline behaviors.
|
13
|
-
It is a port of Mediatr from .Net C#"
|
14
|
-
spec.homepage = "https://github.com/yeucon02vn/eztek-mediat_r"
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
18
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
19
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
20
|
-
end
|
21
|
-
end
|
22
|
-
spec.bindir = "exe"
|
23
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
24
|
-
spec.require_paths = ["lib"]
|
25
|
-
|
26
|
-
spec.add_dependency "concurrent-ruby"
|
27
|
-
|
28
|
-
spec.add_development_dependency "bundler"
|
29
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
-
spec.add_development_dependency "rspec", "~> 3.4.0"
|
31
|
-
end
|