iron_worker_ng 0.10.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/bin/iron_worker +130 -323
  2. data/lib/iron_worker_ng/cli.rb +275 -0
  3. data/lib/iron_worker_ng/client.rb +32 -20
  4. data/lib/iron_worker_ng/code/base.rb +45 -37
  5. data/lib/iron_worker_ng/code/builder.rb +4 -3
  6. data/lib/iron_worker_ng/code/container/base.rb +31 -0
  7. data/lib/iron_worker_ng/code/container/dir.rb +31 -0
  8. data/lib/iron_worker_ng/code/container/zip.rb +30 -0
  9. data/lib/iron_worker_ng/code/runtime/binary.rb +1 -3
  10. data/lib/iron_worker_ng/code/runtime/go.rb +1 -3
  11. data/lib/iron_worker_ng/code/runtime/java.rb +2 -3
  12. data/lib/iron_worker_ng/code/runtime/mono.rb +1 -3
  13. data/lib/iron_worker_ng/code/runtime/node.rb +1 -3
  14. data/lib/iron_worker_ng/code/runtime/perl.rb +1 -3
  15. data/lib/iron_worker_ng/code/runtime/php.rb +1 -3
  16. data/lib/iron_worker_ng/code/runtime/python.rb +1 -3
  17. data/lib/iron_worker_ng/code/runtime/ruby.rb +11 -9
  18. data/lib/iron_worker_ng/feature/base.rb +14 -20
  19. data/lib/iron_worker_ng/feature/common/merge_dir.rb +14 -5
  20. data/lib/iron_worker_ng/feature/common/merge_exec.rb +79 -0
  21. data/lib/iron_worker_ng/feature/common/merge_file.rb +13 -4
  22. data/lib/iron_worker_ng/feature/java/merge_jar.rb +12 -0
  23. data/lib/iron_worker_ng/feature/ruby/merge_gem.rb +11 -55
  24. data/lib/iron_worker_ng/feature/ruby/merge_gem_dependency.rb +76 -0
  25. data/lib/iron_worker_ng/fetcher.rb +39 -18
  26. data/lib/iron_worker_ng/version.rb +1 -1
  27. metadata +45 -17
  28. data/lib/iron_worker_ng/code/dir_container.rb +0 -33
  29. data/lib/iron_worker_ng/feature/binary/merge_exec.rb +0 -51
  30. data/lib/iron_worker_ng/feature/go/merge_exec.rb +0 -51
  31. data/lib/iron_worker_ng/feature/java/merge_exec.rb +0 -57
  32. data/lib/iron_worker_ng/feature/mono/merge_exec.rb +0 -51
  33. data/lib/iron_worker_ng/feature/node/merge_exec.rb +0 -51
  34. data/lib/iron_worker_ng/feature/perl/merge_exec.rb +0 -51
  35. data/lib/iron_worker_ng/feature/php/merge_exec.rb +0 -51
  36. data/lib/iron_worker_ng/feature/python/merge_exec.rb +0 -51
  37. data/lib/iron_worker_ng/feature/ruby/merge_exec.rb +0 -53
