class Fanforce::PluginFactory::CLI::Scripts include Fanforce::PluginFactory::CLI::Utils require_relative '../lib/bundler' require_relative '../lib/pow' require_relative '../lib/git' require_relative '../lib/bitbucket' require_relative '../lib/env' require_relative '../lib/uranium' ###################################################################################################################### def setup(type=:all) plugin = Fanforce::CLI::Plugin.new(Fanforce::CLI::DIR) type = type.to_s.downcase.to_sym error 'Unknown setup type', :setup if ![:all,:bundler,:pow,:git,:bitbucket,:env,:uranium].include?(type) if !File.exists?("#{plugin.dir}/config.ru") error "This does not seem to be a valid plugin directory since it's missing config.ru" end if [:all,:bundler].include?(type) log divider '+---------------------------------------------------------------------------------------------------' log 'SETTING UP BUNDLER...' Fanforce::PluginFactory::CLI::Bundler.new(plugin).setup end if [:all,:pow].include?(type) log divider '+---------------------------------------------------------------------------------------------------' log 'SETTING UP POW DOMAINS...' Fanforce::PluginFactory::CLI::Pow.new(plugin).setup end if [:all,:git].include?(type) log divider '+---------------------------------------------------------------------------------------------------' log 'SETTING UP GIT...' Fanforce::PluginFactory::CLI::Git.new(plugin).setup end if [:all,:bitbucket].include?(type) log divider '+---------------------------------------------------------------------------------------------------' log 'SETTING UP BITBUCKET...' Fanforce::PluginFactory::CLI::Bitbucket.new(plugin).setup end if [:all,:env].include?(type) log divider '+---------------------------------------------------------------------------------------------------' log 'SETTING UP ENV...' Fanforce::PluginFactory::CLI::Env.new(plugin).setup(:development) end if [:all,:uranium].include?(type) log divider '+---------------------------------------------------------------------------------------------------' log 'RUNNING TOUCH TMP/RESTART.TXT...' `touch tmp/restart.txt` log 'Finished'.format(:green,:bold) + ' restarting' end if [:all,:uranium].include?(type) log divider '+---------------------------------------------------------------------------------------------------' log 'SETTING UP URANIUM...' Fanforce::PluginFactory::CLI::Uranium.new(plugin).setup end log divider '+-----------------------------------------------------------------------------------------------------' log 'SUCCESS!'.format(:bold,:green) log divider '----------------------------------------------------------------------------------------------------++' end end