Sha256: b2a9f5db4d4769642205048a3a2e8a4719ab1f2e73ca2691f40d1249cd204acf
Contents?: true
Size: 1.21 KB
Versions: 31
Compression:
Stored size: 1.21 KB
Contents
class Fanforce::AppFactory::CLI::Pow include Fanforce::AppFactory::CLI::Utils attr_reader :app def initialize(app) @app = app end def setup create_domain(app.root_domain) create_domain(Fanforce.default_short_domain) end def destroy destroy_domain(app.root_domain) destroy_domain(Fanforce.default_short_domain) end def remove_domain_extension(domain) domain.gsub(/\.[a-z]+$/, '') end def create_domain(root_domain) domain = "#{app._id}.#{root_domain.gsub(/\.([a-z]+)$/, '')}" domain_extension = $1 symlink = "#{ENV['HOME']}/.pow/#{domain}" File.delete(symlink) if File.exists?(symlink) or File.symlink?(symlink) `ln -s #{app.dir} #{symlink}` puts "#{'Connected'.format(:bold,:green)} #{domain}.#{domain_extension} to #{app.dir}/" end def destroy_domain(root_domain) domain = "#{app._id}.#{root_domain.gsub(/\.([a-z]+)$/, '')}" domain_extension = $1 symlink = "#{ENV['HOME']}/.pow/#{domain}" if File.exists?(symlink) File.delete(symlink) puts "#{'Removed'.format(:bold,:green)} #{domain}.#{domain_extension}" else puts "#{'Already Removed'.format(:bold,:green)} #{domain}.#{domain_extension} to #{app.dir}/" end end end
Version data entries
31 entries across 31 versions & 1 rubygems