Class: Chandler::Commands::Push

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Logging
Defined in:
lib/chandler/commands/push.rb

Overview

Iterates over a given array of tags, fetches the corresponding notes from the CHANGELOG, and creates (or updates) the release notes for that tag on GitHub.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tags:, config:) ⇒ Push

Returns a new instance of Push.



21
22
23
24
# File 'lib/chandler/commands/push.rb', line 21

def initialize(tags:, config:)
  @tags = tags
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



19
20
21
# File 'lib/chandler/commands/push.rb', line 19

def config
  @config
end

#tagsObject (readonly)

Returns the value of attribute tags.



19
20
21
# File 'lib/chandler/commands/push.rb', line 19

def tags
  @tags
end

Instance Method Details

#callObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/chandler/commands/push.rb', line 26

def call
  exit_with_warning if tags.empty?

  each_tag_with_version_and_notes do |tag, version, notes|
    github.create_or_update_release(
      :tag => tag,
      :title => version.version_number,
      :description => notes
    )
  end
end