Class: Recipes::Github

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/potassium/recipes/github.rb

Instance Method Summary collapse

Instance Method Details

#askObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/potassium/recipes/github.rb', line 2

def ask
  repo_name = "platanus/#{get(:dasherized_app_name)}"
  github_repo_create = answer(:github) do
    q = "Do you want to create the Github repository (https://github.com/#{repo_name}) " +
      "for this project?"
    Ask.confirm(q)
  end
  if github_repo_create
    github_repo_private = answer(:"github-private") do
      Ask.confirm("Should the repository be private?")
    end
  end
  set(:github_repo_name, repo_name)
  set(:github_repo, github_repo_create)
  set(:github_repo_private, github_repo_private)
end

#createObject



19
20
21
# File 'lib/potassium/recipes/github.rb', line 19

def create
  github_repo_create(get(:github_repo_name), get(:github_repo_private)) if selected?(:github_repo)
end