Module: GemPublisher

Defined in:
lib/gem_publisher.rb,
lib/gem_publisher/pusher.rb,
lib/gem_publisher/builder.rb,
lib/gem_publisher/version.rb,
lib/gem_publisher/publisher.rb,
lib/gem_publisher/cli_facade.rb,
lib/gem_publisher/git_remote.rb

Defined Under Namespace

Classes: Builder, CliFacade, GitRemote, Publisher, Pusher

Constant Summary collapse

VERSION =
"1.3.2"

Class Method Summary collapse

Class Method Details

.publish_if_updated(gemspec, method = :rubygems, options = {}) ⇒ Object

Publish a gem based on the supplied gemspec via supplied method, iff this version has not already been released and tagged in the origin Git repository.

Version is derived from the gemspec.

If a remote tag matching the version already exists, nothing is done. Otherwise, the gem is built, pushed, and tagged.

Tags are expected to be of the form “v1.2.3”, and generated tags follow this pattern.

Method should be one of :rubygems or :gemfury, and the requisite credentials for the corresponding push command line tools must exist.

Returns the gem file name if a gem was published; nil otherwise. A CliFacade::Error will be raised if a command fails.



24
25
26
# File 'lib/gem_publisher.rb', line 24

def self.publish_if_updated(gemspec, method=:rubygems, options={})
  Publisher.new(gemspec).publish_if_updated(method, options)
end