diff --git a/Gemfile b/Gemfile index afbd5abf..3b3dcd71 100644 --- a/Gemfile +++ b/Gemfile @@ -4,5 +4,5 @@ group :development do gem "rake", "13.0.6" gem "rake-compiler", "1.2.3" gem "test-unit", "3.6.1" - gem "test-unit-ruby-core", "1.0.1" + gem "test-unit-ruby-core", "1.0.5" end diff --git a/Rakefile b/Rakefile index 62a7b4ee..cd60025f 100644 --- a/Rakefile +++ b/Rakefile @@ -4,8 +4,9 @@ require "bundler/gem_tasks" require 'rdoc/task' +spec = Gem::Specification.load("racc.gemspec") + RDoc::Task.new(:docs) do |rd| - spec = Gem::Specification.load("racc.gemspec") rd.main = "README.en.rdoc" rd.rdoc_files.include(spec.files.find_all { |file_name| file_name =~ /^(bin|lib|ext)/ || file_name !~ /\// @@ -47,6 +48,14 @@ end } end +javasrc, = Dir.glob('ext/racc/**/Cparse.java') +task :compile => javasrc do + code = File.binread(javasrc) + if code.sub!(/RACC_VERSION\s*=\s*"\K([^"]*)(?=")/) {|v| break if v == spec.version; spec.version} + File.binwrite(javasrc, code) + end +end + lib_dir = nil # for dummy rake/extensiontask.rb at ruby test-bundled-gems if jruby? # JRUBY diff --git a/ext/racc/com/headius/racc/Cparse.java b/ext/racc/com/headius/racc/Cparse.java index 106e2db8..1f927c25 100644 --- a/ext/racc/com/headius/racc/Cparse.java +++ b/ext/racc/com/headius/racc/Cparse.java @@ -45,7 +45,7 @@ import org.jruby.runtime.load.Library; public class Cparse implements Library { - public static final String RACC_VERSION = "1.7.2"; // TODO: parse from Cparse.c + public static final String RACC_VERSION = "1.7.3.dev.1"; // TODO: parse from Cparse.c public enum TokenType { DEFAULT(-1), diff --git a/lib/racc/info.rb b/lib/racc/info.rb index 6129f9b9..34acda54 100644 --- a/lib/racc/info.rb +++ b/lib/racc/info.rb @@ -12,7 +12,7 @@ #++ module Racc - VERSION = '1.7.2' + VERSION = '1.7.3.dev.1' Version = VERSION Copyright = 'Copyright (c) 1999-2006 Minero Aoki' end