gherkin3 3.1.0 → 3.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b5220c8f72cd396ab0a8ec44e0c4ec82e7e0cdf
4
- data.tar.gz: c0229d0cf820b457b5e7a09aa309c86db07ecdfa
3
+ metadata.gz: a81f75966e784b53f08bc889ca623b5cec3ead69
4
+ data.tar.gz: f309592aed98e2edf99898075097e3fab25b0fac
5
5
  SHA512:
6
- metadata.gz: 46ce5c3083f84024343c7648c32504e2470a46830839700ba9ca2fbbb1805c2f527dc6ce18786d63adf660e2a84867f895c3b15e02be0712a7a4fa74e2d48621
7
- data.tar.gz: e3b7e5f8ba2717fe48ab65cb2fd74e581c27dc94b71c4a6bd58090878a2aca1da42eedae0e1aed69cc0873ede6a361ba57ac5bd745f5d3071804b0f5bec8ab69
6
+ metadata.gz: 47b1295ebe8c60d5e936e7c672dca0ccebb22c34d61740dbe7bd774f298a9321843b244ea4e202d719931ab99e91d13f5a7924b4272541a48da983cf2bb1ab5b
7
+ data.tar.gz: ce03ffe0eb6dab329deb7941720c63ae52917202cf7b828bd091310fe69627a3353f3c710e37427ca1f9f732fb4aa7c9e7ce2f7f215cd914e66efa31cd846038
data/CONTRIBUTING.md CHANGED
@@ -2,13 +2,15 @@ Please read [CONTRIBUTING](https://github.com/cucumber/gherkin3/blob/master/CONT
2
2
  You should clone the [cucumber/gherkin3](https://github.com/cucumber/gherkin3) repo if you want
3
3
  to contribute.
4
4
 
5
- ## Using make
5
+ ## Run tests
6
+
7
+ ### Using make
6
8
 
7
9
  Just run `make` from this directory.
8
10
 
9
11
  Even if you prefer `make` - run `rake` occasionally, as it reports better warnings.
10
12
 
11
- ## Using rake
13
+ ### Using rake
12
14
 
13
15
  Just run `rake` from this directory.
14
16
 
data/gherkin3.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'gherkin3'
4
- s.version = '3.1.0'
4
+ s.version = '3.1.1'
5
5
  s.authors = ["Gáspár Nagy", "Aslak Hellesøy", "Steve Tooke"]
6
6
  s.description = 'Gherkin parser'
7
7
  s.summary = "gherkin-#{s.version}"
@@ -208,6 +208,48 @@
208
208
  "Apabila "
209
209
  ]
210
210
  },
211
+ "bs": {
212
+ "and": [
213
+ "* ",
214
+ "I ",
215
+ "A "
216
+ ],
217
+ "background": [
218
+ "Pozadina"
219
+ ],
220
+ "but": [
221
+ "* ",
222
+ "Ali "
223
+ ],
224
+ "examples": [
225
+ "Primjeri"
226
+ ],
227
+ "feature": [
228
+ "Karakteristika"
229
+ ],
230
+ "given": [
231
+ "* ",
232
+ "Dato "
233
+ ],
234
+ "name": "Bosnian",
235
+ "native": "Bosanski",
236
+ "scenario": [
237
+ "Scenariju",
238
+ "Scenario"
239
+ ],
240
+ "scenarioOutline": [
241
+ "Scenariju-obris",
242
+ "Scenario-outline"
243
+ ],
244
+ "then": [
245
+ "* ",
246
+ "Zatim "
247
+ ],
248
+ "when": [
249
+ "* ",
250
+ "Kada "
251
+ ]
252
+ },
211
253
  "ca": {
212
254
  "and": [
213
255
  "* ",
@@ -34,19 +34,47 @@ module Gherkin3
34
34
  end
35
35
 
36
36
  def table_cells
37
- column = @indent + 1
38
- items = @trimmed_line_text.split('|')
39
- if @trimmed_line_text[-1] == '|'
40
- items = items[1..-1] # There is no space after last |, only skip space before first |
41
- else
42
- items = items[1..-2] # Skip space before and after outer |
37
+ cells = []
38
+
39
+ self.split_table_cells(@trimmed_line_text) do |item, column|
40
+ cell_indent = item.length - item.lstrip.length
41
+ span = Span.new(@indent + column + cell_indent, item.strip)
42
+ cells.push(span)
43
43
  end
44
- items.map do |item|
45
- cell_indent = item.length - item.lstrip.length + 1
46
- span = Span.new(column + cell_indent, item.strip)
47
- column += item.length + 1
48
- span
44
+
45
+ cells
46
+ end
47
+
48
+ def split_table_cells(row)
49
+ col = 0
50
+ start_col = col + 1
51
+ cell = ''
52
+ first_cell = true
53
+ while col < row.length
54
+ char = row[col]
55
+ col += 1
56
+ if char == '|'
57
+ if first_cell
58
+ # First cell (content before the first |) is skipped
59
+ first_cell = false
60
+ else
61
+ yield cell, start_col
62
+ end
63
+ cell = ''
64
+ start_col = col + 1
65
+ elsif char == '\\'
66
+ char = row[col]
67
+ col += 1
68
+ if char == 'n'
69
+ cell += '\n'
70
+ else
71
+ cell += char
72
+ end
73
+ else
74
+ cell += char
75
+ end
49
76
  end
77
+ # Last cell (content after the last |) is skipped
50
78
  end
51
79
 
52
80
  def tags
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gherkin3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gáspár Nagy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-08-16 00:00:00.000000000 Z
13
+ date: 2015-09-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -123,7 +123,7 @@ rubyforge_project:
123
123
  rubygems_version: 2.4.5
124
124
  signing_key:
125
125
  specification_version: 4
126
- summary: gherkin-3.1.0
126
+ summary: gherkin-3.1.1
127
127
  test_files:
128
128
  - spec/capture_warnings.rb
129
129
  - spec/coverage.rb