Class: Proteus::Kit

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/proteus/kit.rb

Instance Method Summary collapse

Instance Method Details

#deployObject



38
39
40
41
# File 'lib/proteus/kit.rb', line 38

def deploy
  puts "Deploying the site to Github"
  system ". bin/deploy"
end

#new(kit_name, repo_name = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/proteus/kit.rb', line 14

def new(kit_name, repo_name = nil)
  repo_name ||= kit_name

  if system "git ls-remote #{url(kit_name)} #{repo_name} > /dev/null 2>&1"
    puts "Starting a new proteus-#{kit_name} project in #{repo_name}"
    system "git clone #{url(kit_name)}#{' ' + repo_name}"
  else
    puts "A thoughtbot repo doesn't exist with that name"
  end
end

#serverObject



32
33
34
35
# File 'lib/proteus/kit.rb', line 32

def server
  puts "Starting the server"
  system ". bin/server"
end

#setupObject



26
27
28
29
# File 'lib/proteus/kit.rb', line 26

def setup
  puts "Setting up your project"
  system ". bin/setup"
end

#url(kit) ⇒ Object



9
10
11
# File 'lib/proteus/kit.rb', line 9

def url(kit)
  "[email protected]:thoughtbot/proteus-#{kit}.git"
end

#versionObject



44
45
46
# File 'lib/proteus/kit.rb', line 44

def version
    say "Proteus #{Proteus::VERSION}"
end