@@ -1,51 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Binary
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
-
8
- def initialize(code, path)
9
- super(code)
10
-
11
- @path = path
12
- end
13
-
14
- def hash_string
15
- Digest::MD5.hexdigest(@path + File.mtime(rebase(@path)).to_i.to_s)
16
- end
17
-
18
- def bundle(container)
19
- IronCore::Logger.debug 'IronWorkerNG', "Bundling binary exec with path='#{@path}'"
20
-
21
- container_add(container, File.basename(@path), rebase(@path))
22
- end
23
- end
24
-
25
- module InstanceMethods
26
- def merge_exec(path=nil)
27
- @exec ||= nil
28
-
29
- return @exec unless path
30
-
31
- unless @exec.nil?
32
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge binary exec with path='#{path}'"
33
- return
34
- end
35
-
36
- @exec = IronWorkerNG::Feature::Binary::MergeExec::Feature.new(self, path)
37
-
38
- IronCore::Logger.info 'IronWorkerNG', "Detected binary exec with path='#{path}'"
39
-
40
- @features << @exec
41
- end
42
-
43
- alias :exec :merge_exec
44
-
45
- alias :merge_worker :merge_exec
46
- alias :worker :merge_worker
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,51 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Go
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
-
8
- def initialize(code, path)
9
- super(code)
10
-
11
- @path = path
12
- end
13
-
14
- def hash_string
15
- Digest::MD5.hexdigest(@path + File.mtime(rebase(@path)).to_i.to_s)
16
- end
17
-
18
- def bundle(container)
19
- IronCore::Logger.debug 'IronWorkerNG', "Bundling go exec with path='#{@path}'"
20
-
21
- container_add(container, File.basename(@path), rebase(@path))
22
- end
23
- end
24
-
25
- module InstanceMethods
26
- def merge_exec(path=nil)
27
- @exec ||= nil
28
-
29
- return @exec unless path
30
-
31
- unless @exec.nil?
32
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge go exec with path='#{path}'"
33
- return
34
- end
35
-
36
- @exec = IronWorkerNG::Feature::Go::MergeExec::Feature.new(self, path)
37
-
38
- IronCore::Logger.info 'IronWorkerNG', "Detected go exec with path='#{path}'"
39
-
40
- @features << @exec
41
- end
42
-
43
- alias :exec :merge_exec
44
-
45
- alias :merge_worker :merge_exec
46
- alias :worker :merge_worker
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,57 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Java
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
- attr_reader :klass
8
-
9
- def initialize(code, path, klass)
10
- super(code)
11
-
12
- @path = path
13
- @klass = klass
14
- end
15
-
16
- def hash_string
17
- Digest::MD5.hexdigest(@path + @klass + File.mtime(rebase(@path)).to_i.to_s)
18
- end
19
-
20
- def bundle(container)
21
- IronCore::Logger.debug 'IronWorkerNG', "Bundling java exec with path='#{@path}' and class='#{@klass}'"
22
-
23
- container_add(container, File.basename(@path), rebase(@path))
24
- end
25
-
26
- def code_for_classpath
27
- File.basename(@path)
28
- end
29
- end
30
-
31
- module InstanceMethods
32
- def merge_exec(path = nil, klass = nil)
33
- @exec ||= nil
34
-
35
- return @exec unless path
36
-
37
- unless @exec.nil?
38
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge java exec with path='#{path}' and class='#{klass}'"
39
- return
40
- end
41
-
42
- @exec = IronWorkerNG::Feature::Java::MergeExec::Feature.new(self, path, klass)
43
-
44
- IronCore::Logger.info 'IronWorkerNG', "Detected java exec with path='#{path}'#{klass.nil? ? '' : " and class='#{klass}'"}"
45
-
46
- @features << @exec
47
- end
48
-
49
- alias :exec :merge_exec
50
-
51
- alias :merge_worker :merge_exec
52
- alias :worker :merge_worker
53
- end
54
- end
55
- end
56
- end
57
- end
@@ -1,51 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Mono
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
-
8
- def initialize(code, path)
9
- super(code)
10
-
11
- @path = path
12
- end
13
-
14
- def hash_string
15
- Digest::MD5.hexdigest(@path + File.mtime(rebase(@path)).to_i.to_s)
16
- end
17
-
18
- def bundle(container)
19
- IronCore::Logger.debug 'IronWorkerNG', "Bundling mono exec with path='#{@path}'"
20
-
21
- container_add(container, File.basename(@path), rebase(@path))
22
- end
23
- end
24
-
25
- module InstanceMethods
26
- def merge_exec(path=nil)
27
- @exec ||= nil
28
-
29
- return @exec unless path
30
-
31
- unless @exec.nil?
32
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge mono exec with path='#{path}'"
33
- return
34
- end
35
-
36
- @exec = IronWorkerNG::Feature::Mono::MergeExec::Feature.new(self, path)
37
-
38
- IronCore::Logger.info 'IronWorkerNG', "Detected mono exec with path='#{path}'"
39
-
40
- @features << @exec
41
- end
42
-
43
- alias :exec :merge_exec
44
-
45
- alias :merge_worker :merge_exec
46
- alias :worker :merge_worker
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,51 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Node
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
-
8
- def initialize(code, path)
9
- super(code)
10
-
11
- @path = path
12
- end
13
-
14
- def hash_string
15
- Digest::MD5.hexdigest(@path + File.mtime(rebase(@path)).to_i.to_s)
16
- end
17
-
18
- def bundle(container)
19
- IronCore::Logger.debug 'IronWorkerNG', "Bundling node exec with path='#{@path}'"
20
-
21
- container_add(container, File.basename(@path), rebase(@path))
22
- end
23
- end
24
-
25
- module InstanceMethods
26
- def merge_exec(path=nil)
27
- @exec ||= nil
28
-
29
- return @exec unless path
30
-
31
- unless @exec.nil?
32
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge node exec with path='#{path}'"
33
- return
34
- end
35
-
36
- @exec = IronWorkerNG::Feature::Node::MergeExec::Feature.new(self, path)
37
-
38
- IronCore::Logger.info 'IronWorkerNG', "Detected node exec with path='#{path}'"
39
-
40
- @features << @exec
41
- end
42
-
43
- alias :exec :merge_exec
44
-
45
- alias :merge_worker :merge_exec
46
- alias :worker :merge_worker
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,51 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Perl
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
-
8
- def initialize(code, path)
9
- super(code)
10
-
11
- @path = path
12
- end
13
-
14
- def hash_string
15
- Digest::MD5.hexdigest(@path + File.mtime(rebase(@path)).to_i.to_s)
16
- end
17
-
18
- def bundle(container)
19
- IronCore::Logger.debug 'IronWorkerNG', "Bundling perl exec with path='#{@path}'"
20
-
21
- container_add(container, File.basename(@path), rebase(@path))
22
- end
23
- end
24
-
25
- module InstanceMethods
26
- def merge_exec(path=nil)
27
- @exec ||= nil
28
-
29
- return @exec unless path
30
-
31
- unless @exec.nil?
32
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge perl exec with path='#{path}'"
33
- return
34
- end
35
-
36
- @exec = IronWorkerNG::Feature::Perl::MergeExec::Feature.new(self, path)
37
-
38
- IronCore::Logger.info 'IronWorkerNG', "Detected perl exec with path='#{path}'"
39
-
40
- @features << @exec
41
- end
42
-
43
- alias :exec :merge_exec
44
-
45
- alias :merge_worker :merge_exec
46
- alias :worker :merge_worker
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,51 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module PHP
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
-
8
- def initialize(code, path)
9
- super(code)
10
-
11
- @path = path
12
- end
13
-
14
- def hash_string
15
- Digest::MD5.hexdigest(@path + File.mtime(rebase(@path)).to_i.to_s)
16
- end
17
-
18
- def bundle(container)
19
- IronCore::Logger.debug 'IronWorkerNG', "Bundling php exec with path='#{@path}'"
20
-
21
- container_add(container, File.basename(@path), rebase(@path))
22
- end
23
- end
24
-
25
- module InstanceMethods
26
- def merge_exec(path=nil)
27
- @exec ||= nil
28
-
29
- return @exec unless path
30
-
31
- unless @exec.nil?
32
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge php exec with path='#{path}'"
33
- return
34
- end
35
-
36
- @exec = IronWorkerNG::Feature::PHP::MergeExec::Feature.new(self, path)
37
-
38
- IronCore::Logger.info 'IronWorkerNG', "Detected php exec with path='#{path}'"
39
-
40
- @features << @exec
41
- end
42
-
43
- alias :exec :merge_exec
44
-
45
- alias :merge_worker :merge_exec
46
- alias :worker :merge_worker
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,51 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Python
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
-
8
- def initialize(code, path)
9
- super(code)
10
-
11
- @path = path
12
- end
13
-
14
- def hash_string
15
- Digest::MD5.hexdigest(@path + File.mtime(rebase(@path)).to_i.to_s)
16
- end
17
-
18
- def bundle(container)
19
- IronCore::Logger.debug 'IronWorkerNG', "Bundling python exec with path='#{@path}'"
20
-
21
- container_add(container, File.basename(@path), rebase(@path))
22
- end
23
- end
24
-
25
- module InstanceMethods
26
- def merge_exec(path=nil)
27
- @exec ||= nil
28
-
29
- return @exec unless path
30
-
31
- unless @exec.nil?
32
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge python exec with path='#{path}'"
33
- return
34
- end
35
-
36
- @exec = IronWorkerNG::Feature::Python::MergeExec::Feature.new(self, path)
37
-
38
- IronCore::Logger.info 'IronWorkerNG', "Detected python exec with path='#{path}'"
39
-
40
- @features << @exec
41
- end
42
-
43
- alias :exec :merge_exec
44
-
45
- alias :merge_worker :merge_exec
46
- alias :worker :merge_worker
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,53 +0,0 @@
1
- module IronWorkerNG
2
- module Feature
3
- module Ruby
4
- module MergeExec
5
- class Feature < IronWorkerNG::Feature::Base
6
- attr_reader :path
7
- attr_reader :klass
8
-
9
- def initialize(code, path, klass)
10
- super(code)
11
-
12
- @path = path
13
- @klass = klass
14
- end
15
-
16
- def hash_string
17
- Digest::MD5.hexdigest(@path + @klass + File.mtime(rebase(@path)).to_i.to_s)
18
- end
19
-
20
- def bundle(container)
21
- IronCore::Logger.debug 'IronWorkerNG', "Bundling ruby exec with path='#{path}' and class='#{klass}'"
22
-
23
- container_add(container, File.basename(@path), rebase(@path))
24
- end
25
- end
26
-
27
- module InstanceMethods
28
- def merge_exec(path = nil, klass = nil)
29
- @exec ||= nil
30
-
31
- return @exec unless path
32
-
33
- unless @exec.nil?
34
- IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge ruby exec with path='#{path}' and class='#{klass}'"
35
- return
36
- end
37
-
38
- @exec = IronWorkerNG::Feature::Ruby::MergeExec::Feature.new(self, path, klass)
39
-
40
- IronCore::Logger.info 'IronWorkerNG', "Detected ruby exec with path='#{path}'#{klass.nil? ? '' : " and class='#{klass}'"}"
41
-
42
- @features << @exec
43
- end
44
-
45
- alias :exec :merge_exec
46
-
47
- alias :merge_worker :merge_exec
48
- alias :worker :merge_worker
49
- end
50
- end
51
- end
52
- end
53
- end