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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72e88f0d63656b4a33d133942d5e5af326daa214
|
4
|
+
data.tar.gz: 7a01d081088d5630bc1d65426fa026f697ba24ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 747f80db7c47f58948daf9296d2b103bb703d616f1e9961a335daa779ca034c0509e789b3f42e73325c13ced9e06ac24b03df17b60393f38ebfb4f544d41e367
|
7
|
+
data.tar.gz: c984c971bcac8e5f99fc9c45f8b712312cdadbcde0f94bdcc60bc32a350b1b13e783c5b370672c09183204b57c178d45e685ab9698ac49826d351863afefd456
|
data/bin/hecks
CHANGED
data/lib/cli.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'active_support/inflector'
|
3
|
+
require_relative 'cli/generate'
|
4
|
+
require_relative 'cli/package'
|
5
|
+
require_relative 'cli/test'
|
6
|
+
require_relative 'cli/console'
|
7
|
+
require_relative 'cli/command_runner'
|
8
|
+
require_relative 'cli/build'
|
9
|
+
|
10
|
+
module Hecks
|
11
|
+
class CLI < Thor
|
12
|
+
package_name 'hecks'
|
13
|
+
|
14
|
+
desc 'generate', 'generate'
|
15
|
+
subcommand('generate', Generate)
|
16
|
+
|
17
|
+
desc 'package', 'package'
|
18
|
+
subcommand('package', Package) if File.file?('Domain')
|
19
|
+
|
20
|
+
desc 'test', 'test'
|
21
|
+
subcommand('test', Test) if File.file?('hecks.gemspec')
|
22
|
+
|
23
|
+
long_desc 'Generate a domain'
|
24
|
+
method_option :dryrun, aliases: '-d', type: :boolean, desc: 'Output commands without running'
|
25
|
+
|
26
|
+
register(Hecks::Domain::CLI::New, 'new', 'new', 'Create a new Domain') if File.file?('Domain')
|
27
|
+
end
|
28
|
+
end
|
data/lib/cli/build.rb
ADDED
File without changes
|
data/lib/cli/generate.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
class Generate < Thor
|
3
|
+
desc 'domain_objects', 'generate domain objects'
|
4
|
+
method_option :type,
|
5
|
+
aliases: '-t',
|
6
|
+
required: true,
|
7
|
+
desc: 'The type of the domain object you want to generate',
|
8
|
+
banner: '[OBJECT_TYPE]',
|
9
|
+
enum: %w(entity value_object aggregate reference) if File.file?('Domain') || File.file?('hecks.gemspec')
|
10
|
+
|
11
|
+
register(Hecks::Domain::CLI::GenerateDomainObject,
|
12
|
+
'domain_object',
|
13
|
+
'domain_object',
|
14
|
+
'Generate Domain Objects') if File.file?('Domain')
|
15
|
+
|
16
|
+
desc 'resource_server', 'generate resource_server adapter'
|
17
|
+
register(Hecks::Domain::Adapters::ResourceServer::CLI::GenerateResourceServer,
|
18
|
+
'resource_server',
|
19
|
+
'resource_server',
|
20
|
+
'Generate A Resource Server for a domain') if File.file?('Domain')
|
21
|
+
|
22
|
+
desc 'sql_database', 'generate SQL database adapter'
|
23
|
+
register(Hecks::Domain::Adapters::SQLDatabase::CLI::GenerateSQLDatabase,
|
24
|
+
'sql_database',
|
25
|
+
'sql_database',
|
26
|
+
'Generate a SQL Server Database adapter') if File.file?('Domain')
|
27
|
+
|
28
|
+
desc 'domain_migrations', 'generate migrations for the sql database adapter based on your domain'
|
29
|
+
register(Hecks::Domain::Adapters::SQLDatabase::CLI::GenerateDomainMigrations,
|
30
|
+
'domain_migrations',
|
31
|
+
'domain_migrations',
|
32
|
+
'Generate Domain Migrations')
|
33
|
+
|
34
|
+
desc 'readme', 'Generate the hecks Readme with the latest examples'
|
35
|
+
end
|
@@ -1,15 +1,12 @@
|
|
1
|
-
require_relative 'generate/generate_lambda_package'
|
2
|
-
require_relative 'generate/generate_binary_package'
|
3
|
-
|
4
1
|
class Package < Thor
|
5
2
|
desc 'lambda', 'lambda'
|
6
|
-
register GenerateLambdaPackage,
|
3
|
+
register Hecks::Packager::CLI::GenerateLambdaPackage,
|
7
4
|
'lambda',
|
8
5
|
'lambda',
|
9
6
|
'Generate Lambda Package'
|
10
7
|
|
11
8
|
desc 'binary', 'binary'
|
12
|
-
register GenerateBinaryPackage,
|
9
|
+
register Hecks::Packager::CLI::GenerateBinaryPackage,
|
13
10
|
'binary',
|
14
11
|
'binary',
|
15
12
|
'Generate Binary Package'
|
data/lib/cli/test.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
class Test < Thor
|
2
|
+
include Thor::Actions
|
3
|
+
|
4
|
+
class_option :no_cache, aliases: '-n', desc: 'download resources', default: false, type: :boolean
|
5
|
+
|
6
|
+
desc 'ci', 'Run and test the generators'
|
7
|
+
def ci
|
8
|
+
examples
|
9
|
+
packages
|
10
|
+
domain_adapters
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'domain_adapters', "run the domain adapter specs"
|
14
|
+
def domain_adapters
|
15
|
+
generate_resource_server('pizza_builder')
|
16
|
+
generate_sql_database('pizza_builder')
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'examples', 'Generate and run the example specs'
|
20
|
+
def examples
|
21
|
+
reset_example('pizza_builder')
|
22
|
+
run('rspec -f d')
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'packages', 'Generate and run the package specs'
|
26
|
+
def packages
|
27
|
+
build_binary_package('pizza_builder')
|
28
|
+
build_lambda_package('pizza_builder')
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def generate_sql_database(name)
|
34
|
+
run("cd ../hecks-examples/#{name} && hecks generate sql_database")
|
35
|
+
end
|
36
|
+
|
37
|
+
def reset_example(name)
|
38
|
+
run("cd ../hecks-examples/#{name} && rm -rf lib")
|
39
|
+
run("cd ../hecks-examples/#{name} && rm -rf spec")
|
40
|
+
run("cd ../hecks-examples/#{name} && hecks new")
|
41
|
+
end
|
42
|
+
|
43
|
+
def build_binary_package(name)
|
44
|
+
run("cd ../hecks-examples/#{name} && hecks package binary #{'-n' if options[:no_cache]}")
|
45
|
+
end
|
46
|
+
|
47
|
+
def build_lambda_package(name)
|
48
|
+
run("cd ../hecks-examples/#{name} && hecks package lambda")
|
49
|
+
end
|
50
|
+
|
51
|
+
def generate_resource_server(name)
|
52
|
+
run("cd ../hecks-examples/#{name} && rm -rf config.ru")
|
53
|
+
run("cd ../hecks-examples/#{name} && hecks generate resource_server")
|
54
|
+
run("cd ../hecks-examples/#{name}")
|
55
|
+
end
|
56
|
+
end
|
data/lib/console/commands.rb
CHANGED
data/lib/hecks.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
|
5
|
-
require_relative '
|
6
|
-
require_relative '
|
7
|
-
require_relative '
|
2
|
+
require 'hecks-application'
|
3
|
+
require 'hecks-domain'
|
4
|
+
require 'hecks-adapters'
|
5
|
+
require_relative 'packager'
|
6
|
+
require_relative 'cli'
|
7
|
+
require_relative 'console'
|
data/lib/packager.rb
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
module Hecks
|
2
|
+
module Packager
|
3
|
+
module CLI
|
4
|
+
class GenerateBinaryPackage < Thor::Group
|
5
|
+
include Thor::Actions
|
6
|
+
|
7
|
+
class_option :cache, aliases: '-c', desc: 'skip downloading resources', default: true, type: :boolean
|
8
|
+
class_option :download, aliases: '-d', desc: 'download', default: true, type: :boolean
|
9
|
+
class_option :reduce_package_size, aliases: '-r', desc: 'delete unneeded cruft in gems', default: true, type: :boolean
|
10
|
+
class_option :latest, aliases: '-l', desc: 'Use the latest gem', default: true, type: :boolean
|
11
|
+
|
12
|
+
HOST = "http://d6r77u77i8pq3.cloudfront.net/releases"
|
13
|
+
OSX_BINARY = "traveling-ruby-20150715-2.2.2-osx.tar.gz"
|
14
|
+
LINUX_BINARY = 'traveling-ruby-20150715-2.2.2-linux-x86_64.tar.gz'
|
15
|
+
GEM_FOLDER = 'traveling-ruby-gems-20150715-2.2.2-osx'
|
16
|
+
MYSQL_GEM = 'mysql2-0.3.18.tar.gz'
|
17
|
+
BUILD_DIR = 'packages/binary/build'
|
18
|
+
GEM_SERVER = 'http://0.0.0.0:8808'
|
19
|
+
RESOURCES_DIR = BUILD_DIR + '/resources'
|
20
|
+
OSX_DIR = BUILD_DIR + '/osx'
|
21
|
+
OSX_LIB_DIR = OSX_DIR + '/lib'
|
22
|
+
OSX_APP_DIR = OSX_LIB_DIR + '/app'
|
23
|
+
LINUX_DIR = BUILD_DIR + '/linux-x86_64'
|
24
|
+
LINUX_LIB_DIR = LINUX_DIR + 'lib'
|
25
|
+
LINUX_APP_DIR = LINUX_LIB_DIR + '/app'
|
26
|
+
HECKS_GEMS = %w(
|
27
|
+
hecks-application
|
28
|
+
hecks-adapters
|
29
|
+
hecks-adapters-sql-database
|
30
|
+
hecks-adapters-resource-server
|
31
|
+
hecks-domain
|
32
|
+
)
|
33
|
+
|
34
|
+
def self.source_root
|
35
|
+
File.dirname(__FILE__) + '/templates'
|
36
|
+
end
|
37
|
+
|
38
|
+
def create_package_folder
|
39
|
+
directory('binary_package', './packages/binary')
|
40
|
+
end
|
41
|
+
|
42
|
+
def domain_name
|
43
|
+
Dir.pwd.split('/').last
|
44
|
+
end
|
45
|
+
|
46
|
+
def build
|
47
|
+
package(OSX_APP_DIR, OSX_LIB_DIR, OSX_BINARY, OSX_DIR)
|
48
|
+
# package(LINUX_APP_DIR, LINUX_LIB_DIR, LINUX_BINARY, LINUX_DIR)
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def package(app_dir, lib_dir, binary, package_dir)
|
54
|
+
empty_directory(app_dir)
|
55
|
+
empty_directory(lib_dir + '/ruby')
|
56
|
+
if refresh_cache?(app_dir)
|
57
|
+
download_binary(binary, lib_dir) if options[:download]
|
58
|
+
download_gem(MYSQL_GEM, RESOURCES_DIR) if options[:download]
|
59
|
+
end
|
60
|
+
copy_resources(app_dir, package_dir)
|
61
|
+
bundle_with_ruby_2_2_2(app_dir)
|
62
|
+
remove_native_extensions
|
63
|
+
unpack_gem(MYSQL_GEM, OSX_APP_DIR)
|
64
|
+
reduce_package_size(app_dir) if options[:reduce_package_size]
|
65
|
+
end
|
66
|
+
|
67
|
+
def unpack_gem(ruby_gem, lib_dir)
|
68
|
+
run("tar -xzf #{RESOURCES_DIR}/#{ruby_gem} -C #{OSX_APP_DIR}/vendor/ruby")
|
69
|
+
end
|
70
|
+
|
71
|
+
def remove_native_extensions
|
72
|
+
run("rm -rf #{OSX_APP_DIR}/vendor/ruby/*/extensions")
|
73
|
+
run("find #{OSX_APP_DIR}/vendor/ruby/*/gems -name '*.so' | xargs rm -f")
|
74
|
+
run("find #{OSX_APP_DIR}/vendor/ruby/*/gems -name '*.bundle' | xargs rm -f")
|
75
|
+
run("find #{OSX_APP_DIR}/vendor/ruby/*/gems -name '*.o' | xargs rm -f")
|
76
|
+
end
|
77
|
+
|
78
|
+
def refresh_cache?(app_dir)
|
79
|
+
return true if options[:no_cache]
|
80
|
+
return Dir[app_dir + '/*'].empty?
|
81
|
+
end
|
82
|
+
|
83
|
+
def copy_resources(app_dir, package_dir)
|
84
|
+
template "Gemfile", "#{RESOURCES_DIR}/Gemfile"
|
85
|
+
run("cp -rf #{RESOURCES_DIR}/Gemfile #{app_dir}/Gemfile")
|
86
|
+
run("cp -rf #{RESOURCES_DIR}/bundle #{app_dir}/.bundle")
|
87
|
+
run("cp -rf #{RESOURCES_DIR}/#{domain_name}.rb #{app_dir}/#{domain_name}.rb")
|
88
|
+
run("cp -rf #{RESOURCES_DIR}/wrapper #{package_dir}/#{domain_name}")
|
89
|
+
run("cd #{package_dir} && chmod 744 #{domain_name}")
|
90
|
+
end
|
91
|
+
|
92
|
+
def download_binary(binary, lib_dir)
|
93
|
+
run("cd #{RESOURCES_DIR} && curl -O #{HOST}/#{binary}")
|
94
|
+
run("tar -xzf #{RESOURCES_DIR}/#{binary} -C #{lib_dir}/ruby")
|
95
|
+
end
|
96
|
+
|
97
|
+
def download_gem(ruby_gem, lib_dir)
|
98
|
+
run("cd #{RESOURCES_DIR} && curl -O #{HOST}/#{GEM_FOLDER}/#{ruby_gem}")
|
99
|
+
end
|
100
|
+
|
101
|
+
def bundle_with_ruby_2_2_2(app_dir)
|
102
|
+
run("cp -rf #{RESOURCES_DIR}/Dockerfile #{app_dir}")
|
103
|
+
run("cp #{domain_name}-0.0.0.gem #{app_dir}")
|
104
|
+
fetch_gems(app_dir)
|
105
|
+
run("cd #{app_dir} && docker build -t #{domain_name} --no-cache .")
|
106
|
+
container = `docker create pizza_builder:latest`.gsub("\n", '')
|
107
|
+
run("docker cp #{container}:/usr/src/app/vendor #{app_dir}")
|
108
|
+
end
|
109
|
+
|
110
|
+
def fetch_gems(app_dir)
|
111
|
+
return unless options[:latest]
|
112
|
+
|
113
|
+
HECKS_GEMS.each do |name|
|
114
|
+
run("cd #{app_dir} && gem fetch #{name} -s #{GEM_SERVER}")
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def reduce_package_size(app_dir)
|
119
|
+
files = %w(test tests spec features benchmark README* CHANGE* Change*
|
120
|
+
COPYING* LICENSE* MIT-LICENSE* TODO *.txt *.md *.rdoc doc docs
|
121
|
+
example examples sample doc-api)
|
122
|
+
|
123
|
+
files.each do |file|
|
124
|
+
run("rm -rf #{app_dir}/vendor/ruby/*/gems/*/#{file}")
|
125
|
+
end
|
126
|
+
|
127
|
+
run("rm -rf #{app_dir}/vendor/*/*/cache/*")
|
128
|
+
|
129
|
+
%w(.gitignore .travis.yml).each do |file|
|
130
|
+
run("rm -rf #{app_dir}/vendor/ruby/*/gems/*/#{file}")
|
131
|
+
end
|
132
|
+
|
133
|
+
%w(MAKEfile */Makefile */tmp).each do |file|
|
134
|
+
run("rm -f #{app_dir}/vendor/ruby/*/gems/*/ext/#{file}")
|
135
|
+
end
|
136
|
+
%w(*.c *.cpp *.h *.rl *extconf.rb *.java *.class *.md).each do |file|
|
137
|
+
run("find #{app_dir}/vendor/ruby -name '#{file}' | xargs rm -f")
|
138
|
+
end
|
139
|
+
%w(*.0 *.so *.bundle).each do |file|
|
140
|
+
run("find #{app_dir}/vendor/ruby/*/gems -name '#{file}' | xargs rm -f")
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Hecks
|
2
|
+
module Packager
|
3
|
+
module CLI
|
4
|
+
class GenerateLambdaPackage < Thor::Group
|
5
|
+
include Thor::Actions
|
6
|
+
|
7
|
+
def self.source_root
|
8
|
+
File.dirname(__FILE__) + '/templates'
|
9
|
+
end
|
10
|
+
|
11
|
+
def create_package_folder
|
12
|
+
directory('lambda_package', './packages/lambda')
|
13
|
+
end
|
14
|
+
|
15
|
+
def domain_name
|
16
|
+
Dir.pwd.split('/').last
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_function
|
20
|
+
run("rm -rf packages/lambda/#{domain_name}")
|
21
|
+
run("cp -r packages/binary/build/osx packages/lambda/#{domain_name}")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
File without changes
|
@@ -1,7 +1,11 @@
|
|
1
|
-
require 'hecks'
|
1
|
+
require 'hecks-application'
|
2
|
+
require 'hecks-adapters'
|
2
3
|
require '<%= domain_name %>'
|
3
4
|
|
4
|
-
app = Hecks::
|
5
|
+
app = Hecks::Application.new(
|
6
|
+
domain: <%= domain_name.camelcase %>,
|
7
|
+
database: Hecks::Adapters::SQLDatabase
|
8
|
+
)
|
5
9
|
|
6
10
|
# Ruby 2.2.2 doesn't support Fixnum#positive?, so monkey patch it.
|
7
11
|
class Fixnum
|
@@ -0,0 +1,14 @@
|
|
1
|
+
FROM ruby:2.2
|
2
|
+
|
3
|
+
COPY *.gem /usr/src/app/
|
4
|
+
|
5
|
+
RUN cd /usr/src/app/ && gem install hecks-adapters -v <%= Hecks.version %>
|
6
|
+
RUN cd /usr/src/app/ && gem install hecks-adapters-resource-server -v <%= Hecks.version %>
|
7
|
+
RUN cd /usr/src/app/ && gem install hecks-adapters-sql-database -v <%= Hecks.version %>
|
8
|
+
RUN cd /usr/src/app/ && gem install hecks-adapters-resource-server -v <%= Hecks.version %>
|
9
|
+
RUN cd /usr/src/app/ && gem install hecks-domain -v <%= Hecks.version %>
|
10
|
+
RUN cd /usr/src/app/ && gem install <%= domain_name %>
|
11
|
+
|
12
|
+
COPY Gemfile /usr/src/app/Gemfile
|
13
|
+
RUN cd /usr/src/app/ && bundle package
|
14
|
+
RUN cd /usr/src/app/ && bundle install --path vendor
|
data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/bundle/config
RENAMED
File without changes
|
data/lib/{cli/commands/generate → packager}/templates/binary_package/build/resources/wrapper.tt
RENAMED
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hecks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Young
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: hecks-application
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.1.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: hecks-domain
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.1.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: hecks-adapters
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.2
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: 0.1.2
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: codeclimate-test-reporter
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,20 +122,6 @@ dependencies:
|
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0.10'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: thor
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0.19'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0.19'
|
125
125
|
description: Make the Domain the center of your programming world
|
126
126
|
email: chris@example.com
|
127
127
|
executables:
|
@@ -132,76 +132,27 @@ extra_rdoc_files: []
|
|
132
132
|
files:
|
133
133
|
- bin/hecks
|
134
134
|
- bin/hecks_console
|
135
|
-
- lib/
|
136
|
-
- lib/
|
137
|
-
- lib/adapters/logger/logger.rb
|
138
|
-
- lib/adapters/memory_database/memory_database.rb
|
139
|
-
- lib/adapters/resource_server/methods.rb
|
140
|
-
- lib/adapters/resource_server/methods/create.rb
|
141
|
-
- lib/adapters/resource_server/methods/delete.rb
|
142
|
-
- lib/adapters/resource_server/methods/read.rb
|
143
|
-
- lib/adapters/resource_server/methods/update.rb
|
144
|
-
- lib/adapters/resource_server/resource_server.rb
|
145
|
-
- lib/adapters/validator/validator.rb
|
146
|
-
- lib/application/application.rb
|
147
|
-
- lib/application/commands/commands.rb
|
148
|
-
- lib/application/commands/create.rb
|
149
|
-
- lib/application/commands/crud_handler.rb
|
150
|
-
- lib/application/commands/delete.rb
|
151
|
-
- lib/application/commands/runner.rb
|
152
|
-
- lib/application/commands/update.rb
|
153
|
-
- lib/application/queries/find_by_id.rb
|
154
|
-
- lib/application/queries/queries.rb
|
155
|
-
- lib/application/queries/query_runner.rb
|
156
|
-
- lib/cli/cli.rb
|
135
|
+
- lib/cli.rb
|
136
|
+
- lib/cli/build.rb
|
157
137
|
- lib/cli/command_runner.rb
|
158
|
-
- lib/cli/
|
159
|
-
- lib/cli/
|
160
|
-
- lib/cli/
|
161
|
-
- lib/cli/
|
162
|
-
- lib/
|
163
|
-
- lib/cli/commands/generate/builder/aggregate_command_line_builder.rb
|
164
|
-
- lib/cli/commands/generate/builder/reference_command_line_builder.rb
|
165
|
-
- lib/cli/commands/generate/builder/value_object_command_line_builder.rb
|
166
|
-
- lib/cli/commands/generate/generate_aws_package.rb
|
167
|
-
- lib/cli/commands/generate/generate_binary_package.rb
|
168
|
-
- lib/cli/commands/generate/generate_domain_object.rb
|
169
|
-
- lib/cli/commands/generate/generate_domain_object/assignment_template.rb
|
170
|
-
- lib/cli/commands/generate/generate_domain_object/option_formatter.rb
|
171
|
-
- lib/cli/commands/generate/generate_lambda_package.rb
|
172
|
-
- lib/cli/commands/generate/generate_resource_server.rb
|
173
|
-
- lib/cli/commands/generate/new.rb
|
174
|
-
- lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/%head_name%.rb.tt
|
175
|
-
- lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/%name%.rb.tt
|
176
|
-
- lib/cli/commands/generate/templates/aggregate/lib/domain/%name%/repository.rb.tt
|
177
|
-
- lib/cli/commands/generate/templates/binary_package/build/linux-x86_64/lib/app/hello.rb
|
178
|
-
- lib/cli/commands/generate/templates/binary_package/build/resources/%domain_name%.rb.tt
|
179
|
-
- lib/cli/commands/generate/templates/binary_package/build/resources/Dockerfile.tt
|
180
|
-
- lib/cli/commands/generate/templates/binary_package/build/resources/Gemfile.tt
|
181
|
-
- lib/cli/commands/generate/templates/binary_package/build/resources/bundle/config
|
182
|
-
- lib/cli/commands/generate/templates/binary_package/build/resources/wrapper.tt
|
183
|
-
- lib/cli/commands/generate/templates/domain/%name%.gemspec.tt
|
184
|
-
- lib/cli/commands/generate/templates/domain/Version
|
185
|
-
- lib/cli/commands/generate/templates/domain/lib/%name%.rb.tt
|
186
|
-
- lib/cli/commands/generate/templates/domain/spec/spec_helper.rb.tt
|
187
|
-
- lib/cli/commands/generate/templates/lambda_package/handler.js.tt
|
188
|
-
- lib/cli/commands/generate/templates/lambda_package/serverless.yml.tt
|
189
|
-
- lib/cli/commands/generate/templates/reference/lib/domain/%module_name%/%file_name%.rb.tt
|
190
|
-
- lib/cli/commands/generate/templates/resource_server/config.ru.tt
|
191
|
-
- lib/cli/commands/generate/templates/value_object/lib/domain/%module_name%/%name%.rb.tt
|
192
|
-
- lib/cli/commands/package.rb
|
193
|
-
- lib/cli/commands/test.rb
|
138
|
+
- lib/cli/console.rb
|
139
|
+
- lib/cli/generate.rb
|
140
|
+
- lib/cli/package.rb
|
141
|
+
- lib/cli/test.rb
|
142
|
+
- lib/console.rb
|
194
143
|
- lib/console/commands.rb
|
195
|
-
- lib/console/console.rb
|
196
|
-
- lib/domain_builder/attribute.rb
|
197
|
-
- lib/domain_builder/domain.rb
|
198
|
-
- lib/domain_builder/domain_builder.rb
|
199
|
-
- lib/domain_builder/domain_module.rb
|
200
|
-
- lib/domain_builder/domain_object.rb
|
201
|
-
- lib/domain_builder/head.rb
|
202
|
-
- lib/domain_builder/reference.rb
|
203
|
-
- lib/domain_builder/value.rb
|
204
144
|
- lib/hecks.rb
|
145
|
+
- lib/packager.rb
|
146
|
+
- lib/packager/generate_binary_package.rb
|
147
|
+
- lib/packager/generate_lambda_package.rb
|
148
|
+
- lib/packager/templates/Gemfile.tt
|
149
|
+
- lib/packager/templates/binary_package/build/linux-x86_64/lib/app/hello.rb
|
150
|
+
- lib/packager/templates/binary_package/build/resources/%domain_name%.rb.tt
|
151
|
+
- lib/packager/templates/binary_package/build/resources/Dockerfile.tt
|
152
|
+
- lib/packager/templates/binary_package/build/resources/bundle/config
|
153
|
+
- lib/packager/templates/binary_package/build/resources/wrapper.tt
|
154
|
+
- lib/packager/templates/lambda_package/handler.js.tt
|
155
|
+
- lib/packager/templates/lambda_package/serverless.yml.tt
|
205
156
|
homepage: https://github.com/chrisyoung/heckson
|
206
157
|
licenses:
|
207
158
|
- MIT
|
@@ -222,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
173
|
version: '0'
|
223
174
|
requirements: []
|
224
175
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.6.
|
176
|
+
rubygems_version: 2.6.10
|
226
177
|
signing_key:
|
227
178
|
specification_version: 4
|
228
179
|
summary: DDD and Hexagonal Code Generators
|