foreman 0.33.1 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/foreman/cli.rb CHANGED
@@ -7,8 +7,7 @@ require "yaml"
7
7
  class Foreman::CLI < Thor
8
8
 
9
9
  class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
10
-
11
- desc "start", "Start the application"
10
+ class_option :app_root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
12
11
 
13
12
  method_option :env, :type => :string, :aliases => "-e", :desc => "Specify an environment file to load, defaults to .env"
14
13
  method_option :port, :type => :numeric, :aliases => "-p"
@@ -17,11 +17,13 @@ class Foreman::Engine
17
17
 
18
18
  extend Term::ANSIColor
19
19
 
20
- COLORS = [ cyan, yellow, green, magenta, red ]
20
+ COLORS = [ cyan, yellow, green, magenta, red, blue,
21
+ intense_cyan, intense_yellow, intense_green, intense_magenta,
22
+ intense_red, intense_blue ]
21
23
 
22
24
  def initialize(procfile, options={})
23
25
  @procfile = Foreman::Procfile.new(procfile)
24
- @directory = File.expand_path(File.dirname(procfile))
26
+ @directory = options[:app_root] || File.expand_path(File.dirname(procfile))
25
27
  @options = options
26
28
  @environment = read_environment_files(options[:env])
27
29
  @output_mutex = Mutex.new
@@ -182,7 +184,8 @@ private ######################################################################
182
184
  def next_color
183
185
  @current_color ||= -1
184
186
  @current_color += 1
185
- @current_color >= COLORS.length ? "" : COLORS[@current_color]
187
+ @current_color = 0 if COLORS.length < @current_color
188
+ COLORS[@current_color]
186
189
  end
187
190
 
188
191
  module Env
@@ -29,6 +29,7 @@ class Foreman::Export::Runit < Foreman::Export::Base
29
29
 
30
30
  run = ERB.new(run_template).result(binding)
31
31
  write_file "#{process_directory}/run", run
32
+ FileUtils.chmod 0755, "#{process_directory}/run"
32
33
 
33
34
  port = engine.port_for(process, num, options[:port])
34
35
  environment_variables = {'PORT' => port}.
@@ -41,7 +42,7 @@ class Foreman::Export::Runit < Foreman::Export::Base
41
42
 
42
43
  log_run = ERB.new(log_run_template).result(binding)
43
44
  write_file "#{process_log_directory}/run", log_run
44
-
45
+ FileUtils.chmod 0755, "#{process_log_directory}/run"
45
46
  end
46
47
  end
47
48
 
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.33.1"
3
+ VERSION = "0.34.0"
4
4
 
5
5
  end
data/man/foreman.1 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "FOREMAN" "1" "November 2011" "Foreman 0.26.0" "Foreman Manual"
4
+ .TH "FOREMAN" "1" "January 2012" "Foreman 0.33.1" "Foreman Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBforeman\fR \- manage Procfile\-based applications
@@ -68,6 +68,10 @@ Specify the user the application should be run as\. Defaults to the app name
68
68
  These options control all modes of foreman\'s operation\.
69
69
  .
70
70
  .TP
71
+ \fB\-d\fR, \fB\-\-directory\fR
72
+ Specify an alternate application root\. This defaults to the directory containing the Procfile\.
73
+ .
74
+ .TP
71
75
  \fB\-e\fR, \fB\-\-env\fR
72
76
  Specify an alternate environment file\. You can specify more than one file by using: \fB\-\-env file1,file2\fR\.
73
77
  .
@@ -10,6 +10,7 @@ describe Foreman::Export::Runit do
10
10
 
11
11
  before(:each) { load_export_templates_into_fakefs("runit") }
12
12
  before(:each) { stub(runit).say }
13
+ before(:each) { stub(FakeFS::FileUtils).chmod }
13
14
 
14
15
  it "exports to the filesystem" do
15
16
  FileUtils.mkdir_p('/tmp/init')
data/spec/spec_helper.rb CHANGED
@@ -75,6 +75,7 @@ end
75
75
 
76
76
  RSpec.configure do |config|
77
77
  config.color_enabled = true
78
+ config.order = 'rand'
78
79
  config.include FakeFS::SpecHelpers
79
80
  config.mock_with :rr
80
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.1
4
+ version: 0.34.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: term-ansicolor
16
- requirement: &70338325254740 !ruby/object:Gem::Requirement
16
+ requirement: &70111007818660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70338325254740
24
+ version_requirements: *70111007818660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &70338325254240 !ruby/object:Gem::Requirement
27
+ requirement: &70111007818160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.13.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70338325254240
35
+ version_requirements: *70111007818160
36
36
  description: Process manager for applications with multiple components
37
37
  email: ddollar@gmail.com
38
38
  executables:
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  segments:
109
109
  - 0
110
- hash: -3163485577620200285
110
+ hash: 3546573837713582182
111
111
  required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  none: false
113
113
  requirements:
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  segments:
118
118
  - 0
119
- hash: -3163485577620200285
119
+ hash: 3546573837713582182
120
120
  requirements: []
121
121
  rubyforge_project:
122
122
  rubygems_version: 1.8.10