diff --git a/.gitignore b/.gitignore index 570fbf81029442ab30ef3f4c6e691fa04146efd7..8101f080f272a845eb7cc6cf9b6447d0f17cf469 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ libhammer.pc .sconsign.dblite *.os *.pyc +*.gem diff --git a/src/bindings/ruby/README.md b/src/bindings/ruby/README.md index 480f25592323435549c619e2bf2985b499f6de4c..849db218d93ffd65d7678045876b33165d058898 100644 --- a/src/bindings/ruby/README.md +++ b/src/bindings/ruby/README.md @@ -50,7 +50,7 @@ Add hammer to your Gemfile. Use hammer in your project. - `require 'hammer'` + `require 'hammer-parser'` ### Building a parser diff --git a/src/bindings/ruby/hammer-parser.gemspec b/src/bindings/ruby/hammer-parser.gemspec index 9a4a616ab8383e0afe2bd5240fd64d2986effcbd..158bc264b7398106683a5fc419265887a0abdbcb 100644 --- a/src/bindings/ruby/hammer-parser.gemspec +++ b/src/bindings/ruby/hammer-parser.gemspec @@ -1,7 +1,7 @@ #encoding: UTF-8 Gem::Specification.new do |s| s.name = 'hammer-parser' - s.version = '0.1.0' + s.version = '0.2.0' s.summary = 'Ruby bindings to the hammer parsing library.' s.description = s.summary # TODO: longer description? s.authors = ['Meredith L. Patterson', 'TQ Hirsch', 'Jakob Rath'] @@ -15,7 +15,7 @@ Gem::Specification.new do |s| "lib/hammer/internal.rb", "lib/hammer/parser.rb", "lib/hammer/parser_builder.rb", - "lib/hammer.rb", + "lib/hammer-parser.rb", "lib/minitest/hamer-parser_plugin.rb", "test/autogen_test.rb", "test/parser_test.rb" diff --git a/src/bindings/ruby/lib/hammer.rb b/src/bindings/ruby/lib/hammer-parser.rb similarity index 87% rename from src/bindings/ruby/lib/hammer.rb rename to src/bindings/ruby/lib/hammer-parser.rb index 916a0a505cad5cb148ccb20f86546f05bdb9b119..662233703083324f897abfff5b05c6ee36275253 100644 --- a/src/bindings/ruby/lib/hammer.rb +++ b/src/bindings/ruby/lib/hammer-parser.rb @@ -2,11 +2,6 @@ require 'hammer/internal' require 'hammer/parser' require 'hammer/parser_builder' -# TODO: -# Probably need to rename this file to 'hammer-parser.rb', so -# people can use "require 'hammer-parser'" in their code. - - # Leave this in for now to be able to play around with HParseResult in irb. x = nil parser = Hammer::Parser.build { diff --git a/src/bindings/ruby/lib/hammer/parser.rb b/src/bindings/ruby/lib/hammer/parser.rb index d1177c576e7ba811f1bc75d7001747b1fcb23481..2f19e15750d73ff19a6b5beef1ae917b80be8517 100644 --- a/src/bindings/ruby/lib/hammer/parser.rb +++ b/src/bindings/ruby/lib/hammer/parser.rb @@ -19,8 +19,10 @@ module Hammer @dont_gc = dont_gc.dup end + # dont_gc is required to build a fuzzer from the declaration of Hammer::Parser object. attr_reader :name attr_reader :h_parser + attr_reader :dont_gc # Parse the given data. Returns the parse result if successful, nil otherwise. # diff --git a/src/bindings/ruby/test/autogen_test.rb b/src/bindings/ruby/test/autogen_test.rb index 0600c0f66c139259f771fc2518b5af47128b08cd..2efc6a6b86f5650f20d89d24a46e71ae0909e238 100644 --- a/src/bindings/ruby/test/autogen_test.rb +++ b/src/bindings/ruby/test/autogen_test.rb @@ -1,6 +1,6 @@ require 'bundler/setup' require 'minitest/autorun' -require 'hammer' +require 'hammer-parser' class TestToken < Minitest::Test def setup super diff --git a/src/bindings/ruby/test/parser_test.rb b/src/bindings/ruby/test/parser_test.rb index 6bbdc3662553f1cf23dadc6e4953b39e28b3c182..78938fcef09b720b675f5fd616fc6cbf48b603bf 100644 --- a/src/bindings/ruby/test/parser_test.rb +++ b/src/bindings/ruby/test/parser_test.rb @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- require 'bundler/setup' -require 'hammer' +require 'hammer-parser' require 'minitest/autorun' class ParserTest < Minitest::Test