Changeset 4482

Show
Ignore:
Timestamp:
01/12/08 13:03:47 (5 years ago)
Author:
cho45
Message:

lang/ruby/misc/changelog-with-hatenastar.rb:

Separate tag setting.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/misc/changelog-with-hatenastar.rb

    r4447 r4482  
    2929TRAC_BASE = URI("http://coderepos.org/share/") 
    3030URI_MAX   = 1800 
     31INCLUDE_TAGS = ["release", "new", "bug", "interface"] 
    3132 
    3233def retrive_stars(entries, n=0) 
     
    7273        tags = [] 
    7374        tags << Regexp.last_match[1] while mesg.sub!(/\[([^\]]+)\]\s*$/, "") 
    74         unless tags.empty? 
     75        tags.reject! {|i| !INCLUDE_TAGS.include?(i) } 
     76        if !star && !tags.empty? 
    7577                star = [] 
    7678        end 
    7779        if star 
    7880                tags.concat star.map {|i| 
    79                         _, tag, msg = */^\s*\[(interface|bug|release)\]\s*(.*)\s*$/.match(i["quote"]) 
    80                         mesg << "\n(#{msg})" unless msg.empty? 
     81                        _, tag, msg = */^\s*\[(#{INCLUDE_TAGS.join("|")})\]\s*(.*)\s*$/.match(i["quote"]) 
     82                        mesg << "\n(#{msg})" if msg && !msg.empty? 
    8183                        tag 
    8284                }.compact