Class: Venice::Kit

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

Instance Method Summary collapse

Instance Method Details

#deploy(platform = "heroku", target = "") ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/venice/kit.rb', line 29

def deploy(platform = "heroku", target = "")
  puts "Deploying the project"
  if platform == "heroku"
    target = {
      "" => "us",
      "us-east-1" => "us",
      "eu-west-1" => "eu"
    }[target]

    if target.nil?
      puts "Please provide correct target parameter."
      puts "Available options are:"
      puts "  us-east-1"
      puts "  eu-west-1"
      exit
    end
  end
  system "bin/#{platform}/deploy #{target}".strip
end

#new(repo_name = "new-venice-project") ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/venice/kit.rb', line 9

def new(repo_name = "new-venice-project")
  url = "https://github.com/alexkravets/venice.git"

  system "git ls-remote #{url} > /dev/null 2>&1"
  puts "Starting a new venice project in #{repo_name}"
  system %{
    git clone "#{url}" "#{repo_name}" &&
    cd "#{repo_name}" &&
    git remote rename origin venice &&
    cd -
  }
end

#setupObject



23
24
25
26
# File 'lib/venice/kit.rb', line 23

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

#versionObject



50
51
52
# File 'lib/venice/kit.rb', line 50

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