Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pure-ruby grok fails tests #6

Closed
crankycoder opened this issue Oct 12, 2011 · 10 comments
Closed

pure-ruby grok fails tests #6

crankycoder opened this issue Oct 12, 2011 · 10 comments

Comments

@crankycoder
Copy link

I just installed jls-grok 0.9.0 and when I fetch code from the github repository and manually run tests, I get this:

/Users/victorng/dev/grok/ruby/test/pure-ruby $ jruby alltests.rb

Loading tests: ./general/basic_test.rb
Loading tests: ./general/captures_test.rb
Loading tests: ./patterns/day.rb
Loading tests: ./patterns/host.rb
Loading tests: ./patterns/ip.rb
Loading tests: ./patterns/iso8601.rb
Loading tests: ./patterns/month.rb
Loading tests: ./patterns/number.rb
Loading tests: ./patterns/path.rb
Loading tests: ./patterns/prog.rb
Loading tests: ./patterns/quotedstring.rb
Loading tests: ./patterns/uri.rb
Loaded suite alltests
Started
E..EE..EEEEEFEEEEEEEEEEEEEEEEEEEE
Finished in 0.524 seconds.

  1. Error:
    test_days(DayPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/day.rb:10:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  2. Error:
    test_grok_expanded_pattern_works_correctly(GrokBasicTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/basic_test.rb:45:intest_grok_expanded_pattern_works_correctly'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  3. Error:
    test_grok_load_patterns_from_file(GrokBasicTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/basic_test.rb:55:intest_grok_load_patterns_from_file'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  4. Error:
    test_basic_capture(GrokPatternCapturingTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/captures_test.rb:23:intest_basic_capture'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  5. Error:
    test_capture_methods(GrokPatternCapturingTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/captures_test.rb:12:intest_capture_methods'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  6. Error:
    test_multiple_captures(GrokPatternCapturingTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/captures_test.rb:64:intest_multiple_captures'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  7. Error:
    test_multiple_captures_with_same_name(GrokPatternCapturingTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/captures_test.rb:52:intest_multiple_captures_with_same_name'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  8. Error:
    test_nested_captures(GrokPatternCapturingTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/captures_test.rb:77:intest_nested_captures'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  9. Failure:
    test_nesting_recursion(GrokPatternCapturingTests)
    [./general/captures_test.rb:89:in test_nesting_recursion' org/jruby/RubyKernel.java:2092:insend'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach']:
    exception expected but was
    Class:
    Message: <"can't convert String into Integer">
    ---Backtrace---
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/captures_test.rb:90:intest_nesting_recursion'
    ./general/captures_test.rb:89:in test_nesting_recursion' org/jruby/RubyKernel.java:2092:insend'
    org/jruby/RubyArray.java:1603:in `each'

org/jruby/RubyArray.java:1603:in `each'

  1. Error:
    test_valid_capture_subnames(GrokPatternCapturingTests):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./general/captures_test.rb:98:intest_valid_capture_subnames'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  2. Error:
    test_hosts(HostPattternTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/host.rb:10:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  3. Error:
    test_ips(IPPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/ip.rb:13:intest_ips'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  4. Error:
    test_non_ips(IPPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/ip.rb:23:intest_non_ips'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  5. Error:
    test_iso8601(ISO8601PatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/iso8601.rb:10:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  6. Error:
    test_iso8601_nomatch(ISO8601PatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/iso8601.rb:10:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  7. Error:
    test_months(MonthPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/month.rb:10:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  8. Error:
    test_match_base16num(NumberPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/number.rb:58:intest_match_base16num'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  9. Error:
    test_match_number(NumberPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/number.rb:13:intest_match_number'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  10. Error:
    test_match_number_amid_things(NumberPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/number.rb:37:intest_match_number_amid_things'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  11. Error:
    test_match_number_float(NumberPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/number.rb:27:intest_match_number_float'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  12. Error:
    test_no_match_number(NumberPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/number.rb:50:intest_no_match_number'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  13. Error:
    test_unix_paths(PathPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/path.rb:10:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  14. Error:
    test_windows_paths(PathPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/path.rb:10:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  15. Error:
    test_progs(ProgPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/prog.rb:9:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

  16. Error:
    test_escaped_quotes_no_match_quoted_string(QuotedStringPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/quotedstring.rb:38:intest_escaped_quotes_no_match_quoted_string'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  17. Error:
    test_non_quoted_strings_no_match(QuotedStringPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/quotedstring.rb:47:intest_non_quoted_strings_no_match'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  18. Error:
    test_quoted_string_common(QuotedStringPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/quotedstring.rb:13:intest_quoted_string_common'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  19. Error:
    test_quoted_string_inside_escape(QuotedStringPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/quotedstring.rb:27:intest_quoted_string_inside_escape'
    org/jruby/RubyKernel.java:2092:in send' org/jruby/RubyArray.java:1603:ineach'
    org/jruby/RubyArray.java:1603:in `each'

  20. Error:
    test_urls(URIPatternsTest):
    TypeError: can't convert String into Integer
    org/jruby/RubyArray.java:1338:in []' org/jruby/RubyMatchData.java:403:in[]'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:78:in compile' org/jruby/RubyKernel.java:1419:inloop'
    /Users/victorng/dev/grok/ruby/lib/grok-pure.rb:70:in compile' ./patterns/uri.rb:9:insetup'
    org/jruby/RubyArray.java:1603:in each' org/jruby/RubyArray.java:1603:ineach'

33 tests, 14 assertions, 1 failures, 28 errors

@jordansissel
Copy link
Owner

I'm confused. You're using an older version of grok with tests from the master branch?

@crankycoder
Copy link
Author

I tried removing the gem and reinstalling from source. Unless I'm screwing
something up - which is entirely possible because I'm a novice with ruby- I
can't get tests to pass.
On Oct 12, 2011 5:56 PM, "Jordan Sissel" <
reply@reply.github.com>
wrote:

I'm confused. You're using an older version of grok with tests from the
master branch?

Reply to this email directly or view it on GitHub:
#6 (comment)

@jordansissel
Copy link
Owner

What version of jruby are you using?

@crankycoder
Copy link
Author

Sorry, not at my computer right now. I'll send better bug reports. if it's
of any use, I'm using whatever homebrew on osx installed. I just put it in
last week.
On Oct 12, 2011 5:59 PM, "Jordan Sissel" <
reply@reply.github.com>
wrote:

What version of jruby are you using?

Reply to this email directly or view it on GitHub:
#6 (comment)

@jordansissel
Copy link
Owner

No worries about bug report quality, easy to ask for more data. I want grok to work for you :)

@crankycoder
Copy link
Author

Ok, so here's what I've got - again, I'm new to ruby - I'm coming from a
python/mercurial world so if you think I'm overlooking something - I
probably am.

Before you go and read the rest of this email, I'm just pulling from
whatever is in github. I'm assuming that the master branch is deployable.
If that's not the case, can you tell me how to checkout and run tests
against the released gem of jls-grok?

So here we go:

http://pastebin.com/xPHZk3mV

That said, I've just realized I don't actually need the grok library
anymore, but I would like to be able to get tests to pass properly.

vic

On Wed, Oct 12, 2011 at 6:08 PM, Jordan Sissel <
reply@reply.github.com>wrote:

No worries about bug report quality, easy to ask for more data. I want grok
to work for you :)

Reply to this email directly or view it on GitHub:
#6 (comment)

@jordansissel
Copy link
Owner

On Wed, Oct 12, 2011 at 5:30 PM, Victor Ng <
reply@reply.github.com>wrote:

Ok, so here's what I've got - again, I'm new to ruby - I'm coming from a
python/mercurial world so if you think I'm overlooking something - I
probably am.

Before you go and read the rest of this email, I'm just pulling from
whatever is in github. I'm assuming that the master branch is deployable.
If that's not the case, can you tell me how to checkout and run tests
against the released gem of jls-grok?

So here we go:

http://pastebin.com/xPHZk3mV

That said, I've just realized I don't actually need the grok library
anymore, but I would like to be able to get tests to pass properly.

If I check out the grok code, master branch, all the tests pass for me.

If you look at what 'make test-pure' does, it invokes "ruby". The 'pure ruby
grok' will only work under Ruby 1.9.2 syntax, which requires JRuby 1.6.x or
Ruby 1.9.2 itself.

It is likely that whatever "ruby" runs is not one of these. Here, I can even
reproduce your error by using the wrong ruby:

% ruby --version
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

% make test-pure
JRUBY_OPTS=--1.9 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$PWD/../../"
RUBYLIB="$PWD/../lib" ruby pure-ruby/alltests.rb
Loading tests: pure-ruby/general/captures_test.rb
./pure-ruby/general/captures_test.rb:2:in `require':
/home/jls/projects/grok/ruby/test/../lib/grok-pure.rb:22: undefined (?...)
sequence: /%{ # match '%{' not prefixed with '' (SyntaxError)

But if I use a supported version of ruby, it works (ruby 1.9.2, jruby 1.6.4,
etc)

-Jordan

@crankycoder
Copy link
Author

bingo. thanks. i didn't see the 'ruby' in there. flipped it to jruby and
everything is happy. both my failures i posted as bugs are running clean
now.

thanks,
vic

On Thu, Oct 13, 2011 at 11:56 AM, Jordan Sissel <
reply@reply.github.com>wrote:

On Wed, Oct 12, 2011 at 5:30 PM, Victor Ng <
reply@reply.github.com>wrote:

Ok, so here's what I've got - again, I'm new to ruby - I'm coming from a
python/mercurial world so if you think I'm overlooking something - I
probably am.

Before you go and read the rest of this email, I'm just pulling from
whatever is in github. I'm assuming that the master branch is
deployable.
If that's not the case, can you tell me how to checkout and run tests
against the released gem of jls-grok?

So here we go:

http://pastebin.com/xPHZk3mV

That said, I've just realized I don't actually need the grok library
anymore, but I would like to be able to get tests to pass properly.

If I check out the grok code, master branch, all the tests pass for me.

If you look at what 'make test-pure' does, it invokes "ruby". The 'pure
ruby
grok' will only work under Ruby 1.9.2 syntax, which requires JRuby 1.6.x or
Ruby 1.9.2 itself.

It is likely that whatever "ruby" runs is not one of these. Here, I can
even
reproduce your error by using the wrong ruby:

% ruby --version
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

% make test-pure
JRUBY_OPTS=--1.9 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$PWD/../../"
RUBYLIB="$PWD/../lib" ruby pure-ruby/alltests.rb
Loading tests: pure-ruby/general/captures_test.rb
./pure-ruby/general/captures_test.rb:2:in `require':
/home/jls/projects/grok/ruby/test/../lib/grok-pure.rb:22: undefined (?...)
sequence: /%{ # match '%{' not prefixed with '' (SyntaxError)

But if I use a supported version of ruby, it works (ruby 1.9.2, jruby
1.6.4,
etc)

-Jordan

Reply to this email directly or view it on GitHub:
#6 (comment)

@crankycoder
Copy link
Author

The makefile has ruby hardcoded into it, if you flip it to jruby - things work fine.

@jordansissel
Copy link
Owner

On Thu, Oct 13, 2011 at 9:22 AM, Victor Ng <
reply@reply.github.com>wrote:

bingo. thanks. i didn't see the 'ruby' in there. flipped it to jruby and
everything is happy. both my failures i posted as bugs are running clean
now.

Excellent! Glad things are working for you now :)

-Jordan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants