class Shelly::Cloudfile

Attributes

code_name[RW]

Cloudfile attributes used for generating Cloudfile from a template

content[RW]
databases[RW]

Cloudfile attributes used for generating Cloudfile from a template

domains[RW]

Cloudfile attributes used for generating Cloudfile from a template

environment[RW]

Cloudfile attributes used for generating Cloudfile from a template

puma[RW]

Cloudfile attributes used for generating Cloudfile from a template

ruby_version[RW]

Cloudfile attributes used for generating Cloudfile from a template

size[RW]

Cloudfile attributes used for generating Cloudfile from a template

thin[RW]

Cloudfile attributes used for generating Cloudfile from a template

Public Instance Methods

clouds() click to toggle source

Public: Clouds in Cloudfile Returns Array of clouds names from Cloudfile nil if there is no cloudfile

# File lib/shelly/cloudfile.rb, line 18
def clouds
  content.keys.sort.map do |code_name|
    Shelly::App.new(code_name)
  end if content
end
create() click to toggle source

Public: Create Cloudfile in current path (or append if exists) File is created based on assigned attributes

# File lib/shelly/cloudfile.rb, line 34
def create
  File.open(path, "a+") { |f| f << generate }
end
generate() click to toggle source

Public: Generate example Cloudfile based on object attributes Returns the generated Cloudfile as String

# File lib/shelly/cloudfile.rb, line 26
def generate
  template = File.read(template_path)
  cloudfile = ERB.new(template, nil, "%<>-")
  cloudfile.result(binding)
end
path() click to toggle source

Internal: Path to Cloudfile in current directory Returns path as String

# File lib/shelly/cloudfile.rb, line 60
def path
  File.join(Dir.pwd, "Cloudfile")
end
present?() click to toggle source

Public: Return true if Cloudfile is present in current directory

# File lib/shelly/cloudfile.rb, line 11
def present?
  File.exists?(path)
end
template_path() click to toggle source

Internal: Return path to Cloudfile template Returns path as String

# File lib/shelly/cloudfile.rb, line 66
def template_path
  File.join(File.dirname(__FILE__), "templates", "Cloudfile.erb")
end