Sha256: fe125599010a01822f33f834b662bc30d63a9ea831ab12413f84ba03fb07beb8

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

class Recipes::Github < Rails::AppBuilder
  def ask
    repo_name = "platanus/#{get(:dasherized_app_name)}"
    github_repo_create = answer(:github) do
      Ask.confirm("Do you want to use create the github repository? (#{repo_name})")
    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_create, github_repo_create)
    set(:github_repo_private, github_repo_private)
  end

  def create
    github_repo_create(get(:github_repo_name), get(:github_repo_private))
  end

  private

  def github_repo_create(repo_name, private_repo = false)
    flag = private_repo ? "-p" : ""
    run "hub create #{flag} #{repo_name}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
potassium-2.0.0 lib/potassium/recipes/github.rb