class Proteus::Kit

Public Instance Methods

deploy() click to toggle source
# File lib/proteus/kit.rb, line 70
def deploy
  puts "Deploying the site to Github"
  system "bin/deploy"
end
list() click to toggle source
# File lib/proteus/kit.rb, line 22
def list
  repos = Proteus::REPOS
  repos.each do |id, repo|
    puts "#{id} - #{repo[:name]}"
  end
end
name(id) click to toggle source
# File lib/proteus/kit.rb, line 15
def name(id)
  kit = Proteus::REPOS[id.to_sym]
  kit[:name]
end
new(id, dir = nil) click to toggle source
# File lib/proteus/kit.rb, line 30
def new(id, dir = nil)
  dir ||= id
  kit = Proteus::REPOS[id.to_sym]

  if kit
    name = kit[:name]
    url = kit[:url]

    if system "git ls-remote #{url} #{dir} > /dev/null 2>&1"
      puts "Starting a new #{name} project in #{dir} from #{url}"
      system %{
        git clone "#{url}" "#{dir}" &&
        cd "#{dir}" &&
        rm -rf .git &&
        git init &&
        git add . &&
        git commit -m 'New #{name} project' &&
        cd -
      }
    else
      puts "Can't find a repo at #{url}."
    end
  else
    puts "Kit not found. Run `proteus list` to see available kits."
  end
end
server() click to toggle source
# File lib/proteus/kit.rb, line 64
def server
  puts "Starting the server"
  system "bin/server"
end
setup() click to toggle source
# File lib/proteus/kit.rb, line 58
def setup
  puts "Setting up your project"
  system "bin/setup"
end
url(id) click to toggle source
# File lib/proteus/kit.rb, line 10
def url(id)
  kit = Proteus::REPOS[id.to_sym]
  kit[:url]
end
version() click to toggle source
# File lib/proteus/kit.rb, line 76
def version
  version_number = Proteus::VERSION
  puts "Proteus #{version_number}"
end