hecks 0.0.8 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hecks +1 -0
  3. data/lib/cli.rb +28 -0
  4. data/lib/cli/build.rb +13 -0
  5. data/lib/cli/{commands/console.rb → console.rb} +0 -0
  6. data/lib/cli/generate.rb +35 -0
  7. data/lib/cli/{commands/package.rb → package.rb} +2 -5
  8. data/lib/cli/test.rb +56 -0
  9. data/lib/{console/console.rb → console.rb} +1 -2
  10. data/lib/console/commands.rb +1 -1
  11. data/lib/hecks.rb +6 -6
  12. data/lib/packager.rb +2 -0
  13. data/lib/packager/generate_binary_package.rb +146 -0
  14. data/lib/packager/generate_lambda_package.rb +26 -0
  15. data/lib/{cli/commands/generate/templates/binary_package/build/resources → packager/templates}/Gemfile.tt +1 -1
  16. data/lib/{cli/commands/generate → packager}/templates/binary_package/build/linux-x86_64/lib/app/hello.rb +0 -0
  17. data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/%domain_name%.rb.tt +6 -2
  18. data/lib/packager/templates/binary_package/build/resources/Dockerfile.tt +14 -0
  19. data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/bundle/config +0 -0
  20. data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/wrapper.tt +0 -0
  21. data/lib/{cli/commands/generate → packager}/templates/lambda_package/handler.js.tt +0 -0
  22. data/lib/{cli/commands/generate → packager}/templates/lambda_package/serverless.yml.tt +0 -0
  23. metadata +45 -94
  24. data/lib/adapters/adapters.rb +0 -6
  25. data/lib/adapters/events/events.rb +0 -27
  26. data/lib/adapters/logger/logger.rb +0 -18
  27. data/lib/adapters/memory_database/memory_database.rb +0 -18
  28. data/lib/adapters/resource_server/methods.rb +0 -22
  29. data/lib/adapters/resource_server/methods/create.rb +0 -49
  30. data/lib/adapters/resource_server/methods/delete.rb +0 -45
  31. data/lib/adapters/resource_server/methods/read.rb +0 -44
  32. data/lib/adapters/resource_server/methods/update.rb +0 -50
  33. data/lib/adapters/resource_server/resource_server.rb +0 -52
  34. data/lib/adapters/validator/validator.rb +0 -33
  35. data/lib/application/application.rb +0 -45
  36. data/lib/application/commands/commands.rb +0 -5
  37. data/lib/application/commands/create.rb +0 -52
  38. data/lib/application/commands/crud_handler.rb +0 -40
  39. data/lib/application/commands/delete.rb +0 -40
  40. data/lib/application/commands/runner.rb +0 -48
  41. data/lib/application/commands/update.rb +0 -41
  42. data/lib/application/queries/find_by_id.rb +0 -19
  43. data/lib/application/queries/queries.rb +0 -2
  44. data/lib/application/queries/query_runner.rb +0 -28
  45. data/lib/cli/cli.rb +0 -24
  46. data/lib/cli/commands.rb +0 -5
  47. data/lib/cli/commands/build.rb +0 -10
  48. data/lib/cli/commands/generate.rb +0 -26
  49. data/lib/cli/commands/generate/builder.rb +0 -60
  50. data/lib/cli/commands/generate/builder/aggregate_command_line_builder.rb +0 -18
  51. data/lib/cli/commands/generate/builder/reference_command_line_builder.rb +0 -19
  52. data/lib/cli/commands/generate/builder/value_object_command_line_builder.rb +0 -19
  53. data/lib/cli/commands/generate/generate_aws_package.rb +0 -17
  54. data/lib/cli/commands/generate/generate_binary_package.rb +0 -92
  55. data/lib/cli/commands/generate/generate_domain_object.rb +0 -71
  56. data/lib/cli/commands/generate/generate_domain_object/assignment_template.rb +0 -36
  57. data/lib/cli/commands/generate/generate_domain_object/option_formatter.rb +0 -30
  58. data/lib/cli/commands/generate/generate_lambda_package.rb +0 -20
  59. data/lib/cli/commands/generate/generate_resource_server.rb +0 -17
  60. data/lib/cli/commands/generate/new.rb +0 -47
  61. data/lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/%head_name%.rb.tt +0 -16
  62. data/lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/%name%.rb.tt +0 -9
  63. data/lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/repository.rb.tt +0 -40
  64. data/lib/cli/commands/generate/templates/binary_package/build/resources/Dockerfile.tt +0 -8
  65. data/lib/cli/commands/generate/templates/domain/%name%.gemspec.tt +0 -12
  66. data/lib/cli/commands/generate/templates/domain/Version +0 -1
  67. data/lib/cli/commands/generate/templates/domain/lib/%name%.rb.tt +0 -21
  68. data/lib/cli/commands/generate/templates/domain/spec/spec_helper.rb.tt +0 -4
  69. data/lib/cli/commands/generate/templates/reference/lib/domain/%module_name%/%file_name%.rb.tt +0 -25
  70. data/lib/cli/commands/generate/templates/resource_server/config.ru.tt +0 -8
  71. data/lib/cli/commands/generate/templates/value_object/lib/domain/%module_name%/%name%.rb.tt +0 -24
  72. data/lib/cli/commands/test.rb +0 -41
  73. data/lib/domain_builder/attribute.rb +0 -33
  74. data/lib/domain_builder/domain.rb +0 -17
  75. data/lib/domain_builder/domain_builder.rb +0 -35
  76. data/lib/domain_builder/domain_module.rb +0 -26
  77. data/lib/domain_builder/domain_object.rb +0 -37
  78. data/lib/domain_builder/head.rb +0 -6
  79. data/lib/domain_builder/reference.rb +0 -17
  80. 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
@@ -1,6 +0,0 @@
1
- module Hecks
2
- class DomainBuilder
3
- class Head < DomainObject
4
- end
5
- end
6
- end
@@ -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
@@ -1,6 +0,0 @@
1
- module Hecks
2
- class DomainBuilder
3
- class Value < DomainObject
4
- end
5
- end
6
- end