class RubyPatchesMerger::Revisions

Public Class Methods

new(strings, base = 'http://svn.ruby-lang.org') click to toggle source
# File lib/ruby_patches_merger/revisions.rb, line 49
def initialize(strings, base = 'http://svn.ruby-lang.org')
  @strings = strings
  @base = base
end

Public Instance Methods

each_revision(&block) click to toggle source
# File lib/ruby_patches_merger/revisions.rb, line 53
def each_revision(&block)
  @strings.map{ |string| block.call(Revision.new(string, @base)) }
end
save_to(path) click to toggle source
# File lib/ruby_patches_merger/revisions.rb, line 57
def save_to(path)
  FileUtils.mkdir_p(path)
  each_revision do |revision|
    file_path = File.join(path,"#{revision}.patch")
    puts file_path
    File.open(file_path, "w+")do |f|
      revision.each_link do |link|
        puts "# #{link.name}"
        f.write(link.content)
      end
    end
  end
end