Sha256: 94dffdce613f009605575fe7aa1f1ece236422e254e8ab1f0440dd39a5fa21fa

Contents?: true

Size: 975 Bytes

Versions: 2

Compression:

Stored size: 975 Bytes

Contents

module VCLog

  class VCS

    # = SVN
    #
    # Raw SVN format:
    #
    #   ------------------------------------------------------------------------
    #   r34 | transami | 2006-08-02 22:10:11 -0400 (Wed, 02 Aug 2006) | 2 lines
    #
    #   change foo to work better
    #
    class SVN

      def initialize
      end

      ###
      def changelog
        @changelog ||= generate_changelog
      end

      ###
      def generate_changelog
        log = Changelog.new

        txt = `svn log`.strip

        com = txt.split(/^[-]+$/)

        com.each do |msg|
          msg = msg.strip

          next if msg.empty?

          idx = msg.index("\n")
          head = msg.slice!(0...idx)
          rev, who, date, cnt = *head.split('|')

          rev  = rev.strip
          who  = who.strip
          msg  = msg.strip

          date = Time.parse(date)

          log.change(date, who, rev, msg)
        end

        @changelog = log
      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vclog-1.1 lib/vclog/vcs/svn.rb
vclog-1.0.0 lib/vclog/vcs/svn.rb