flight-router 0.1.15 → 0.1.16
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/CHANGELOG/0.1.16.md +5 -0
- data/lib/flight/router/container.rb +18 -5
- data/lib/flight/router/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9cf91ae07af699660ecb7ce20b12617b5eeb607
|
4
|
+
data.tar.gz: dce7b4e633f2f2c48f560aa9f6ff129a1272c259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f39f597c69900258589d88439c01e302f1d7b4dc8adc5ceebbeaf31907ecc71074f3ea454a84896f3d7e9b7a1de53d6e689b577ee2eef4b829715bf5191b9c2
|
7
|
+
data.tar.gz: 6be43f864da7534e73251cb9349571eec286f9d74564bd04e6bda0e88206b5e300e26e7c5f31bac5cc8cc732146475f5f26d7cb455b5a567438452034f32803c
|
data/CHANGELOG/0.1.16.md
ADDED
@@ -49,6 +49,13 @@ module Flight::Router
|
|
49
49
|
def app
|
50
50
|
@app
|
51
51
|
end
|
52
|
+
def cmd(image,command,**opts)
|
53
|
+
@cmd.push(
|
54
|
+
image: image,
|
55
|
+
command: command,
|
56
|
+
opts: opts,
|
57
|
+
)
|
58
|
+
end
|
52
59
|
|
53
60
|
def config
|
54
61
|
@config ||= {}
|
@@ -78,9 +85,10 @@ module Flight::Router
|
|
78
85
|
|
79
86
|
_app = @app
|
80
87
|
@app = @app.deep_merge(config).deep_merge(opts)
|
81
|
-
|
88
|
+
@cmd = []
|
89
|
+
instance_exec(&block)
|
82
90
|
|
83
|
-
@config[path.join("/")] = @app.deep_merge(commands:
|
91
|
+
@config[path.join("/")] = @app.deep_merge(commands: parse_command(path, @cmd))
|
84
92
|
|
85
93
|
@app = _app
|
86
94
|
end
|
@@ -94,7 +102,11 @@ module Flight::Router
|
|
94
102
|
end
|
95
103
|
|
96
104
|
def parse_command(path,commands)
|
97
|
-
commands.each.with_index(1).map{|
|
105
|
+
commands.each.with_index(1).map{|cmd,i|
|
106
|
+
image = cmd[:image]
|
107
|
+
command = cmd[:command]
|
108
|
+
opts = cmd[:opts]
|
109
|
+
|
98
110
|
unless info = map[:image][image]
|
99
111
|
raise "image not defined: [#{image}]"
|
100
112
|
end
|
@@ -102,12 +114,13 @@ module Flight::Router
|
|
102
114
|
if env || info[:env]
|
103
115
|
puts_env(path, "#{i}.env", (info[:env] || {}).merge(env || {}))
|
104
116
|
end
|
105
|
-
if block = @builder[image] && @builder[image][
|
117
|
+
if block = @builder[image] && @builder[image][command]
|
106
118
|
command_args = instance_exec(**opts,&block)
|
107
119
|
else
|
108
120
|
command_args = opts
|
109
121
|
end
|
110
|
-
|
122
|
+
|
123
|
+
{image: info[:name], command: ["flight_#{image}",command,JSON.generate(command_args)]}
|
111
124
|
}
|
112
125
|
end
|
113
126
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flight-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shun@getto.systems
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- CHANGELOG/0.1.13.md
|
84
84
|
- CHANGELOG/0.1.14.md
|
85
85
|
- CHANGELOG/0.1.15.md
|
86
|
+
- CHANGELOG/0.1.16.md
|
86
87
|
- CHANGELOG/0.1.2.md
|
87
88
|
- CHANGELOG/0.1.3.md
|
88
89
|
- CHANGELOG/0.1.4.md
|