Skip to content

Commit

Permalink
Merge branch 'release/2.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
everzet committed Sep 26, 2012
2 parents 1887a8c + 546b468 commit 9581638
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
@@ -1,3 +1,9 @@
2.2.5 / 2012-09-26
==================

* Fixed issue with loading empty features
* Synced Gherkin i18n

2.2.4 / 2012-08-03
==================

Expand Down
8 changes: 2 additions & 6 deletions bin/update_i18n
@@ -1,12 +1,8 @@
#!/usr/bin/env php
<?php

require_once __DIR__.'/../vendor/autoload.php';

use Symfony\Component\Yaml\Yaml;

$yaml = file_get_contents('https://raw.github.com/cucumber/gherkin/master/lib/gherkin/i18n.yml');
$array = Yaml::parse($yaml);
$json = file_get_contents('https://raw.github.com/cucumber/gherkin/master/lib/gherkin/i18n.json');
$array = json_decode($json, true);

foreach ($array as $lang => $keywords) {
foreach (array('given', 'when', 'then', 'and', 'but') as $type) {
Expand Down
4 changes: 2 additions & 2 deletions i18n.php
Expand Up @@ -36,8 +36,8 @@
'feature' => 'Fungsi',
'background' => 'Latar Belakang',
'scenario' => 'Senario',
'scenario_outline' => 'Menggariskan Senario',
'examples' => 'Contoh',
'scenario_outline' => 'Menggariskan Senario ',
'examples' => 'Contoh ',
'given' => 'Bagi',
'when' => 'Apabila',
'then' => 'Kemudian',
Expand Down
4 changes: 1 addition & 3 deletions src/Behat/Gherkin/Lexer.php
Expand Up @@ -463,9 +463,7 @@ protected function scanTags()
if (isset($line[0]) && '@' === $line[0]) {
$token = $this->takeToken('Tag');
$tags = explode('@', mb_substr($line, 1));
$tags = array_map(function($tag){
return trim($tag);
}, $tags);
$tags = array_map('trim', $tags);
$token->tags = $tags;

$this->consumeLine();
Expand Down
5 changes: 2 additions & 3 deletions src/Behat/Gherkin/Loader/GherkinFileLoader.php
Expand Up @@ -73,15 +73,14 @@ public function load($path)
if ($this->cache) {
if ($this->cache->isFresh($path, filemtime($path))) {
$feature = $this->cache->read($path);
} else {
$feature = $this->parseFeature($path);
} elseif (null !== $feature = $this->parseFeature($path)) {
$this->cache->write($path, $feature);
}
} else {
$feature = $this->parseFeature($path);
}

return array($feature);
return null !== $feature ? array($feature) : array();
}

/**
Expand Down

0 comments on commit 9581638

Please sign in to comment.