threeman 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -1
- data/lib/threeman/cli.rb +15 -2
- data/lib/threeman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c27245f62909c634dffc2b58459d0274a43b7bd5
|
4
|
+
data.tar.gz: 171dfafb1e03b7511e7b77bafdf244cc46eb2117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 508af4ea8207a1bd4411944b89d75799552d4841209a69f188b129eb6eacfe940fdd87f8737d2344180a32d9badc7345f61ff71eddcfb9207d76b160d29a3cdc
|
7
|
+
data.tar.gz: 7ff53715ab635ebf6ada6f68ac9f2d43e2e00b7903cf32b62a6347ebdbffed6f5ac5bab2f48c8b0198cff89f7b86e8e67dd8541ab62af785c0433abce888eed9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -26,6 +26,14 @@ From your app's directory (with a Procfile in it), run:
|
|
26
26
|
|
27
27
|
Threeman will open a new terminal window with each of your Procfile commands running in a separate tab.
|
28
28
|
|
29
|
+
Threeman also supports reading a `.threeman` or `.foreman` file containing default options in YAML format, just like Foreman does with the `.foreman` file. For example, a `.foreman` file containing:
|
30
|
+
|
31
|
+
```
|
32
|
+
port: 3000
|
33
|
+
```
|
34
|
+
|
35
|
+
will cause Threeman to run the app with the `PORT` environment variable set to 3000.
|
36
|
+
|
29
37
|
## Development
|
30
38
|
|
31
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.
|
@@ -38,5 +46,5 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/patien
|
|
38
46
|
|
39
47
|
## License
|
40
48
|
|
41
|
-
Threeman is © 2016 PatientsLikeMe, Inc. and is released under the MIT License. See the LICENSE file for more information.
|
49
|
+
Threeman is © 2016-2017 PatientsLikeMe, Inc. and is released under the MIT License. See the LICENSE file for more information.
|
42
50
|
|
data/lib/threeman/cli.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'threeman/procfile'
|
2
2
|
require 'thor'
|
3
|
+
require 'yaml'
|
3
4
|
|
4
5
|
module Threeman
|
5
6
|
FRONTENDS = {
|
@@ -22,11 +23,11 @@ module Threeman
|
|
22
23
|
|
23
24
|
desc "start", "Start the application"
|
24
25
|
option :frontend, desc: "Which frontend to use. One of: #{FRONTENDS.keys.sort.join(', ')}"
|
25
|
-
option :port, desc: "The port to run the application on. This will set the PORT environment variable.", type: :numeric
|
26
|
+
option :port, desc: "The port to run the application on. This will set the PORT environment variable.", type: :numeric
|
26
27
|
def start
|
27
28
|
pwd = Dir.pwd
|
28
29
|
procfile = Threeman::Procfile.new(File.expand_path("Procfile", pwd))
|
29
|
-
commands = procfile.commands(pwd, options[:port])
|
30
|
+
commands = procfile.commands(pwd, options[:port] || 5000)
|
30
31
|
|
31
32
|
frontend_name = options[:frontend] || auto_frontend
|
32
33
|
unless frontend_name
|
@@ -69,5 +70,17 @@ module Threeman
|
|
69
70
|
def print_valid_frontend_names
|
70
71
|
puts "Valid frontend names are: #{FRONTENDS.keys.sort.join(', ')}."
|
71
72
|
end
|
73
|
+
|
74
|
+
# Cribbed mostly from Foreman
|
75
|
+
def options
|
76
|
+
original_options = super
|
77
|
+
return original_options unless dotfile
|
78
|
+
defaults = ::YAML::load_file(dotfile) || {}
|
79
|
+
Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options))
|
80
|
+
end
|
81
|
+
|
82
|
+
def dotfile
|
83
|
+
@dotfile ||= ['.threeman', '.foreman'].find { |filename| File.file?(filename) }
|
84
|
+
end
|
72
85
|
end
|
73
86
|
end
|
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.4.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: 2017-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman
|