Class: MultiRepo::Helpers::UpdateRepoSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/multi_repo/helpers/update_repo_settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_name, dry_run: false) ⇒ UpdateRepoSettings

Returns a new instance of UpdateRepoSettings.



5
6
7
8
# File 'lib/multi_repo/helpers/update_repo_settings.rb', line 5

def initialize(repo_name, dry_run: false, **)
  @repo_name = repo_name
  @github    = MultiRepo::Service::Github.new(dry_run: dry_run)
end

Instance Attribute Details

#githubObject (readonly)

Returns the value of attribute github.



3
4
5
# File 'lib/multi_repo/helpers/update_repo_settings.rb', line 3

def github
  @github
end

#repo_nameObject (readonly)

Returns the value of attribute repo_name.



3
4
5
# File 'lib/multi_repo/helpers/update_repo_settings.rb', line 3

def repo_name
  @repo_name
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/multi_repo/helpers/update_repo_settings.rb', line 10

def run
  settings = {
    :has_wiki           => false,
    :has_projects       => false,
    :allow_merge_commit => true,
    :allow_rebase_merge => false,
    :allow_squash_merge => false,
  }

  puts "Editing #{repo_name}"
  github.edit_repository(repo_name, settings)
end