hecks 0.0.8 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hecks +1 -0
- data/lib/cli.rb +28 -0
- data/lib/cli/build.rb +13 -0
- data/lib/cli/{commands/console.rb → console.rb} +0 -0
- data/lib/cli/generate.rb +35 -0
- data/lib/cli/{commands/package.rb → package.rb} +2 -5
- data/lib/cli/test.rb +56 -0
- data/lib/{console/console.rb → console.rb} +1 -2
- data/lib/console/commands.rb +1 -1
- data/lib/hecks.rb +6 -6
- data/lib/packager.rb +2 -0
- data/lib/packager/generate_binary_package.rb +146 -0
- data/lib/packager/generate_lambda_package.rb +26 -0
- data/lib/{cli/commands/generate/templates/binary_package/build/resources → packager/templates}/Gemfile.tt +1 -1
- data/lib/{cli/commands/generate → packager}/templates/binary_package/build/linux-x86_64/lib/app/hello.rb +0 -0
- data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/%domain_name%.rb.tt +6 -2
- data/lib/packager/templates/binary_package/build/resources/Dockerfile.tt +14 -0
- data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/bundle/config +0 -0
- data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/wrapper.tt +0 -0
- data/lib/{cli/commands/generate → packager}/templates/lambda_package/handler.js.tt +0 -0
- data/lib/{cli/commands/generate → packager}/templates/lambda_package/serverless.yml.tt +0 -0
- metadata +45 -94
- data/lib/adapters/adapters.rb +0 -6
- data/lib/adapters/events/events.rb +0 -27
- data/lib/adapters/logger/logger.rb +0 -18
- data/lib/adapters/memory_database/memory_database.rb +0 -18
- data/lib/adapters/resource_server/methods.rb +0 -22
- data/lib/adapters/resource_server/methods/create.rb +0 -49
- data/lib/adapters/resource_server/methods/delete.rb +0 -45
- data/lib/adapters/resource_server/methods/read.rb +0 -44
- data/lib/adapters/resource_server/methods/update.rb +0 -50
- data/lib/adapters/resource_server/resource_server.rb +0 -52
- data/lib/adapters/validator/validator.rb +0 -33
- data/lib/application/application.rb +0 -45
- data/lib/application/commands/commands.rb +0 -5
- data/lib/application/commands/create.rb +0 -52
- data/lib/application/commands/crud_handler.rb +0 -40
- data/lib/application/commands/delete.rb +0 -40
- data/lib/application/commands/runner.rb +0 -48
- data/lib/application/commands/update.rb +0 -41
- data/lib/application/queries/find_by_id.rb +0 -19
- data/lib/application/queries/queries.rb +0 -2
- data/lib/application/queries/query_runner.rb +0 -28
- data/lib/cli/cli.rb +0 -24
- data/lib/cli/commands.rb +0 -5
- data/lib/cli/commands/build.rb +0 -10
- data/lib/cli/commands/generate.rb +0 -26
- data/lib/cli/commands/generate/builder.rb +0 -60
- data/lib/cli/commands/generate/builder/aggregate_command_line_builder.rb +0 -18
- data/lib/cli/commands/generate/builder/reference_command_line_builder.rb +0 -19
- data/lib/cli/commands/generate/builder/value_object_command_line_builder.rb +0 -19
- data/lib/cli/commands/generate/generate_aws_package.rb +0 -17
- data/lib/cli/commands/generate/generate_binary_package.rb +0 -92
- data/lib/cli/commands/generate/generate_domain_object.rb +0 -71
- data/lib/cli/commands/generate/generate_domain_object/assignment_template.rb +0 -36
- data/lib/cli/commands/generate/generate_domain_object/option_formatter.rb +0 -30
- data/lib/cli/commands/generate/generate_lambda_package.rb +0 -20
- data/lib/cli/commands/generate/generate_resource_server.rb +0 -17
- data/lib/cli/commands/generate/new.rb +0 -47
- data/lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/%head_name%.rb.tt +0 -16
- data/lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/%name%.rb.tt +0 -9
- data/lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/repository.rb.tt +0 -40
- data/lib/cli/commands/generate/templates/binary_package/build/resources/Dockerfile.tt +0 -8
- data/lib/cli/commands/generate/templates/domain/%name%.gemspec.tt +0 -12
- data/lib/cli/commands/generate/templates/domain/Version +0 -1
- data/lib/cli/commands/generate/templates/domain/lib/%name%.rb.tt +0 -21
- data/lib/cli/commands/generate/templates/domain/spec/spec_helper.rb.tt +0 -4
- data/lib/cli/commands/generate/templates/reference/lib/domain/%module_name%/%file_name%.rb.tt +0 -25
- data/lib/cli/commands/generate/templates/resource_server/config.ru.tt +0 -8
- data/lib/cli/commands/generate/templates/value_object/lib/domain/%module_name%/%name%.rb.tt +0 -24
- data/lib/cli/commands/test.rb +0 -41
- data/lib/domain_builder/attribute.rb +0 -33
- data/lib/domain_builder/domain.rb +0 -17
- data/lib/domain_builder/domain_builder.rb +0 -35
- data/lib/domain_builder/domain_module.rb +0 -26
- data/lib/domain_builder/domain_object.rb +0 -37
- data/lib/domain_builder/head.rb +0 -6
- data/lib/domain_builder/reference.rb +0 -17
- data/lib/domain_builder/value.rb +0 -6
@@ -1,33 +0,0 @@
|
|
1
|
-
module Hecks
|
2
|
-
class DomainBuilder
|
3
|
-
class Attribute
|
4
|
-
def initialize(string)
|
5
|
-
@string = string
|
6
|
-
end
|
7
|
-
|
8
|
-
def list?
|
9
|
-
@string.include?("[")
|
10
|
-
end
|
11
|
-
|
12
|
-
def name
|
13
|
-
@string.split(":").first
|
14
|
-
end
|
15
|
-
|
16
|
-
def type
|
17
|
-
@string.split(":").last.delete("[").delete("]").camelize
|
18
|
-
end
|
19
|
-
|
20
|
-
def domain_module
|
21
|
-
return unless @string.include?("::")
|
22
|
-
@string.split("::").first.split(":").last.camelize
|
23
|
-
end
|
24
|
-
|
25
|
-
def ==(other)
|
26
|
-
return false if other.name != name
|
27
|
-
return false if other.type != type
|
28
|
-
return false if other.domain_module != domain_module
|
29
|
-
return true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Hecks
|
2
|
-
class DomainBuilder
|
3
|
-
class Domain
|
4
|
-
attr_reader :domain_modules, :name
|
5
|
-
def initialize(name:)
|
6
|
-
@name = name
|
7
|
-
@domain_modules = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def module(name, &block)
|
11
|
-
result = DomainModule.new(name: name)
|
12
|
-
@domain_modules[name.to_sym] = result
|
13
|
-
yield(result)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require_relative 'domain'
|
2
|
-
require_relative 'domain_module'
|
3
|
-
require_relative 'domain_object'
|
4
|
-
require_relative 'value'
|
5
|
-
require_relative 'head'
|
6
|
-
require_relative 'attribute'
|
7
|
-
require_relative 'reference'
|
8
|
-
|
9
|
-
module Hecks
|
10
|
-
def self.specification=(value)
|
11
|
-
@specification = value
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.specification
|
15
|
-
@specification
|
16
|
-
end
|
17
|
-
|
18
|
-
class DomainBuilder
|
19
|
-
attr_accessor :domain, :specification
|
20
|
-
|
21
|
-
def initialize(domain_name:, &block)
|
22
|
-
@domain = Domain.new(name: domain_name)
|
23
|
-
block.yield(@domain)
|
24
|
-
self
|
25
|
-
end
|
26
|
-
|
27
|
-
def domain_modules
|
28
|
-
@domain.domain_modules
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.build(domain_name, &block)
|
32
|
-
Hecks.specification = new(domain_name: domain_name, &block)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module Hecks
|
2
|
-
class DomainBuilder
|
3
|
-
class DomainModule
|
4
|
-
attr_reader :objects, :name, :references
|
5
|
-
|
6
|
-
def initialize(name:)
|
7
|
-
@name = name
|
8
|
-
@objects = []
|
9
|
-
@references = []
|
10
|
-
end
|
11
|
-
|
12
|
-
def head(name=nil)
|
13
|
-
return (@objects << Head.new(name: name)).last if name
|
14
|
-
objects.find{ |o| o.is_a?(Head) }
|
15
|
-
end
|
16
|
-
|
17
|
-
def value(name)
|
18
|
-
(@objects << Value.new(name: name)).last
|
19
|
-
end
|
20
|
-
|
21
|
-
def reference(name)
|
22
|
-
(@references << Reference.new(name)).last
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module Hecks
|
2
|
-
class DomainBuilder
|
3
|
-
class DomainObject
|
4
|
-
attr_reader :name, :attributes
|
5
|
-
|
6
|
-
def initialize(name:)
|
7
|
-
@name = name
|
8
|
-
end
|
9
|
-
|
10
|
-
def attributes(*values)
|
11
|
-
return @attributes if @attributes
|
12
|
-
@attributes = values.map { |value| Attribute.new(value) }
|
13
|
-
end
|
14
|
-
|
15
|
-
def attribute_hash
|
16
|
-
attributes.map do |attribute|
|
17
|
-
[attribute.name.to_sym, attribute.type]
|
18
|
-
end.to_h
|
19
|
-
end
|
20
|
-
|
21
|
-
def attribute_string
|
22
|
-
attributes.map do |attribute|
|
23
|
-
[attribute.name, type_with_domain_module(attribute)].join(':')
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def type_with_domain_module(attribute)
|
30
|
-
type = attribute.type
|
31
|
-
type = '[' + attribute.type + ']' if attribute.list?
|
32
|
-
return type unless attribute.domain_module
|
33
|
-
[attribute.domain_module, type].join("::")
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/domain_builder/head.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module Hecks
|
2
|
-
class DomainBuilder
|
3
|
-
class Reference
|
4
|
-
def initialize(reference)
|
5
|
-
@reference = reference
|
6
|
-
end
|
7
|
-
|
8
|
-
def referenced_entity
|
9
|
-
@reference.split("::").map(&:camelcase).join("::")
|
10
|
-
end
|
11
|
-
|
12
|
-
def name
|
13
|
-
@reference.split("::").last.camelcase + "Reference"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|