threeman 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -2
- data/lib/threeman/cli.rb +24 -2
- data/lib/threeman/frontends/iterm3.rb +11 -1
- data/lib/threeman/version.rb +1 -1
- data/threeman.gemspec +2 -2
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5a38286d26038200e32dd5ac06d159c9097bddd265554955765194506492eb2a
|
4
|
+
data.tar.gz: '03117213615048aecb66b64f17b17036068090086c76ddf8eb4b132bc879d4fb'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f93fe78bf87ab7c39f55d678c05bbf337b3e7afe913b4a04349420ba3568c68fb911d06b4ff0aa1cb30d2fcdc8cfdcaa4ac14901e6a837dd0a801465236accd2
|
7
|
+
data.tar.gz: 39aa4cdfafee6125a8bab217d6527ed9250063b3150ae9141cbc681db117096aad0a0758c79f50ac634d45f991d6da2c5355671d6175286c99339c38cbd05f30
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Threeman
|
2
2
|
|
3
|
-
Threeman is an alternative to [Foreman](https://github.com/ddollar/foreman). Rather than running all the commands together in one terminal, it opens a
|
3
|
+
Threeman is an alternative to [Foreman](https://github.com/ddollar/foreman). Rather than running all the commands together in one terminal, it opens a tab for each command. The benefits of this are:
|
4
4
|
|
5
5
|
* Your terminal app will notify you using an icon when there's new output from each command
|
6
6
|
* Because your command's input and output aren't being intercepted by Foreman, you can use [Pry](http://pryrepl.org)
|
@@ -9,6 +9,7 @@ Threeman also has an extensible architecture to allow it to support multiple ter
|
|
9
9
|
|
10
10
|
* iTerm 2.9 and above
|
11
11
|
* Mac OS X's built-in Terminal app
|
12
|
+
* tmux
|
12
13
|
|
13
14
|
## Installation
|
14
15
|
|
@@ -36,7 +37,7 @@ will cause Threeman to run the app with the `PORT` environment variable set to 3
|
|
36
37
|
|
37
38
|
## Development
|
38
39
|
|
39
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
40
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
40
41
|
|
41
42
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
42
43
|
|
data/lib/threeman/cli.rb
CHANGED
@@ -23,9 +23,22 @@ module Threeman
|
|
23
23
|
|
24
24
|
desc "start", "Start the application"
|
25
25
|
option :frontend, desc: "Which frontend to use. One of: #{FRONTENDS.keys.sort.join(', ')}"
|
26
|
-
option :panes, desc: "Runs each command in a pane, if supported by the frontend. (Currently supported in iterm3 and tmux.)", type: :array
|
27
|
-
option :port, desc: "The port to run the application on. This will set the PORT environment variable.", type: :numeric
|
28
26
|
option :layout_name, desc: "If using tmux, the layout name to use for paned commands", type: :string
|
27
|
+
option(
|
28
|
+
:open_in_new_tab,
|
29
|
+
desc: "If using iterm3, configure how threeman opens",
|
30
|
+
type: :boolean
|
31
|
+
)
|
32
|
+
option(
|
33
|
+
:panes,
|
34
|
+
desc: "Runs each command in a pane, if supported by the frontend. (Currently supported in iterm3 and tmux.)",
|
35
|
+
type: :array
|
36
|
+
)
|
37
|
+
option(
|
38
|
+
:port,
|
39
|
+
desc: "The port to run the application on. This will set the PORT environment variable.",
|
40
|
+
type: :numeric
|
41
|
+
)
|
29
42
|
|
30
43
|
def start
|
31
44
|
pwd = Dir.pwd
|
@@ -39,10 +52,19 @@ module Threeman
|
|
39
52
|
exit! 1
|
40
53
|
end
|
41
54
|
|
55
|
+
valid_frontend_open_option?(frontend_name) if options[:open_in_new_tab]
|
56
|
+
|
42
57
|
frontend(frontend_name, options).run_commands(commands)
|
43
58
|
end
|
44
59
|
|
45
60
|
private
|
61
|
+
def valid_frontend_open_option?(frontend_name)
|
62
|
+
unless frontend_name == :iterm3
|
63
|
+
puts "Opening in a new tab is only supported for iterm3"
|
64
|
+
exit! 1
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
46
68
|
def frontend(name, options = {})
|
47
69
|
frontend_lambda = FRONTENDS[name.to_sym]
|
48
70
|
unless frontend_lambda
|
@@ -12,7 +12,7 @@ module Threeman
|
|
12
12
|
def run_commands(commands)
|
13
13
|
iterm = Appscript.app("iTerm")
|
14
14
|
iterm.activate
|
15
|
-
window = iterm
|
15
|
+
window = open_option(iterm)
|
16
16
|
|
17
17
|
sort_commands(commands).each_with_index do |command, index|
|
18
18
|
current_tab = if index == 0
|
@@ -35,6 +35,16 @@ module Threeman
|
|
35
35
|
bash_cmd = "bash -c #{Shellwords.escape bash_script(command)}"
|
36
36
|
session.write(text: [cd_cmd, bash_cmd].join("\n"))
|
37
37
|
end
|
38
|
+
|
39
|
+
def open_option(iterm)
|
40
|
+
if options[:open_in_new_tab]
|
41
|
+
current_window = iterm.current_window
|
42
|
+
current_window.create_tab_with_default_profile
|
43
|
+
current_window
|
44
|
+
else
|
45
|
+
iterm.create_window_with_default_profile
|
46
|
+
end
|
47
|
+
end
|
38
48
|
end
|
39
49
|
end
|
40
50
|
end
|
data/lib/threeman/version.rb
CHANGED
data/threeman.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Nat Budin"]
|
10
10
|
spec.email = ["nbudin@patientslikeme.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{Runs Procfile commands in
|
13
|
-
spec.description = %q{An alternative to Foreman
|
12
|
+
spec.summary = %q{Runs Procfile commands in tabs}
|
13
|
+
spec.description = %q{An alternative to Foreman, which runs each command in a separate tab}
|
14
14
|
spec.homepage = "https://github.com/patientslikeme/threeman"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
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.6.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: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman
|
@@ -94,8 +94,7 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
description: An alternative to Foreman
|
98
|
-
separate iTerm 2 tab
|
97
|
+
description: An alternative to Foreman, which runs each command in a separate tab
|
99
98
|
email:
|
100
99
|
- nbudin@patientslikeme.com
|
101
100
|
executables:
|
@@ -146,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
145
|
version: '0'
|
147
146
|
requirements: []
|
148
147
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.7.3
|
150
149
|
signing_key:
|
151
150
|
specification_version: 4
|
152
|
-
summary: Runs Procfile commands in
|
151
|
+
summary: Runs Procfile commands in tabs
|
153
152
|
test_files: []
|