threeman 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.threeman +2 -1
- data/CHANGELOG.md +4 -0
- data/lib/threeman/cli.rb +13 -1
- data/lib/threeman/procfile.rb +5 -2
- data/lib/threeman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e049b805d8a91707480d78ed24ae471b9e8d4da692ba5f9a0095677a43a268e6
|
4
|
+
data.tar.gz: 7f8498eca7ceb29bf5e40fd2cd0f19c5483c51c32d2bff56f27d51b9ab313ef5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bec2a0d1d0376a21a838e2f44f779ac7f8d40a0fd55a3362c20b25305c77020b4f472eb3c763be39b4a65d7668faebb92a8a97578f70cfa77d56b05b31e4ea0d
|
7
|
+
data.tar.gz: ee1301e72572dc63fa62adfc3641acbc63e7fa3440def31094621235b7e96710dbc6737c57d398cdaa3b38098e89b46755f74035e8b4f231e539ebd2d9ca2254
|
data/.threeman
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/threeman/cli.rb
CHANGED
@@ -26,6 +26,7 @@ module Threeman
|
|
26
26
|
option :layout_name, desc: "If using tmux, the layout name to use for paned commands", type: :string
|
27
27
|
option :procfile, desc: "Procfile file name", default: "Procfile", aliases: "-f"
|
28
28
|
option :root, desc: "Directory of Procfile", aliases: "-d"
|
29
|
+
option :formation, aliases: '-m'
|
29
30
|
option(
|
30
31
|
:open_in_new_tab,
|
31
32
|
desc: "If using iterm3, configure how threeman opens",
|
@@ -51,7 +52,8 @@ module Threeman
|
|
51
52
|
procfile_name = options[:procfile]
|
52
53
|
pwd = options[:root] || Dir.pwd
|
53
54
|
procfile = Threeman::Procfile.new(File.expand_path(procfile_name, pwd))
|
54
|
-
|
55
|
+
formation = parse_formation(options[:formation])
|
56
|
+
commands = procfile.commands(pwd, options[:port] || 5000, options[:command_prefix], formation)
|
55
57
|
|
56
58
|
frontend_name = options[:frontend] || auto_frontend
|
57
59
|
unless frontend_name
|
@@ -115,5 +117,15 @@ module Threeman
|
|
115
117
|
def dotfile
|
116
118
|
@dotfile ||= ['.threeman', '.foreman'].find { |filename| File.file?(filename) }
|
117
119
|
end
|
120
|
+
|
121
|
+
def parse_formation(formation)
|
122
|
+
pairs = formation.to_s.gsub(/\s/, "").split(",")
|
123
|
+
|
124
|
+
pairs.inject(Hash.new(0)) do |ax, pair|
|
125
|
+
process, amount = pair.split("=")
|
126
|
+
process == "all" ? ax.default = amount.to_i : ax[process] = amount.to_i
|
127
|
+
ax
|
128
|
+
end
|
129
|
+
end
|
118
130
|
end
|
119
131
|
end
|
data/lib/threeman/procfile.rb
CHANGED
@@ -3,12 +3,15 @@ require 'threeman/command'
|
|
3
3
|
|
4
4
|
module Threeman
|
5
5
|
class Procfile < Foreman::Procfile
|
6
|
-
def commands(workdir, port, command_prefix)
|
6
|
+
def commands(workdir, port, command_prefix, formation)
|
7
7
|
commands = []
|
8
8
|
|
9
9
|
entries do |name, command|
|
10
|
+
count = formation[name]
|
10
11
|
command_with_prefix = [command_prefix, command].compact.join(' ')
|
11
|
-
|
12
|
+
(0...count).each do |index|
|
13
|
+
commands << Threeman::Command.new(name, command_with_prefix, workdir, port + index)
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
commands
|
data/lib/threeman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: threeman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Budin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman
|