Sha256: 5013279133054610e3c61dfb5f6679abbf93817343c6d2c88a4787ceb74dcfde

Contents?: true

Size: 876 Bytes

Versions: 10

Compression:

Stored size: 876 Bytes

Contents

class Recipes::Github < Rails::AppBuilder
  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

  def create
    github_repo_create(get(:github_repo_name), get(:github_repo_private)) if selected?(:github_repo)
  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

10 entries across 10 versions & 1 rubygems

Version Path
potassium-6.0.0 lib/potassium/recipes/github.rb
potassium-5.2.3 lib/potassium/recipes/github.rb
potassium-5.2.2 lib/potassium/recipes/github.rb
potassium-5.2.1 lib/potassium/recipes/github.rb
potassium-5.2.0 lib/potassium/recipes/github.rb
potassium-5.1.4 lib/potassium/recipes/github.rb
potassium-5.1.3 lib/potassium/recipes/github.rb
potassium-5.1.2 lib/potassium/recipes/github.rb
potassium-5.1.1 lib/potassium/recipes/github.rb
potassium-3.0.0 lib/potassium/recipes/github.rb