Class: Gerd::Inspections::Actions::CreateRepo

Inherits:
Object
  • Object
show all
Defined in:
lib/gerd/inspections/actions/create_repo.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo_to_create, org, privacy = false) ⇒ CreateRepo

Returns a new instance of CreateRepo.



7
8
9
10
11
# File 'lib/gerd/inspections/actions/create_repo.rb', line 7

def initialize(repo_to_create, org, privacy = false)
  @org = org
  @repo = repo_to_create
  @privacy = privacy
end

Instance Method Details

#invoke(client, options = {}) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/gerd/inspections/actions/create_repo.rb', line 13

def invoke(client, options = {})
  puts "Creating #{@org}/#{@repo}"
  opts = { 
    :organization => @org,
    :private => @privacy
  }
  res = client.create_repo(@repo, { :organization => @org })
end