Class: Circus::Profiles::Shell

Inherits:
MakeBase show all
Defined in:
lib/circus/profiles/shell.rb

Constant Summary collapse

SHELL_APP_PROPERTY =
'shell-app'

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MakeBase

#prepare_for_deploy, #prepare_for_dev

Methods inherited from Base

#cleanup_after_deploy, #extra_dirs, #mark_for_persistent_run?, #package_base_dir?, #package_for_deploy, #package_for_dev, #requirements, #supported_for_development?

Constructor Details

#initialize(name, dir, props) ⇒ Shell

Returns a new instance of Shell.



15
16
17
18
19
# File 'lib/circus/profiles/shell.rb', line 15

def initialize(name, dir, props)
  super(name, dir, props)
  
  @sh_script = props[SHELL_APP_PROPERTY] || "#{name}.sh"
end

Class Method Details

.accepts?(name, dir, props) ⇒ Boolean

Checks if this is a shell applcation. Will accept the application if it has a file named <name>.sh, or has a ‘shell-app’ property describing the entry point.

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/circus/profiles/shell.rb', line 10

def self.accepts?(name, dir, props)
  return true if props.include? SHELL_APP_PROPERTY
  return File.exists?(File.join(dir, "#{name}.sh"))
end

Instance Method Details

#deploy_run_script_contentObject



35
36
37
38
39
40
41
# File 'lib/circus/profiles/shell.rb', line 35

def deploy_run_script_content
  shell_run_script do
    <<-EOT
    exec sh #{@sh_script}
    EOT
  end
end

#dev_run_script_contentObject



26
27
28
29
30
31
32
33
# File 'lib/circus/profiles/shell.rb', line 26

def dev_run_script_content
  shell_run_script do
    <<-EOT
    cd #{@dir}
    exec sh #{@sh_script}
    EOT
  end
end

#nameObject

The name of this profile



22
23
24
# File 'lib/circus/profiles/shell.rb', line 22

def name
  "shell"
end