Class: GemPublisher::Publisher
- Inherits:
-
Object
- Object
- GemPublisher::Publisher
- Defined in:
- lib/gem_publisher/publisher.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
Returns the value of attribute builder.
-
#git_remote ⇒ Object
Returns the value of attribute git_remote.
-
#pusher ⇒ Object
Returns the value of attribute pusher.
Instance Method Summary collapse
-
#initialize(gemspec) ⇒ Publisher
constructor
A new instance of Publisher.
- #publish_if_updated(method, options = {}) ⇒ Object
Constructor Details
#initialize(gemspec) ⇒ Publisher
Returns a new instance of Publisher.
10 11 12 13 14 15 16 17 18 |
# File 'lib/gem_publisher/publisher.rb', line 10 def initialize(gemspec) @gemspec = gemspec @version = eval(File.read(gemspec)).version.to_s @git_remote = GitRemote.new @builder = Builder.new @pusher = Pusher.new end |
Instance Attribute Details
#builder ⇒ Object
Returns the value of attribute builder.
8 9 10 |
# File 'lib/gem_publisher/publisher.rb', line 8 def builder @builder end |
#git_remote ⇒ Object
Returns the value of attribute git_remote.
8 9 10 |
# File 'lib/gem_publisher/publisher.rb', line 8 def git_remote @git_remote end |
#pusher ⇒ Object
Returns the value of attribute pusher.
8 9 10 |
# File 'lib/gem_publisher/publisher.rb', line 8 def pusher @pusher end |
Instance Method Details
#publish_if_updated(method, options = {}) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/gem_publisher/publisher.rb', line 20 def publish_if_updated(method, = {}) return if version_released? @builder.build(@gemspec).tap { |gem| @pusher.push gem, method, @git_remote.add_tag "v#@version" } end |