Sha256: 6fff3defbf269ffb53bf47edde081496fca508735986da281987c946ea5e2ced

Contents?: true

Size: 1.83 KB

Versions: 11

Compression:

Stored size: 1.83 KB

Contents

# To run:
# $ ruby ./script/grant_revoke_gem_authority.rb
RUBYGEM_NAMES = [
  'active-fedora',
  'active_fedora-registered_attributes',
  'active_fedora_relsint',
  'fcrepo_admin',
  'hydra',
  'hydra-access-controls',
  'hydra-batch-edit',
  'hydra-core',
  'hydra-derivatives',
  'hydra-editor',
  'hydra-head',
  'hydra-ldap',
  'hydra-migrate',
  'hydra-mods',
  'hydra-role-management',
  'jettywrapper',
  'om',
  'rubydora',
  'solrizer',
  'solrizer-fedora',
  'sufia',
  'sufia-models',
]

HYDRA_COMMITTER_EMAILS = [
  "amsterdamos@gmail.com",
  "armintor@gmail.com",
  "bess@stanford.edu",
  "cam156@psu.edu",
  "chris@cbeer.info",
  "cjcolvar@indiana.edu",
  "dan.coughlin@gmail.com",
  "dchandekstark@gmail.com",
  "edwin.shin@yourmediashelf.com",
  "jeremy.n.friesen@gmail.com",
  "jessie.keck@gmail.com",
  "john.scofield@yourmediashelf.com",
  "justin@curationexperts.com",
  "leftwing@alumni.rutgers.edu",
  "matt@curationexperts.com",
  "mbklein@gmail.com",
  "montyhindman@gmail.com",
  "mstrom81@gmail.com",
  "ndushay@stanford.edu",
]

@errors = []

def system_command_with_error_check(command)
  if !system(command)
    @errors << "ERROR FOR: #{command}"
  end
end
RUBYGEM_NAMES.each do |gemname|
  current_committers = `gem owner #{gemname} | grep -e ^-`.split("\n")
  current_committers.collect! { |cc| cc.sub(/^.\s+/,'')}
  committers_to_remove = current_committers - HYDRA_COMMITTER_EMAILS
  committers_to_add = HYDRA_COMMITTER_EMAILS - current_committers

  committers_to_remove.each do |email_to_remove|
    system_command_with_error_check("gem owner #{gemname} -r #{email_to_remove}")
  end

  committers_to_add.each do |email_to_add|
    system_command_with_error_check("gem owner #{gemname} -a #{email_to_add}")
  end
end

if ! @errors.empty?
  $stderr.puts("The following errors were encountered:")
  $stderr.puts(%(#{@errors.join("\n")}))
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hydra-6.1.0.rc7 script/grant_revoke_gem_authority.rb
hydra-6.1.0.rc6 script/grant_revoke_gem_authority.rb
hydra-6.1.0.rc5 script/grant_revoke_gem_authority.rb
hydra-6.1.0.rc4 script/grant_revoke_gem_authority.rb
hydra-6.1.0.rc3 script/grant_revoke_gem_authority.rb
hydra-6.1.0.rc2 script/grant_revoke_gem_authority.rb
hydra-6.1.0.rc1 script/grant_revoke_gem_authority.rb
hydra-6.1.0.pre4 script/grant_revoke_gem_authority.rb
hydra-6.1.0.pre3 script/grant_revoke_gem_authority.rb
hydra-6.1.0.pre2 script/grant_revoke_gem_authority.rb
hydra-6.1.0.pre1 script/grant_revoke_gem_authority.rb