From 6d9a629b9d0e0a0b6d95ab0b251a86a7c03874b4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 7 Jun 2009 11:17:39 -0700 Subject: [PATCH] renaming to rex to rexical --- CHANGELOG.rdoc | 6 ++++++ README.ja | 10 +++++----- README.rdoc | 13 ++++++------- Rakefile | 5 +++-- bin/rex | 4 ++-- lib/rex.rb | 3 --- lib/rexical.rb | 3 +++ lib/{rex => rexical}/generator.rb | 6 +++--- lib/{rex => rexical}/info.rb | 2 +- lib/{rex => rexical}/rexcmd.rb | 12 ++++++------ test/test_generator.rb | 18 +++++++++--------- 11 files changed, 44 insertions(+), 38 deletions(-) delete mode 100644 lib/rex.rb create mode 100644 lib/rexical.rb rename lib/{rex => rexical}/generator.rb (99%) rename lib/{rex => rexical}/info.rb (96%) rename lib/{rex => rexical}/rexcmd.rb (92%) diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index e2b472e..0c86cff 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -1,3 +1,9 @@ +=== 1.0.3 + +* Bug fixes + + * renamed to "Rexical" because someone already has "rex". + === 1.0.2 * Bug fixes diff --git a/README.ja b/README.ja index 1024088..190e701 100644 --- a/README.ja +++ b/README.ja @@ -1,7 +1,7 @@ -Rex README +Rexical README =========== - Rex は Ruby のためのスキャナジェネレータです。 + Rexical は Ruby のためのスキャナジェネレータです。 lex の Ruby 版に相当します。 Racc とともに使うように設計されています。 @@ -35,7 +35,7 @@ Rex README テスト ------ - sample/ 以下にいくつか Rex の文法ファイルのサンプルが用意 + sample/ 以下にいくつか Rexical の文法ファイルのサンプルが用意 してあります。以下を実行してください。 $ rex sample1.rex --stub @@ -48,7 +48,7 @@ Rex README $ rex calc3.rex $ ruby calc3.tab.rb - Rex の詳しい文法は doc/ ディレクトリ以下を見てください。 + Rexical の詳しい文法は doc/ ディレクトリ以下を見てください。 また記述例は sample/ ディレクトリ以下を見てください。 @@ -63,7 +63,7 @@ Rex README バグなど -------- - Rex を使っていてバグらしき現象に遭遇したら、下記のアドレスまで + Rexical を使っていてバグらしき現象に遭遇したら、下記のアドレスまで メールをください。 そのときはできるだけバグを再現できる文法ファイルを付けてください。 diff --git a/README.rdoc b/README.rdoc index 2ddde64..506eafa 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,11 +1,10 @@ -= Rex += Rexical -* http://rex.rubyforge.org -* http://github.com/aaronp/rex/tree/master +* http://github.com/tenderlove/rexical/tree/master == DESCRIPTION -Rex is a lexical scanner generator. +Rexical is a lexical scanner generator. It is written in Ruby itself, and generates Ruby program. It is designed for use with Racc. @@ -43,11 +42,11 @@ Here is the command line usage: == INSTALL -* sudo gem install rex +* sudo gem install rexical == LICENSE -Rex is distributed under the terms of the GNU Lesser General +Rexical is distributed under the terms of the GNU Lesser General Public License version 2. Note that you do NOT need to follow -LGPL for your own parser (Rex outputs). You can provide those +LGPL for your own parser (Rexical outputs). You can provide those files under any licenses you want. diff --git a/Rakefile b/Rakefile index 53c04ca..4702064 100644 --- a/Rakefile +++ b/Rakefile @@ -4,12 +4,13 @@ require 'rubygems' require 'hoe' $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib') -require 'rex' +require 'rexical' -HOE = Hoe.new('rex', Rex::VERSION) do |p| +HOE = Hoe.new('rexical', Rexical::VERSION) do |p| p.readme_file = 'README.rdoc' p.history_file = 'CHANGELOG.rdoc' p.developer('Aaron Patterson', 'aaronp@rubyforge.org') + p.rubyforge_name = 'ruby-rex' p.extra_rdoc_files = FileList['*.rdoc'] end diff --git a/bin/rex b/bin/rex index c6218bf..8546246 100644 --- a/bin/rex +++ b/bin/rex @@ -13,6 +13,6 @@ ## --------------------------------------------------------------------- require 'rubygems' -require 'rex' +require 'rexical' -Rex::Cmd.new.run +Rexical::Cmd.new.run diff --git a/lib/rex.rb b/lib/rex.rb deleted file mode 100644 index 935e3dd..0000000 --- a/lib/rex.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'rex/generator' -require 'rex/info' -require 'rex/rexcmd' diff --git a/lib/rexical.rb b/lib/rexical.rb new file mode 100644 index 0000000..ff36803 --- /dev/null +++ b/lib/rexical.rb @@ -0,0 +1,3 @@ +require 'rexical/generator' +require 'rexical/info' +require 'rexical/rexcmd' diff --git a/lib/rex/generator.rb b/lib/rexical/generator.rb similarity index 99% rename from lib/rex/generator.rb rename to lib/rexical/generator.rb index c6510bb..b93143c 100644 --- a/lib/rex/generator.rb +++ b/lib/rexical/generator.rb @@ -9,7 +9,7 @@ # require 'strscan' -module Rex +module Rexical ## --------------------------------------------------------------------- class ParseError < StandardError ; end @@ -388,7 +388,7 @@ def write_scanner f = scanner_io flag = "" flag += "i" if @opt['--ignorecase'] ## header - f.printf REX_HEADER, Rex::VERSION, grammar_file + f.printf REX_HEADER, Rexical::VERSION, grammar_file unless @opt['--independent'] f.printf "require 'racc/parser'\n" @@ -514,7 +514,7 @@ def scan_evaluate( str ) ## test if __FILE__ == $0 - rex = Rex::Generator.new(nil) + rex = Rexical::Generator.new(nil) rex.grammar_file = "sample.rex" rex.read_grammar rex.parse diff --git a/lib/rex/info.rb b/lib/rexical/info.rb similarity index 96% rename from lib/rex/info.rb rename to lib/rexical/info.rb index 7709a78..c12852c 100644 --- a/lib/rex/info.rb +++ b/lib/rexical/info.rb @@ -8,7 +8,7 @@ # the GNU Lesser General Public License version 2 or later. # -module Rex +module Rexical VERSION = '1.0.2' Copyright = 'Copyright (c) 2005-2006 ARIMA Yasuhiro' Mailto = 'arima.yasuhiro@nifty.com' diff --git a/lib/rex/rexcmd.rb b/lib/rexical/rexcmd.rb similarity index 92% rename from lib/rex/rexcmd.rb rename to lib/rexical/rexcmd.rb index 86345d1..844bbf6 100644 --- a/lib/rex/rexcmd.rb +++ b/lib/rexical/rexcmd.rb @@ -12,7 +12,7 @@ ## --------------------------------------------------------------------- require 'getoptlong' -module Rex +module Rexical class Cmd OPTIONS = <<-EOT @@ -35,7 +35,7 @@ def run usage 'too many grammar files given' if ARGV.size > 1 filename = ARGV[0] - rex = Rex::Generator.new(@opt) + rex = Rexical::Generator.new(@opt) begin rex.grammar_file = filename rex.read_grammar @@ -47,7 +47,7 @@ def run rex.write_scanner @status = 0 - rescue Rex::ParseError, Errno::ENOENT + rescue Rexical::ParseError, Errno::ENOENT msg = $!.to_s unless /\A\d/ === msg msg[0,0] = ' ' @@ -91,12 +91,12 @@ def initialize usage if @opt['--help'] if @opt['--version'] - puts "#{@cmd} version #{Rex::Version}" + puts "#{@cmd} version #{Rexical::Version}" exit 0 end if @opt['--copyright'] - puts "#{@cmd} version #{Rex::Version}" - puts "#{Rex::Copyright} <#{Rex::Mailto}>" + puts "#{@cmd} version #{Rexical::Version}" + puts "#{Rexical::Copyright} <#{Rexical::Mailto}>" exit 0 end end diff --git a/test/test_generator.rb b/test/test_generator.rb index 9c9592a..7dea80b 100644 --- a/test/test_generator.rb +++ b/test/test_generator.rb @@ -1,11 +1,11 @@ require 'test/unit' require 'tempfile' -require 'rex' +require 'rexical' require 'stringio' class TestGenerator < Test::Unit::TestCase def test_header_is_written_after_module - rex = Rex::Generator.new( + rex = Rexical::Generator.new( "--independent" => true ) rex.grammar_file = File.join File.dirname(__FILE__), 'assets', 'test.rex' @@ -26,7 +26,7 @@ def test_header_is_written_after_module end def test_read_non_existent_file - rex = Rex::Generator.new(nil) + rex = Rexical::Generator.new(nil) rex.grammar_file = 'non_existent_file' assert_raises Errno::ENOENT do rex.read_grammar @@ -34,7 +34,7 @@ def test_read_non_existent_file end def test_scanner_inherits - rex = Rex::Generator.new( + rex = Rexical::Generator.new( "--independent" => true ) rex.grammar_lines = StringScanner.new %q{ @@ -53,7 +53,7 @@ class Calculator < Bar end def test_scanner_inherits_many_levels - rex = Rex::Generator.new( + rex = Rexical::Generator.new( "--independent" => true ) rex.grammar_lines = StringScanner.new %q{ @@ -72,7 +72,7 @@ class Calculator < Foo::Bar end def test_simple_scanner - rex = Rex::Generator.new( + rex = Rexical::Generator.new( "--independent" => true ) rex.grammar_lines = StringScanner.new %q{ @@ -101,7 +101,7 @@ class Calculator end def test_simple_scanner_with_macros - rex = Rex::Generator.new( + rex = Rexical::Generator.new( "--independent" => true ) rex.grammar_lines = StringScanner.new %q{ @@ -132,7 +132,7 @@ class Calculator end def test_nested_macros - rex = Rex::Generator.new( + rex = Rexical::Generator.new( "--independent" => true ) rex.grammar_lines = StringScanner.new %q{ @@ -153,7 +153,7 @@ class Calculator end def test_more_nested_macros - rex = Rex::Generator.new( + rex = Rexical::Generator.new( "--independent" => true ) rex.grammar_lines = StringScanner.new %q{