Skip to content
This repository
tag: 1.1RC2
Fetching contributors…

Cannot retrieve contributors at this time

file 26 lines (20 sloc) 0.672 kb
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
#!/usr/bin/env ruby

require 'yaml'

abort "jruby.properties filename location needed" unless ARGV[0]

svn_props = YAML::load(`svn info`)

url = svn_props["URL"]
revision = svn_props["Revision"].to_s
path = url =~ /#{svn_props["Repository Root"]}\/(.*)/ && $1
tag = case path
when /trunk/
  "trunk"
when /(tags|branches)\/(.*)/
  "#{$1.sub(/e?s$/, '')}-#{$2}"
else
  path.gsub(%r{/}, '-')
end

properties = File.open(ARGV[0]) {|f| f.read}
properties.sub!(/^version.jruby=.*$/, "version.jruby=#{tag}-#{revision}")
properties.sub!(/Revision: \d+/, "Revision: #{revision}")
properties << "\nurl=#{url}\nrevision=#{revision}\n"

File.open(ARGV[0], "w") {|f| f << properties }
Something went wrong with that request. Please try again.