{"id":18728756,"url":"https://github.com/rubyonworld/gherkin-ruby","last_synced_at":"2025-11-12T05:30:18.084Z","repository":{"id":174007917,"uuid":"542157179","full_name":"RubyOnWorld/gherkin-ruby","owner":"RubyOnWorld","description":"A new rewrite of the Gherkin parser used by Cucumber is planned (for version 3.0) gherkin-ruby will not add any more features until then, and will eventually be deprecated in favor of Gherkin 3.0.","archived":false,"fork":false,"pushed_at":"2022-09-27T17:10:29.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T14:26:19.058Z","etag":null,"topics":["cucumbr","gherkin","parser","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyOnWorld.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-27T15:27:25.000Z","updated_at":"2022-09-27T17:54:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbf54500-58aa-4b01-8d3b-237bf7404ae7","html_url":"https://github.com/RubyOnWorld/gherkin-ruby","commit_stats":null,"previous_names":["rubyonworld/gherkin-ruby"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fgherkin-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fgherkin-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fgherkin-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fgherkin-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/gherkin-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599039,"owners_count":19665911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cucumbr","gherkin","parser","ruby"],"created_at":"2024-11-07T14:24:15.959Z","updated_at":"2025-11-12T05:30:18.011Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Ruby","readme":"# gherkin-ruby [![Build Status](https://secure.travis-ci.org/codegram/gherkin-ruby.png)](http://travis-ci.org/codegram/gherkin-ruby) [![Dependency Status](https://gemnasium.com/codegram/gherkin-ruby.png)](http://gemnasium.com/codegram/gherkin-ruby)\nGherkin-ruby is a pure Ruby implementation of a [Gherkin](http://github.com/cucumber/gherkin) parser.\n\nTested with MRI 1.9.3, 2.0.0, head, Rubinius 2.0.0-rc1 and Rubinius head.\n\n## WARNING: Will be deprecated after Gherkin 3.0\n\nA new rewrite of the Gherkin parser used by Cucumber is planned (for version\n3.0) gherkin-ruby will not add any more features until then, and will\neventually be deprecated in favor of Gherkin 3.0.\n\n## FAQ\n\n### Why this one over the official, fast, Ragel-based Gherkin parser?\n\n* Less than 200 LOC.\n* No Java/.NET crap.\n* Fast enough for our purposes (using it for the [Spinach](http://github.com/codegram/spinach) project)\n\n### Why don't you support tables?\n\n* Because we believe it's a BDD anti-pattern. Tables show the need for more\n  unit tests.\n\n## Install\n\n    $ gem install gherkin-ruby\n\nOr in your Gemfile:\n\n```ruby\n# Gemfile\n\ngem 'gherkin-ruby'\n```\n\n## Usage\nYou can easily implement your own visitors to traverse the Abstract Syntax Tree. The following example just prints the step names to standard output:\n\n```ruby\nclass MyVisitor\n  def visit(ast)\n    ast.accept(self)\n  end\n\n  def visit_Feature(feature)\n    # Do something nasty with the feature\n    # Set whatever state you want:\n    #   @current_feature = feature\n    # etc etc\n    # And keep visiting its children:\n\n    feature.each { |scenario| scenario.accept(self) }\n  end\n\n  def visit_Scenario(scenario)\n    # Do something nasty with the scenario\n    # Set whatever state you want:\n    #   @current_scenario = scenario\n    # etc etc\n    # And keep visiting its children:\n\n    scenario.each { |step| step.accept(self) }\n  end\n\n  def visit_Background(background)\n    # Do something nasty with the background\n    # And keep visiting its children:\n\n    background.each { |step| step.accept(self) }\n  end\n\n  def visit_Tag(tag)\n    # Do something nasty with the tag\n  end\n\n  def visit_Step(step)\n    # Finally, print the step name.\n    puts \"STEP: #{step.name}\"\n  end\nend\n\nast = Gherkin.parse(File.read('some.feature'))\nvisitor = MyVisitor.new\nvisitor.visit(ast)\n```\n\n## Todo\n\n* Some optimization\n\n## FAQ\n\n\n\n## License\n\nMIT (Expat) License. Copyright 2011-2013 [Codegram Technologies](http://codegram.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fgherkin-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fgherkin-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fgherkin-ruby/lists"}