aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/release-notes.rb
blob: e578869bf7e11ed263025f1b263aea2988581069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#:  * `release-notes` [`--markdown`] [<previous_tag>] [<end_ref>]:
#:    Output the merged pull requests on Homebrew/brew between two Git refs.
#:    If no <previous_tag> is provided it defaults to the newest tag.
#:    If no <end_ref> is provided it defaults to `origin/master`.
#:
#:    If `--markdown` is passed, output as a Markdown list.

module Homebrew
  module_function

  def release_notes
    previous_tag = ARGV.named.first
    unless previous_tag
      previous_tag = Utils.popen_read("git tag --list --sort=-version:refname")
                          .lines.first.chomp
    end
    odie "Could not find any previous tags!" unless previous_tag

    end_ref = ARGV.named[1] || "origin/master"

    [previous_tag, end_ref].each do |ref|
      next if quiet_system "git", "rev-parse", "--verify", "--quiet", ref
      odie "Ref #{ref} does not exist!"
    end

    output = Utils.popen_read("git log --pretty=format:'%s >> - %b%n' '#{previous_tag}'..'#{end_ref}'")
                  .lines.grep(/Merge pull request/)

    output.map! do |s|
      s.gsub(%r{.*Merge pull request #(\d+) from ([^/]+)/[^>]*(>>)*},
             "https://github.com/Homebrew/brew/pull/\\1 (@\\2)")
    end
    if ARGV.include?("--markdown")
      output.map! do |s|
        /(.*\d)+ \(@(.+)\) - (.*)/ =~ s
        "- [#{Regexp.last_match(3)}](#{Regexp.last_match(1)}) (@#{Regexp.last_match(2)})"
      end
    end

    puts "Release notes between #{previous_tag} and #{end_ref}:"
    puts output
  end
end
1"># # Write: !dice version # For Version Information # # Write: !dice help # For Information about how to use it use strict; use vars qw($VERSION %IRSSI); use Irssi qw(command_bind signal_add); use IO::File; $VERSION = '0.00.04'; %IRSSI = ( authors => 'Marcel Kossin', contact => 'mkossin@enumerator.org', name => 'dice', description => 'A Dice Simulator for Roleplaying in Channels or just for fun.', license => 'GNU GPL Version 2 or later', url => 'http://www.enumerator.org/component/option,com_docman/task,view_category/Itemid,34/subcat,7/' ); sub own_question { my ($server, $msg, $nick, $address, $target) = @_; question($server, $msg, $nick, $target); } sub public_question { my ($server, $msg, $nick, $address, $target) = @_; question($server, $msg, $nick, $target); } sub question($server, $msg, $nick, $target) { my ($server, $msg, $nick, $target) = @_; $_ = $msg; if (!/^!dice/i) { return 0; } if (/^!dice:.+[d|w]\d+/i) { my $value; my $rnd; my $forloop; my $sides; my $lang; my @dice = split(/ /,$_,2); my @dices = split(/[d|w|D|W]/,$dice[1],2); if ($_ = /^.*[w|W].*/i) { $lang = "DE"; } else { $lang = "EN"; } SWITCH: { if ($lang eq "DE") { $server->command('msg '.$target.' '.$nick.' w�rfelt mit dem '.$dice[1].'..... '); last SWITCH; } if ($lang eq "EN") { $server->command('msg '.$target.' '.$nick.' tosses with the '.$dice[1].'..... '); last SWITCH; } } if($dices[1] > 1) { if($dices[1] < 100) { if($dices[0] < 11) { if($dices[0] < 1) { $dices[0] = 1; } for($forloop = 1; $forloop <= $dices[0]; $forloop++) { $rnd = int(rand($dices[1]-1)); if($rnd == 0){ $rnd = $dices[1]; } $value = $value + $rnd; SWITCH: { if ($lang eq "DE") { $server->command('msg '.$target.' '.$nick.' w�rfelt beim '.$forloop.'. Wurf eine '.$rnd); last SWITCH; } if ($lang eq "EN") { $server->command('msg '.$target.' '.$nick.' tosses at his '.$forloop.'. try a '.$rnd); last SWITCH; } } } SWITCH: { if ($lang eq "DE") { $server->command('msg '.$target.' '.$nick.' ist fertig mit W�rfeln. Sein Ergebnis lautet: '.$value); last SWITCH; } if ($lang eq "EN") { $server->command('msg '.$target.' '.$nick.' finished. His result reads: '.$value); last SWITCH; } } } else { SWITCH: { if ($lang eq "DE") { $server->command('msg '.$target.' '.$nick.' meint wohl in d'.$dices[1].'�s baden zu m�ssen... Mal im Ernst versuch es mit weniger W�rfeln!' ); last SWITCH; } if ($lang eq "EN") { $server->command('msg '.$target.' '.$nick.' seems to wanna take a bath in d'.$dices[1].'�s... Seriously! Try less dice' ); last SWITCH; } } } } else { SWITCH: { if ($lang eq "DE") { $server->command('msg '.$target.' '.$nick.' baut uns bald einen riiiiiesigen d'.$dices[1].'... Mal im Ernst versuch es mit weniger Augen!' ); last SWITCH; } if ($lang eq "EN") { $server->command('msg '.$target.' '.$nick.' soon will build us a biiiiiiiiiig d'.$dices[1].'... Seriously! Try less sides' ); last SWITCH; } } } } else { if($dices[1] == "0") { SWITCH: { if ($lang eq "DE") { $server->command('msg '.$target.' '.$nick.' ist dumm wie Kn�ckebrot... Oder hat jemand schonmal einen W�rfel ohne Seiten gesehen?' ); last SWITCH; } if ($lang eq "EN") { $server->command('msg '.$target.' '.$nick.' is chuckleheaded... Or has anybody ever seen a dice without sides?' ); last SWITCH; } } } if($dices[1] == "1") { SWITCH: { if ($lang eq "DE") { $server->command('msg '.$target.' '.$nick.' ist dumm wie Dosenthunfisch... Oder hat jemand schonmal einen W�rfel mit einer Seite gesehen?' ); last SWITCH; } if ($lang eq "EN") { $server->command('msg '.$target.' '.$nick.' plays possum... Or has anybody ever seen a dice with only one side?' ); last SWITCH; } } } } return 0; } elsif (/^!dice: version$/i){ $server->command('msg '.$target.' dice Version: '.$VERSION.' by mkossin'); return 0; } elsif (/^!dice: help$/i){ $server->command('msg '.$target.' '.$nick.' Please explain which dice you want to toss: "!dice: <quantity of dice>d<sides on dice>" e. g. "!dice: 2d20"'); return 0; } elsif (/^!dice: hilfe$/i){ $server->command('msg '.$target.' '.$nick.' Sag mir welchen W�rfel du werfen m�chtest: "!dice: <Anzahl der W�rfel>w<Augen des W�rfels>" z. B. "!dice: 2w20"'); return 0; } else { if(!/^!dice.*:/i){ $server->command('msg '.$target.' '.$nick.' "!dice: help" - gives you the english help'); $server->command('msg '.$target.' '.$nick.' "!dice: hilfe" - zeigt die Deutsche Hilfe an'); return 0; } } } signal_add("message public", "public_question"); signal_add("message own_public", "own_question");