class Dpl::Providers::Rubygems

Public Instance Methods

deploy() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 57
def deploy
  build
  push
end
login() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 47
def login
  api_key? ? login_api_key : login_creds
end
setup() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 40
def setup
  return unless host?

  info :setup
  Gems.host = host
end
validate() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 51
def validate
  print :gem_lookup
  name = Gems.info(gem)['name']
  info name ? :gem_found : :gem_not_found
end

Private Instance Methods

build() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 75
def build
  Dir[gemspec_glob].each do |gemspec|
    shell :gem_build, gemspec: gemspec.whitelist
  end
end
gemspec() click to toggle source
Calls superclass method
# File lib/dpl/providers/rubygems.rb, line 92
def gemspec
  super.gsub('.gemspec', '') if gemspec?
end
gemspec_glob() click to toggle source
Calls superclass method
# File lib/dpl/providers/rubygems.rb, line 88
def gemspec_glob
  super || "#{gemspec || gem}.gemspec"
end
login_api_key() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 64
def login_api_key
  info :login_api_key
  Gems.key = api_key
end
login_creds() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 69
def login_creds
  info :login_creds
  Gems.username = username
  Gems.password = password
end
push() click to toggle source
# File lib/dpl/providers/rubygems.rb, line 81
def push
  Dir["#{gem}-*.gem"].each do |file|
    info :gem_push, gem: file.whitelist
    info Gems.push(File.new(file), *[host].compact)
  end
end