Sha256: 6405e4f83d21d50919af7901b414bd9d5ecdffed9ef2d6ddfe660c70b6169009

Contents?: true

Size: 490 Bytes

Versions: 97

Compression:

Stored size: 490 Bytes

Contents

require 'v8'

module Gherkin
  # Thin adapter for the Javascript lexer, primarily used for testing.
  class JsLexer
    def self.[](i18n_underscored_iso_code)
      cxt = V8::Context.new
      cxt['exports'] = {}

      # Mimic Node.js / Firebug console.log
      cxt['console'] = STDOUT
      def STDOUT.log(*a)
        p a
      end

      cxt.load(File.dirname(__FILE__) + "/../../js/lib/gherkin/lexer/#{i18n_underscored_iso_code}.min.js")
      cxt['exports']['Lexer']
    end
  end
end

Version data entries

97 entries across 96 versions & 5 rubygems

Version Path
gherkin-2.11.0 lib/gherkin/js_lexer.rb
gherkin-2.11.0-x86-mswin32 lib/gherkin/js_lexer.rb
gherkin-2.11.0-x86-mingw32 lib/gherkin/js_lexer.rb
gherkin-2.11.0-java lib/gherkin/js_lexer.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/gherkin-2.9.0/lib/gherkin/js_lexer.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/lib/gherkin/js_lexer.rb
ftl-0.2.0 vendor/bundle/gems/gherkin-2.10.0/lib/gherkin/js_lexer.rb
gherkin-2.10.0 lib/gherkin/js_lexer.rb
gherkin-2.10.0-x86-mswin32 lib/gherkin/js_lexer.rb
gherkin-2.10.0-x86-mingw32 lib/gherkin/js_lexer.rb
gherkin-2.10.0-java lib/gherkin/js_lexer.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/lib/gherkin/js_lexer.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/lib/gherkin/js_lexer.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/lib/gherkin/js_lexer.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/lib/gherkin/js_lexer.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/lib/gherkin/js_lexer.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/gherkin-2.9.0/lib/gherkin/js_lexer.rb
gherkin-2.9.3 lib/gherkin/js_lexer.rb
gherkin-2.9.3-x86-mswin32 lib/gherkin/js_lexer.rb
gherkin-2.9.3-x86-mingw32 lib/gherkin/js_lexer.rb