class StartX::Project

Public Class Methods

new() click to toggle source
# File lib/start_x/project.rb, line 3
def initialize
  @starters = YAML.load(File.open(Dir.home + "/.startx" ))
  handle_args
end

Private Instance Methods

handle_args() click to toggle source
# File lib/start_x/project.rb, line 10
def handle_args
  _err = "Specify a project or edit your config."
  if ARGV.count > 1 
    run(ARGV[1])
  elsif ARGV.count == 1 
    ARGV.first == "project" ? (puts _err) : (run(ARGV[0]))
  else
    puts _err
  end
end
run(key) click to toggle source
# File lib/start_x/project.rb, line 22
def run(key)
  %x(git clone #{@starters[key]['url']})
  system "#{@starters[key]['scripts']}"
end