Class: Bookbinder::Commands::Punch

Inherits:
Object
  • Object
show all
Defined in:
lib/bookbinder/commands/punch.rb

Instance Method Summary collapse

Constructor Details

#initialize(streams, configuration_fetcher, version_control_system) ⇒ Punch

Returns a new instance of Punch.



4
5
6
7
8
# File 'lib/bookbinder/commands/punch.rb', line 4

def initialize(streams, configuration_fetcher, version_control_system)
  @streams = streams
  @configuration_fetcher = configuration_fetcher
  @version_control_system = version_control_system
end

Instance Method Details

#run(tag) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/bookbinder/commands/punch.rb', line 10

def run((tag, *))
  urls(config).each do |url|
    version_control_system.remote_tag(url, tag, 'HEAD')
  end

  streams[:success].puts 'Success!'
  streams[:out].puts "#{config.book_repo} and its sections were tagged with #{tag}"
  0
end