gherkin 2.11.4 → 2.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  # When both are building OK, do a `bundle exec rake install` in both cucumber and gherkin projects, revert the changes in the first 2 steps
16
16
  # and release both projects. Do this for both ruby 1.8.7, ruby 1.9.3 and jruby.
17
17
  #
18
- s.version = "2.11.4"
18
+ s.version = "2.11.5"
19
19
  s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Hellesøy"]
20
20
  s.description = "A fast Gherkin lexer/parser based on the Ragel State Machine Compiler."
21
21
  s.summary = "#{s.name}-#{s.version}"
@@ -91,7 +91,7 @@
91
91
  "scenario": "Scénář",
92
92
  "scenario_outline": "Náčrt Scénáře|Osnova scénáře",
93
93
  "examples": "Příklady",
94
- "given": "*|Pokud",
94
+ "given": "*|Pokud|Za předpokladu",
95
95
  "when": "*|Když",
96
96
  "then": "*|Pak",
97
97
  "and": "*|A také|A",
@@ -5,13 +5,20 @@ module Gherkin
5
5
 
6
6
  COMMENT_OR_EMPTY_LINE_PATTERN = /^\s*#|^\s*$/
7
7
  ENCODING_PATTERN = /^\s*#\s*encoding\s*:\s*([0-9a-zA-Z\-]+)/i #:nodoc:
8
+ DEFAULT_ENCODING = 'UTF-8'
8
9
 
9
10
  def read_file(path)
10
11
  source = File.new(path).read
11
12
  enc = encoding(source)
12
- if(enc != 'UTF-8')
13
+ if(enc != DEFAULT_ENCODING)
13
14
  # Read it again with different encoding
14
- source = File.new(path, "r:#{enc}:UTF-8").read
15
+ source = File.new(path, "r:#{enc}:#{DEFAULT_ENCODING}").read
16
+ if source.respond_to?(:encode)
17
+ source = source.encode(DEFAULT_ENCODING)
18
+ else
19
+ require 'iconv'
20
+ source = Iconv.new(DEFAULT_ENCODING, enc).iconv(source)
21
+ end
15
22
  end
16
23
  source
17
24
  end
@@ -19,7 +26,7 @@ module Gherkin
19
26
  private
20
27
 
21
28
  def encoding(source)
22
- encoding = 'UTF-8'
29
+ encoding = DEFAULT_ENCODING
23
30
  source.each_line do |line|
24
31
  break unless COMMENT_OR_EMPTY_LINE_PATTERN =~ line
25
32
  if ENCODING_PATTERN =~ line
@@ -24,6 +24,9 @@ namespace :release do
24
24
 
25
25
  desc 'Push npm package to http://npmjs.org/'
26
26
  task :push_npm_package do
27
+ en_min_js = File.expand_path(File.dirname(__FILE__) + '/../js/lib/gherkin/lexer/en.min.js')
28
+ raise "No #{en_min_js}. Did you set GHERKIN_JS=true in your shell?" unless File.file?(en_min_js)
29
+
27
30
  Dir.chdir('js') do
28
31
  sh("npm publish")
29
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gherkin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.4
4
+ version: 2.11.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-10-09 00:00:00.000000000 Z
14
+ date: 2012-10-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake-compiler
@@ -125,6 +125,22 @@ dependencies:
125
125
  - - ! '>='
126
126
  - !ruby/object:Gem::Version
127
127
  version: 0.9.9
128
+ - !ruby/object:Gem::Dependency
129
+ name: therubyracer
130
+ requirement: !ruby/object:Gem::Requirement
131
+ none: false
132
+ requirements:
133
+ - - ! '>='
134
+ - !ruby/object:Gem::Version
135
+ version: 0.10.2
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: 0.10.2
128
144
  - !ruby/object:Gem::Dependency
129
145
  name: yard
130
146
  requirement: !ruby/object:Gem::Requirement
@@ -499,7 +515,7 @@ rubyforge_project:
499
515
  rubygems_version: 1.8.24
500
516
  signing_key:
501
517
  specification_version: 3
502
- summary: gherkin-2.11.4
518
+ summary: gherkin-2.11.5
503
519
  test_files:
504
520
  - features/escaped_pipes.feature
505
521
  - features/feature_parser.feature