Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7535f1d3d8 | ||
|
|
3af0dfb4ae | ||
|
|
78547b8175 | ||
|
|
976fbc0bb0 | ||
|
|
28a9aa774f | ||
|
|
51f5ff3842 | ||
|
|
e1e18f62bb | ||
|
|
0a09117328 | ||
|
|
c3df12746f | ||
|
|
2ec6a23fb3 | ||
|
|
0d6b784de1 | ||
|
|
2dcd2c03db | ||
|
|
9d6d0bbb7d | ||
|
|
89c1314abe | ||
|
|
f33211d100 | ||
|
|
4317079bf3 | ||
|
|
c745c282c9 | ||
|
|
7dca45db57 | ||
|
|
de3c47fe21 | ||
|
|
a8a255db4a | ||
|
|
307d63b631 |
@@ -1,4 +1,5 @@
|
|||||||
/.bundle
|
/.bundle
|
||||||
|
/.rbenv-version
|
||||||
/coverage
|
/coverage
|
||||||
/example/log/*
|
/example/log/*
|
||||||
/man/*.html
|
/man/*.html
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
## 0.37.2 (2012-01-29)
|
||||||
|
|
||||||
|
* handle directories with spaces in runner [David Dollar]
|
||||||
|
* update docs [David Dollar]
|
||||||
|
|
||||||
|
## 0.37.1 (2012-01-29)
|
||||||
|
|
||||||
|
* use binary pipes to better handle UTF-8 data [David Dollar]
|
||||||
|
* set up example procfile with UTF-8 item [David Dollar]
|
||||||
|
* remove autotest [David Dollar]
|
||||||
|
* fix up authors generation [David Dollar]
|
||||||
|
* fix up packaging after moving tasks [David Dollar]
|
||||||
|
* fix up changelog tasks [David Dollar]
|
||||||
|
|
||||||
## 0.37.0 (2012-01-29)
|
## 0.37.0 (2012-01-29)
|
||||||
|
|
||||||
* put an entire line of output inside a single mutex so we don't cross the streams [David Dollar]
|
* put an entire line of output inside a single mutex so we don't cross the streams [David Dollar]
|
||||||
|
|||||||
@@ -17,8 +17,5 @@ group :development do
|
|||||||
gem 'fakefs', '~> 0.3.2'
|
gem 'fakefs', '~> 0.3.2'
|
||||||
gem 'rr', '~> 1.0.2'
|
gem 'rr', '~> 1.0.2'
|
||||||
gem 'rspec', '~> 2.0'
|
gem 'rspec', '~> 2.0'
|
||||||
gem 'ZenTest'
|
|
||||||
gem 'aws-s3'
|
|
||||||
gem "rubyzip"
|
|
||||||
gem "simplecov", :require => false
|
gem "simplecov", :require => false
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-12
@@ -1,19 +1,13 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
foreman (0.37.1)
|
foreman (0.38.0)
|
||||||
term-ansicolor (~> 1.0.7)
|
term-ansicolor (~> 1.0.7)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
ZenTest (4.6.2)
|
|
||||||
aws-s3 (0.6.2)
|
|
||||||
builder
|
|
||||||
mime-types
|
|
||||||
xml-simple
|
|
||||||
builder (3.0.0)
|
|
||||||
crack (0.1.8)
|
crack (0.1.8)
|
||||||
diff-lcs (1.1.3)
|
diff-lcs (1.1.3)
|
||||||
fakefs (0.3.2)
|
fakefs (0.3.2)
|
||||||
@@ -44,7 +38,6 @@ GEM
|
|||||||
rspec-expectations (2.8.0)
|
rspec-expectations (2.8.0)
|
||||||
diff-lcs (~> 1.1.2)
|
diff-lcs (~> 1.1.2)
|
||||||
rspec-mocks (2.8.0)
|
rspec-mocks (2.8.0)
|
||||||
rubyzip (0.9.4)
|
|
||||||
simplecov (0.5.4)
|
simplecov (0.5.4)
|
||||||
multi_json (~> 1.0.3)
|
multi_json (~> 1.0.3)
|
||||||
simplecov-html (~> 0.5.3)
|
simplecov-html (~> 0.5.3)
|
||||||
@@ -52,7 +45,6 @@ GEM
|
|||||||
term-ansicolor (1.0.7)
|
term-ansicolor (1.0.7)
|
||||||
thor (0.14.6)
|
thor (0.14.6)
|
||||||
win32console (1.3.0-x86-mingw32)
|
win32console (1.3.0-x86-mingw32)
|
||||||
xml-simple (1.0.15)
|
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
java
|
java
|
||||||
@@ -60,8 +52,6 @@ PLATFORMS
|
|||||||
x86-mingw32
|
x86-mingw32
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
ZenTest
|
|
||||||
aws-s3
|
|
||||||
fakefs (~> 0.3.2)
|
fakefs (~> 0.3.2)
|
||||||
foreman!
|
foreman!
|
||||||
parka
|
parka
|
||||||
@@ -70,6 +60,5 @@ DEPENDENCIES
|
|||||||
ronn
|
ronn
|
||||||
rr (~> 1.0.2)
|
rr (~> 1.0.2)
|
||||||
rspec (~> 2.0)
|
rspec (~> 2.0)
|
||||||
rubyzip
|
|
||||||
simplecov
|
simplecov
|
||||||
win32console (~> 1.3.0)
|
win32console (~> 1.3.0)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
$:.unshift File.expand_path("../lib", __FILE__)
|
$:.unshift File.expand_path("../lib", __FILE__)
|
||||||
require "foreman"
|
require "foreman"
|
||||||
|
|
||||||
|
require "bundler/setup"
|
||||||
|
|
||||||
Dir[File.expand_path("../tasks/*.rake", __FILE__)].each do |task|
|
Dir[File.expand_path("../tasks/*.rake", __FILE__)].each do |task|
|
||||||
load task
|
load task
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ usage() {
|
|||||||
|
|
||||||
while getopts ":hd:" OPT; do
|
while getopts ":hd:" OPT; do
|
||||||
case $OPT in
|
case $OPT in
|
||||||
d) cd $OPTARG ;;
|
d) cd "$OPTARG" ;;
|
||||||
h) usage ;;
|
h) usage ;;
|
||||||
\?) error "invalid option: -$OPTARG" ;;
|
\?) error "invalid option: -$OPTARG" ;;
|
||||||
:) error "option -$OPTARG requires an argument" ;;
|
:) error "option -$OPTARG requires an argument" ;;
|
||||||
|
|||||||
+3
-2
@@ -10,7 +10,7 @@ class Foreman::CLI < Thor
|
|||||||
|
|
||||||
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
||||||
|
|
||||||
desc "start", "Start the application"
|
desc "start [PROCESS]", "Start the application (or a specific PROCESS)"
|
||||||
|
|
||||||
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
||||||
class_option :app_root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
|
class_option :app_root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
|
||||||
@@ -27,8 +27,9 @@ class Foreman::CLI < Thor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def start
|
def start(process=nil)
|
||||||
check_procfile!
|
check_procfile!
|
||||||
|
engine.options[:concurrency] = "#{process}=1" if process
|
||||||
engine.start
|
engine.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Foreman::Engine
|
|||||||
def initialize(procfile, options={})
|
def initialize(procfile, options={})
|
||||||
@procfile = Foreman::Procfile.new(procfile)
|
@procfile = Foreman::Procfile.new(procfile)
|
||||||
@directory = options[:app_root] || File.expand_path(File.dirname(procfile))
|
@directory = options[:app_root] || File.expand_path(File.dirname(procfile))
|
||||||
@options = options
|
@options = options.dup
|
||||||
@environment = read_environment_files(options[:env])
|
@environment = read_environment_files(options[:env])
|
||||||
@output_mutex = Mutex.new
|
@output_mutex = Mutex.new
|
||||||
end
|
end
|
||||||
@@ -99,6 +99,7 @@ private ######################################################################
|
|||||||
(rs || []).each do |r|
|
(rs || []).each do |r|
|
||||||
data = r.gets
|
data = r.gets
|
||||||
next unless data
|
next unless data
|
||||||
|
data.force_encoding("BINARY") if data.respond_to?(:force_encoding)
|
||||||
ps, message = data.split(",", 2)
|
ps, message = data.split(",", 2)
|
||||||
color = colors[ps.split(".").first]
|
color = colors[ps.split(".").first]
|
||||||
info message, ps, color
|
info message, ps, color
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module Foreman
|
module Foreman
|
||||||
|
|
||||||
VERSION = "0.37.1"
|
VERSION = "0.38.0"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
.\" generated with Ronn/v0.7.3
|
.\" generated with Ronn/v0.7.3
|
||||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||||
.
|
.
|
||||||
.TH "FOREMAN" "1" "January 2012" "Foreman 0.37.0" "Foreman Manual"
|
.TH "FOREMAN" "1" "January 2012" "Foreman 0.37.2" "Foreman Manual"
|
||||||
.
|
.
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
\fBforeman\fR \- manage Procfile\-based applications
|
\fBforeman\fR \- manage Procfile\-based applications
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ require "foreman/cli"
|
|||||||
|
|
||||||
describe "Foreman::CLI", :fakefs do
|
describe "Foreman::CLI", :fakefs do
|
||||||
subject { Foreman::CLI.new }
|
subject { Foreman::CLI.new }
|
||||||
|
let(:engine) { subject.send(:engine) }
|
||||||
|
let(:entries) { engine.procfile.entries.inject({}) { |h,e| h.update(e.name => e) } }
|
||||||
|
|
||||||
describe "start" do
|
describe "start" do
|
||||||
describe "with a non-existent Procfile" do
|
describe "with a non-existent Procfile" do
|
||||||
@@ -22,6 +24,15 @@ describe "Foreman::CLI", :fakefs do
|
|||||||
mock.instance_of(Foreman::Engine).start
|
mock.instance_of(Foreman::Engine).start
|
||||||
subject.start
|
subject.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "can run a single process" do
|
||||||
|
dont_allow(subject).error
|
||||||
|
stub(engine).watch_for_output
|
||||||
|
stub(engine).watch_for_termination
|
||||||
|
mock(entries["alpha"]).spawn(1, is_a(IO), engine.directory, {}, 5000) { [] }
|
||||||
|
mock(entries["bravo"]).spawn(0, is_a(IO), engine.directory, {}, 5100) { [] }
|
||||||
|
subject.start("alpha")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ require "foreman/engine"
|
|||||||
describe "Foreman::Engine", :fakefs do
|
describe "Foreman::Engine", :fakefs do
|
||||||
subject { Foreman::Engine.new("Procfile", {}) }
|
subject { Foreman::Engine.new("Procfile", {}) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
any_instance_of(Foreman::Engine) do |engine|
|
||||||
|
stub(engine).proctitle
|
||||||
|
stub(engine).termtitle
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "initialize" do
|
describe "initialize" do
|
||||||
describe "without an existing Procfile" do
|
describe "without an existing Procfile" do
|
||||||
it "raises an error" do
|
it "raises an error" do
|
||||||
@@ -95,7 +102,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
stub(subject).watch_for_output
|
stub(subject).watch_for_output
|
||||||
stub(subject).watch_for_termination
|
stub(subject).watch_for_termination
|
||||||
subject.start
|
subject.start
|
||||||
sleep 1
|
Process.waitall
|
||||||
mock(subject).info(/started with pid \d+/, "utf8.1", anything)
|
mock(subject).info(/started with pid \d+/, "utf8.1", anything)
|
||||||
mock(subject).info("\xff\x03\n", "utf8.1", anything)
|
mock(subject).info("\xff\x03\n", "utf8.1", anything)
|
||||||
subject.send(:poll_readers)
|
subject.send(:poll_readers)
|
||||||
|
|||||||
Reference in New Issue
Block a user