class DPL::Provider::RubyGems
Public Instance Methods
check_app()
click to toggle source
# File lib/dpl/provider/rubygems.rb, line 24 def check_app setup_auth setup_gem log "Looking up gem #{options[:gem]}" info = ::Gems.info(options[:gem]) log "Found gem #{info['name']}" end
check_auth()
click to toggle source
# File lib/dpl/provider/rubygems.rb, line 32 def check_auth setup_auth log "Authenticated with username #{::Gems.username}" if ::Gems.username end
gemspec()
click to toggle source
# File lib/dpl/provider/rubygems.rb, line 20 def gemspec options[:gemspec].gsub('.gemspec', '') if options[:gemspec] end
needs_key?()
click to toggle source
# File lib/dpl/provider/rubygems.rb, line 12 def needs_key? false end
push_app()
click to toggle source
# File lib/dpl/provider/rubygems.rb, line 37 def push_app setup_auth setup_gem context.shell "gem build #{gemspec || option(:gem)}.gemspec" Dir.glob("#{gemspec || option(:gem)}-*.gem") do |f| if options[:host] log ::Gems.push(File.new(f), options[:host]) else log ::Gems.push(File.new f) end end end
setup_auth()
click to toggle source
# File lib/dpl/provider/rubygems.rb, line 6 def setup_auth ::Gems.key = option(:api_key) if options[:api_key] ::Gems.username = option(:user) unless options[:api_key] ::Gems.password = option(:password) unless options[:api_key] end
setup_gem()
click to toggle source
# File lib/dpl/provider/rubygems.rb, line 16 def setup_gem options[:gem] ||= options[:app] end