Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ada41ce311 | ||
|
|
8f1c752a77 | ||
|
|
ddf25fe0ea | ||
|
|
86e4251840 | ||
|
|
ba18f7e589 | ||
|
|
47008fb921 |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
foreman (0.24.0)
|
foreman (0.25.0)
|
||||||
term-ansicolor (~> 1.0.5)
|
term-ansicolor (~> 1.0.5)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class Foreman::CLI < Thor
|
|||||||
|
|
||||||
method_option :app, :type => :string, :aliases => "-a"
|
method_option :app, :type => :string, :aliases => "-a"
|
||||||
method_option :log, :type => :string, :aliases => "-l"
|
method_option :log, :type => :string, :aliases => "-l"
|
||||||
|
method_option :env, :type => :string, :aliases => "-e", :desc => "Specify an environment file to load, defaults to .env"
|
||||||
method_option :port, :type => :numeric, :aliases => "-p"
|
method_option :port, :type => :numeric, :aliases => "-p"
|
||||||
method_option :user, :type => :string, :aliases => "-u"
|
method_option :user, :type => :string, :aliases => "-u"
|
||||||
method_option :template, :type => :string, :aliases => "-t"
|
method_option :template, :type => :string, :aliases => "-t"
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ private ######################################################################
|
|||||||
return {} unless File.exists?(filename)
|
return {} unless File.exists?(filename)
|
||||||
|
|
||||||
File.read(filename).split("\n").inject({}) do |hash, line|
|
File.read(filename).split("\n").inject({}) do |hash, line|
|
||||||
if line =~ /\A([A-Za-z_]+)=(.*)\z/
|
if line =~ /\A([A-Za-z_0-9]+)=(.*)\z/
|
||||||
hash[$1] = $2
|
hash[$1] = $2
|
||||||
end
|
end
|
||||||
hash
|
hash
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module Foreman
|
module Foreman
|
||||||
|
|
||||||
VERSION = "0.24.0"
|
VERSION = "0.25.0"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,6 +26,15 @@ describe "Foreman::CLI" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "export" do
|
describe "export" do
|
||||||
|
describe "options" do
|
||||||
|
it "respects --env" do
|
||||||
|
write_procfile
|
||||||
|
write_env("envfile")
|
||||||
|
mock.instance_of(Foreman::Export::Upstart).export("/upstart", { "env" => "envfile" })
|
||||||
|
foreman %{ export upstart /upstart --env envfile }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "with a non-existent Procfile" do
|
describe "with a non-existent Procfile" do
|
||||||
it "prints an error" do
|
it "prints an error" do
|
||||||
mock_error(subject, "Procfile does not exist.") do
|
mock_error(subject, "Procfile does not exist.") do
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ def mock_error(subject, message)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def foreman(args)
|
||||||
|
Foreman::CLI.start(args.split(" "))
|
||||||
|
end
|
||||||
|
|
||||||
def mock_exit(&block)
|
def mock_exit(&block)
|
||||||
block.should raise_error(SystemExit)
|
block.should raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
@@ -33,6 +37,12 @@ def write_procfile(procfile="Procfile")
|
|||||||
File.expand_path(procfile)
|
File.expand_path(procfile)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def write_env(env=".env")
|
||||||
|
File.open(env, "w") do |file|
|
||||||
|
file.puts "FOO=bar"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def load_export_templates_into_fakefs(type)
|
def load_export_templates_into_fakefs(type)
|
||||||
FakeFS.deactivate!
|
FakeFS.deactivate!
|
||||||
files = Dir[File.expand_path("../../data/export/#{type}/**", __FILE__)].inject({}) do |hash, file|
|
files = Dir[File.expand_path("../../data/export/#{type}/**", __FILE__)].inject({}) do |hash, file|
|
||||||
|
|||||||
Reference in New Issue
Block a user