class Vpsb::Commands::Init
Constants
- GEMS
- REPOS
Public Instance Methods
execute(params)
click to toggle source
# File lib/vpsb/commands/init.rb, line 5 def execute(params) unless params.empty? name = params[0] p "creating directory #{name}" make_dir(name) enter_to_the_dir(name) end p 'installing all gems' install_all_gems p 'clone all repos' clone_all_repos end
Private Instance Methods
clone_all_repos()
click to toggle source
# File lib/vpsb/commands/init.rb, line 31 def clone_all_repos REPOS.each { |source| git_clone(source) } end
enter_to_the_dir(name)
click to toggle source
# File lib/vpsb/commands/init.rb, line 35 def enter_to_the_dir(name) Dir.chdir(name) end
gem_install(name)
click to toggle source
# File lib/vpsb/commands/init.rb, line 43 def gem_install(name) system("gem install #{name} --no-ri --no-rdoc") end
git_clone(source)
click to toggle source
# File lib/vpsb/commands/init.rb, line 47 def git_clone(source) system("git clone #{source}") end
install_all_gems()
click to toggle source
# File lib/vpsb/commands/init.rb, line 27 def install_all_gems GEMS.each{ |gem_name| gem_install(gem_name) } end
make_dir(name)
click to toggle source
# File lib/vpsb/commands/init.rb, line 39 def make_dir(name) Dir.mkdir name end