threeman 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +33 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/exe/threeman +5 -0
- data/lib/threeman/cli.rb +43 -0
- data/lib/threeman/version.rb +3 -0
- data/lib/threeman.rb +5 -0
- data/threeman.gemspec +27 -0
- metadata +127 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9cccae68e829a6b71a66c6e3e9a944585d726365
|
4
|
+
data.tar.gz: f2ac755957646e460ab09e45d60cd8a121225c1f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 859c63e1a489a6861ee705ec2ea9a6306d9815548590ed582f8f9e6c90032a26985cdaa930796f5af29a3d6ae227d52c7f57fb3cfe6f2edf2792f6b5e4dc6638
|
7
|
+
data.tar.gz: 8a3a81842ccf89754471db3263ee9bf808a864f20c76131146882c5ffb198bd7fc0183800d3b28693e144c52935da2a225be78718bddeed8d03a1f6c3fe3a3ab
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Threeman
|
2
|
+
|
3
|
+
Threeman is an alternative to [Foreman](https://github.com/ddollar/foreman) for Mac users. Rather than running all the commands together in one terminal, it opens a new [iTerm 2](https://www.iterm2.com) window with each command in a tab. The benefits of this are:
|
4
|
+
|
5
|
+
* iTerm 2 will notify you using an icon when there's new output from each command
|
6
|
+
* Because your command's input and output aren't being intercepted by Foreman, you can use [Pry](http://pryrepl.org)
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Make sure you have [iTerm 2](https://www.iterm2.com/downloads.html) at least version 2.9 installed.
|
11
|
+
|
12
|
+
Run:
|
13
|
+
|
14
|
+
$ gem install threeman
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
From your app's directory (with a Procfile in it), run:
|
19
|
+
|
20
|
+
$ threeman
|
21
|
+
|
22
|
+
Threeman will open a new iTerm 2 window with each of your Procfile commands running in a separate tab.
|
23
|
+
|
24
|
+
## Development
|
25
|
+
|
26
|
+
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.
|
27
|
+
|
28
|
+
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).
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nbudin/threeman.
|
33
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "threeman"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/exe/threeman
ADDED
data/lib/threeman/cli.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'foreman/procfile'
|
2
|
+
require 'shellwords'
|
3
|
+
require 'rb-scpt'
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
module Threeman
|
7
|
+
class CLI < Thor
|
8
|
+
default_task :start
|
9
|
+
|
10
|
+
desc "start", "Start the application"
|
11
|
+
def start
|
12
|
+
iterm = Appscript.app("iTerm")
|
13
|
+
iterm.activate
|
14
|
+
window = iterm.create_window_with_default_profile
|
15
|
+
|
16
|
+
pwd = Dir.pwd
|
17
|
+
|
18
|
+
procfile = Foreman::Procfile.new(File.expand_path("Procfile", pwd))
|
19
|
+
is_first = true
|
20
|
+
procfile.entries do |name, command|
|
21
|
+
current_tab = if is_first
|
22
|
+
window
|
23
|
+
else
|
24
|
+
window.create_tab_with_default_profile
|
25
|
+
end
|
26
|
+
|
27
|
+
run_command(current_tab.current_session, name, pwd, command)
|
28
|
+
is_first = false
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def run_command(session, name, workdir, command)
|
34
|
+
bash_script = [
|
35
|
+
"echo -ne \"\\033]0;#{Shellwords.escape name}\\007\"",
|
36
|
+
"cd #{workdir}",
|
37
|
+
command
|
38
|
+
].join(" ; ")
|
39
|
+
|
40
|
+
session.write(text: "bash -c #{Shellwords.escape bash_script}")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/threeman.rb
ADDED
data/threeman.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'threeman/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "threeman"
|
8
|
+
spec.version = Threeman::VERSION
|
9
|
+
spec.authors = ["Nat Budin"]
|
10
|
+
spec.email = ["nbudin@patientslikeme.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Runs Procfile commands in iTerm 2 tabs}
|
13
|
+
spec.description = %q{An alternative to Foreman for Mac users, which runs each command in a separate iTerm 2 tab}
|
14
|
+
spec.homepage = "https://github.com/nbudin/threeman"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "rb-scpt"
|
22
|
+
spec.add_dependency "foreman"
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "minitest"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: threeman
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nat Budin
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rb-scpt
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: foreman
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.10'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.10'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: An alternative to Foreman for Mac users, which runs each command in a
|
84
|
+
separate iTerm 2 tab
|
85
|
+
email:
|
86
|
+
- nbudin@patientslikeme.com
|
87
|
+
executables:
|
88
|
+
- threeman
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- ".travis.yml"
|
94
|
+
- Gemfile
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- bin/console
|
98
|
+
- bin/setup
|
99
|
+
- exe/threeman
|
100
|
+
- lib/threeman.rb
|
101
|
+
- lib/threeman/cli.rb
|
102
|
+
- lib/threeman/version.rb
|
103
|
+
- threeman.gemspec
|
104
|
+
homepage: https://github.com/nbudin/threeman
|
105
|
+
licenses: []
|
106
|
+
metadata: {}
|
107
|
+
post_install_message:
|
108
|
+
rdoc_options: []
|
109
|
+
require_paths:
|
110
|
+
- lib
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
requirements: []
|
122
|
+
rubyforge_project:
|
123
|
+
rubygems_version: 2.4.5.1
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: Runs Procfile commands in iTerm 2 tabs
|
127
|
+
test_files: []
|