gherkin 1.0.5-i386-mswin32 → 1.0.6-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ rdoc
5
5
  pkg
6
6
  ext
7
7
  tmp
8
+ release
data/History.txt CHANGED
@@ -1,4 +1,15 @@
1
- == 1.0.5 (2009-04-08)
1
+ == 1.0.6 (2010-04-10)
2
+
3
+ === New Features
4
+ * Fully automated release process. (Aslak Hellesøy)
5
+
6
+ === Changed Features
7
+ * Made generated classes use a more uniform naming convention. (Aslak Hellesøy)
8
+
9
+ === Removed Features
10
+ * Removed C# port, obsoleted by IKVM build from 1.0.5. (Aslak Hellesøy)
11
+
12
+ == 1.0.5 (2010-04-08)
2
13
 
3
14
  === New Features
4
15
  * New .NET build of gherkin - an ikvmc build of gherkin.jar to gherkin.dll. (Aslak Hellesøy)
@@ -6,7 +17,7 @@
6
17
  === Bugfixes
7
18
  * Made parsers reusable so that the same instance can parse several features. (Aslak Hellesøy)
8
19
 
9
- == 1.0.4 (2009-04-07)
20
+ == 1.0.4 (2010-04-07)
10
21
 
11
22
  === New features
12
23
  * Pure java releases of Gherkin at http://cukes.info/maven
@@ -15,7 +26,7 @@
15
26
  === Changed features
16
27
  * The Lexer now emits the '@' for tags. (Aslak Hellesøy)
17
28
 
18
- == 1.0.3 (2009-03-31)
29
+ == 1.0.3 (2010-03-31)
19
30
 
20
31
  === Bugfixes
21
32
  * The C lexer correctly instantiates a new array for each table, instead of reusing the old one. (Aslak Hellesøy)
data/README.rdoc CHANGED
@@ -28,21 +28,10 @@ E.g. in Bash, export RL_LANG="en,fr,no". This can be quite helpful when modifyin
28
28
 
29
29
  == Release process
30
30
 
31
- * Bump version in the VERSION file
32
- * Do a file search and replace from old version number to new one.
33
- * Run "rake clean spec cucumber" for each platform (1.8.6, 1.8.7, 1.9, jruby) to make sure all is green.
34
- * rvm 1.8.7
35
- * rake clean jar compile
36
- * rake gemspec
37
- * git commit -a -m "Release vX.Y.Z"
38
- * rake gemcutter:release
39
- * rake git:release
40
- * ./nativegems.sh
41
- * gem push pkg/... (for each native gem)
42
- * cd java && mvn deploy
43
- * rake ikvm
44
- * Upload pkg/gherkin-X.Y.Z.dll to Github: http://github.com/aslakhellesoy/gherkin/downloads
45
-
31
+ * Bump version in the VERSION.yml file and:
32
+ ** java/pom.xml
33
+ ** ikvm/Gherkin/Gherkin,csproj
34
+ * rake release:ALL
46
35
  * Announce on Cucumber list, IRC and Twitter.
47
36
 
48
37
  == Configuring Rake-Compiler for cross compilation
data/Rakefile CHANGED
@@ -22,9 +22,7 @@ begin
22
22
  gem.add_development_dependency "rspec", ">= 1.3.0"
23
23
  gem.add_development_dependency "cucumber", ">= 0.6.4"
24
24
  gem.add_development_dependency "rake-compiler", ">= 0.7.0" unless defined?(JRUBY_VERSION)
25
- gem.add_development_dependency "albacore", ">= 0.1.2"
26
25
 
27
- gem.files -= FileList['dotnet/**/*']
28
26
  gem.files -= FileList['ikvm/**/*']
29
27
  gem.files -= FileList['java/**/*']
30
28
  case ENV['PLATFORM']
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 0
3
- :patch: 5
3
+ :patch: 6
4
4
  :major: 1
@@ -1,10 +1,8 @@
1
1
  module Gherkin
2
2
  module CLexer
3
- def self.[](i18n_language_name)
4
- name = i18n_language_name.gsub(/[\s-]/, '')
5
- require "gherkin_lexer_#{name}"
6
- i18n_lexer_class_name = name.capitalize
7
- const_get(i18n_lexer_class_name)
3
+ def self.[](i18n_sanitized_key)
4
+ require "gherkin_lexer_#{i18n_sanitized_key}"
5
+ const_get(i18n_sanitized_key.capitalize)
8
6
  end
9
7
  end
10
8
  end
data/lib/gherkin/i18n.rb CHANGED
@@ -65,16 +65,16 @@ module Gherkin
65
65
 
66
66
  def c(listener)
67
67
  require 'gherkin/c_lexer'
68
- CLexer[@key].new(listener)
68
+ CLexer[sanitized_key].new(listener)
69
69
  end
70
70
 
71
71
  def rb(listener)
72
72
  require 'gherkin/rb_lexer'
73
- RbLexer[@key].new(listener)
73
+ RbLexer[sanitized_key].new(listener)
74
74
  end
75
75
 
76
76
  def sanitized_key
77
- @key.gsub(/[\s-]/, '')
77
+ @key.gsub(/[\s-]/, '_').downcase
78
78
  end
79
79
 
80
80
  def incomplete?
data/lib/gherkin/i18n.yml CHANGED
@@ -495,6 +495,19 @@
495
495
  then: "*|O zaman"
496
496
  and: "*|Ve"
497
497
  but: "*|Fakat|Ama"
498
+ "uk":
499
+ name: Ukrainian
500
+ native: Українська
501
+ feature: Функціонал
502
+ background: Передумова
503
+ scenario: Сценарій
504
+ scenario_outline: Структура сценарію
505
+ examples: Приклади
506
+ given: "*|Припустимо|Припустимо, що|Нехай"
507
+ when: "*|Якщо"
508
+ then: "*|То"
509
+ and: "*|І"
510
+ but: "*|Але"
498
511
  "uz":
499
512
  name: Uzbek
500
513
  native: Узбекча
@@ -1,10 +1,8 @@
1
1
  module Gherkin
2
2
  module RbLexer
3
- def self.[](i18n_language_name)
4
- name = i18n_language_name.gsub(/[\s-]/, '')
5
- require "gherkin/rb_lexer/#{name}"
6
- i18n_lexer_class_name = name.capitalize
7
- const_get(i18n_lexer_class_name)
3
+ def self.[](i18n_sanitized_key)
4
+ require "gherkin/rb_lexer/#{i18n_sanitized_key}"
5
+ const_get(i18n_sanitized_key.capitalize)
8
6
  end
9
7
  end
10
8
  end
@@ -8,7 +8,7 @@ import gherkin.Lexer;
8
8
  import gherkin.Listener;
9
9
  import gherkin.LexingError;
10
10
 
11
- public class <%= @i18n.sanitized_key.capitalize %> implements Lexer {
11
+ public class <%= @i18n.sanitized_key.upcase %> implements Lexer {
12
12
  %%{
13
13
  machine lexer;
14
14
  alphtype byte;
@@ -134,7 +134,7 @@ public class <%= @i18n.sanitized_key.capitalize %> implements Lexer {
134
134
 
135
135
  private final Listener listener;
136
136
 
137
- public <%= @i18n.sanitized_key.capitalize %>(Listener listener) {
137
+ public <%= @i18n.sanitized_key.upcase %>(Listener listener) {
138
138
  this.listener = listener;
139
139
  }
140
140
 
data/tasks/compile.rake CHANGED
@@ -8,10 +8,7 @@ CLEAN.include [
8
8
  'ragel/i18n/*.rl',
9
9
  'lib/gherkin/rb_lexer/*.rb',
10
10
  'ext/**/*.c',
11
- 'java/src/gherkin/lexer/*.java',
12
- 'dotnet/Gherkin/Lexer',
13
- 'dotnet/Gherkin/obj',
14
- 'dotnet/Gherkin/bin'
11
+ 'java/src/main/java/gherkin/lexer/*.java'
15
12
  ]
16
13
 
17
14
  desc "Compile the Java extensions"
@@ -21,83 +18,14 @@ file 'lib/gherkin.jar' => Dir['java/src/main/java/**/*.java'] do
21
18
  sh("mvn -f java/pom.xml package")
22
19
  end
23
20
 
24
- namespace :dotnet do
25
- require 'albacore'
26
-
27
- FileList['lib/gherkin/parser/*'].each do |src|
28
- dst = "dotnet/Gherkin/StateMachine/#{File.basename(src)}"
29
- file dst => src do
30
- cp src, dst, :verbose => true
31
- end
32
- task :compile => dst
33
- end
34
-
35
- task :compile => :lexer
36
-
37
- if (`which mono` rescue "") =~ /mono/
38
- xbuild :compile do |msb|
39
- msb.properties :configuration => :Release
40
- msb.targets :Build
41
- msb.solution = 'dotnet/Gherkin.sln'
42
- end
43
-
44
- require 'rake/xunittask'
45
- class XUnitTestRunner
46
- def execute
47
- system("mono dotnet/lib/xunit/xunit.console.exe dotnet/Gherkin.Tests/bin/Release/Gherkin.Tests.dll")
48
- exit 1 if $? != 0
49
- end
50
- end
51
- else
52
- msbuild :compile do |msb|
53
- msb.properties :configuration => :Release
54
- msb.targets :Build
55
- msb.solution = 'dotnet/Gherkin.sln'
56
- end
57
- end
58
-
59
- xunit :test => :compile do |xunit|
60
- xunit.path_to_command = "dotnet/lib/xunit/xunit.console.exe"
61
- xunit.assembly = "dotnet/Gherkin.Tests/bin/Release/Gherkin.Tests.dll"
62
- end
63
-
64
- task :package => :test do
65
- cp 'dotnet/Gherkin/bin/Release/Gherkin.dll', 'lib/Gherkin.dll'
66
- end
67
- end
68
-
69
- desc "Compile and package the .NET extensions"
70
- task :dotnet => ['dotnet:package']
71
-
72
- class CSharpSByteFixTask
73
- def initialize(source)
74
- @source = source
75
- define_tasks
76
- end
77
-
78
- def define_tasks
79
- directory File.dirname(target)
80
- file target => [File.dirname(target), @source] do
81
- sh "cat #{@source} | sed ""s/sbyte/short/g"" > #{target}"
82
- end
83
- end
84
-
85
- def target
86
- "dotnet/Gherkin/Lexer/#{File.basename(@source)}"
87
- end
88
- end
89
-
90
21
  rl_langs = ENV['RL_LANGS'] ? ENV['RL_LANGS'].split(',') : []
91
22
  langs = Gherkin::I18n.all.select { |lang| rl_langs.empty? || rl_langs.include?(lang.key) }
92
23
 
93
24
  langs.each do |i18n|
94
25
  java = RagelTask.new('java', i18n)
95
26
  rb = RagelTask.new('rb', i18n)
96
- csharp_tmp = RagelTask.new('csharp', i18n)
97
- csharp = CSharpSByteFixTask.new(csharp_tmp.target)
98
27
 
99
- task :jar => [java.target, rb.target]
100
- task 'dotnet:lexer' => csharp.target
28
+ file 'lib/gherkin.jar' => [java.target, rb.target]
101
29
 
102
30
  begin
103
31
  unless defined?(JRUBY_VERSION)
data/tasks/gems.rake ADDED
@@ -0,0 +1,31 @@
1
+ namespace :gems do
2
+ desc 'Release JRuby gem'
3
+ task :jruby => :release_dir do
4
+ sh "rvm jruby rake clean spec gemspec build PLATFORM=java"
5
+ mv "pkg/gherkin-#{GHERKIN_VERSION}-java.gem", 'release'
6
+ end
7
+
8
+ desc "Release MRI/C POSIX gem"
9
+ task :posix => :release_dir do
10
+ sh "rvm 1.8.7 rake clean spec gemspec build"
11
+ mv "pkg/gherkin-#{GHERKIN_VERSION}.gem", 'release'
12
+ end
13
+
14
+ [:mswin32, :mingw32].each do |win_compiler|
15
+ desc "Release MRI/C precompiled #{win_compiler} gem"
16
+ task win_compiler => :posix do
17
+ sh "rvm 1.8.7 rake cross compile gemspec build PLATFORM=i386-#{win_compiler} RUBY_CC_VERSION=1.8.6"
18
+ mv "pkg/gherkin-#{GHERKIN_VERSION}-x86-#{win_compiler}.gem", 'release'
19
+ end
20
+ end
21
+
22
+ task :release_dir do
23
+ mkdir 'release' unless File.directory?('release')
24
+ end
25
+
26
+ task :clean_release_dir do
27
+ rm_rf 'release' if File.directory?('release')
28
+ end
29
+ end
30
+
31
+ task :gems => ['gems:clean_release_dir', 'gems:jruby', 'gems:posix', 'gems:mswin32', 'gems:mingw32']
data/tasks/ikvm.rake CHANGED
@@ -26,19 +26,19 @@ namespace :ikvm do
26
26
  task :dll => 'pkg/gherkin.dll'
27
27
 
28
28
  file 'pkg/gherkin.exe' => 'lib/gherkin.jar' do
29
- mkdir_p 'pkg' unless File.directory?('pkg')
30
- sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:exe lib/gherkin.jar -out:pkg/gherkin-#{GHERKIN_VERSION}.exe")
29
+ mkdir_p 'release' unless File.directory?('release')
30
+ sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:exe lib/gherkin.jar -out:release/gherkin-#{GHERKIN_VERSION}.exe")
31
31
  end
32
32
 
33
33
  file 'pkg/gherkin.dll' => 'lib/gherkin.jar' do
34
- mkdir_p 'pkg' unless File.directory?('pkg')
35
- sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:library lib/gherkin.jar -out:pkg/gherkin-#{GHERKIN_VERSION}.dll")
34
+ mkdir_p 'release' unless File.directory?('release')
35
+ sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:library lib/gherkin.jar -out:release/gherkin-#{GHERKIN_VERSION}.dll")
36
36
  end
37
37
 
38
38
  desc 'Copy the IKVM .dll files over to the pkg dir'
39
39
  task :copy_ikvm_dlls do
40
40
  Dir['/usr/local/ikvm/bin/{IKVM.OpenJDK.Core,IKVM.OpenJDK.Text,IKVM.Runtime}.dll'].each do |dll|
41
- cp dll, 'pkg'
41
+ cp dll, 'release'
42
42
  end
43
43
  end
44
44
  end
data/tasks/ragel_task.rb CHANGED
@@ -28,7 +28,7 @@ class RagelTask
28
28
  def target
29
29
  {
30
30
  'c' => "ext/gherkin_lexer_#{@i18n.sanitized_key}/gherkin_lexer_#{@i18n.sanitized_key}.c",
31
- 'java' => "java/src/main/java/gherkin/lexer/#{@i18n.sanitized_key.capitalize}.java",
31
+ 'java' => "java/src/main/java/gherkin/lexer/#{@i18n.sanitized_key.upcase}.java",
32
32
  'rb' => "lib/gherkin/rb_lexer/#{@i18n.sanitized_key}.rb",
33
33
  'csharp' => "tmp/#{@i18n.sanitized_key}.cs"
34
34
  }[@lang]
@@ -0,0 +1,26 @@
1
+ namespace :release do
2
+ desc 'Uplad all packages and tag git'
3
+ task :ALL => [:_gems, :dll, :jar, 'git:release']
4
+
5
+ task :_gems => :gems do
6
+ Dir.chdir('release') do
7
+ Dir['*.gem'].each do |gem_file|
8
+ sh("gem push #{gem_file}")
9
+ end
10
+ end
11
+ end
12
+
13
+ task :dll => :ikvm do
14
+ Dir.chdir('release') do
15
+ # This requires aslakhellesoy's build of the github gem,
16
+ # which has tekkub's upload command.
17
+ sh("github upload #{Dir['gherkin*.dll'][0]}")
18
+ end
19
+ end
20
+
21
+ task :jar do
22
+ Dir.chdir('java') do
23
+ sh("mvn deploy")
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 5
9
- version: 1.0.5
8
+ - 6
9
+ version: 1.0.6
10
10
  platform: i386-mswin32
11
11
  authors:
12
12
  - Mike Sassak
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-04-08 00:00:00 +02:00
19
+ date: 2010-04-10 00:00:00 +02:00
20
20
  default_executable: gherkin
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -74,20 +74,6 @@ dependencies:
74
74
  version: 0.7.0
75
75
  type: :development
76
76
  version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: albacore
79
- prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- segments:
85
- - 0
86
- - 1
87
- - 2
88
- version: 0.1.2
89
- type: :development
90
- version_requirements: *id005
91
77
  description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
92
78
  email: cukes@googlegroups.com
93
79
  executables:
@@ -108,7 +94,6 @@ files:
108
94
  - VERSION.yml
109
95
  - bin/gherkin
110
96
  - cucumber.yml
111
- - dotnet/.gitignore
112
97
  - features/feature_parser.feature
113
98
  - features/native_lexer.feature
114
99
  - features/parser_with_native_lexer.feature
@@ -117,10 +102,8 @@ files:
117
102
  - features/step_definitions/pretty_listener_step.rb
118
103
  - features/steps_parser.feature
119
104
  - features/support/env.rb
120
- - gherkin.gemspec
121
105
  - ikvm/.gitignore
122
106
  - java/.gitignore
123
- - java/Gherkin.iml
124
107
  - java/src/main/java/gherkin/lexer/.gitignore
125
108
  - lib/.gitignore
126
109
  - lib/gherkin.rb
@@ -153,7 +136,6 @@ files:
153
136
  - nativegems.sh
154
137
  - ragel/i18n/.gitignore
155
138
  - ragel/lexer.c.rl.erb
156
- - ragel/lexer.csharp.rl.erb
157
139
  - ragel/lexer.java.rl.erb
158
140
  - ragel/lexer.rb.rl.erb
159
141
  - ragel/lexer_common.rl.erb
@@ -191,9 +173,11 @@ files:
191
173
  - tasks/bench/null_listener.rb
192
174
  - tasks/compile.rake
193
175
  - tasks/cucumber.rake
176
+ - tasks/gems.rake
194
177
  - tasks/ikvm.rake
195
178
  - tasks/ragel_task.rb
196
179
  - tasks/rdoc.rake
180
+ - tasks/release.rake
197
181
  - tasks/rspec.rake
198
182
  has_rdoc: true
199
183
  homepage: http://github.com/aslakhellesoy/gherkin
data/dotnet/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- *.user
2
- *.suo
3
- bin
4
- obj
5
- Gherkin/StateMachine/meta.txt
6
- Gherkin/StateMachine/root.txt
7
- Gherkin/StateMachine/steps.txt
8
- Gherkin/Lexer/*.cs
9
- *.sln.cache
10
- _ReSharper*
11
- Gherkin.sln.proj
12
- *.pidb
13
- *.userprefs
data/gherkin.gemspec DELETED
@@ -1,172 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{gherkin}
8
- s.version = "1.0.5"
9
- s.platform = %q{i386-mswin32}
10
-
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Helles\303\270y"]
13
- s.date = %q{2010-04-08}
14
- s.default_executable = %q{gherkin}
15
- s.description = %q{A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.}
16
- s.email = %q{cukes@googlegroups.com}
17
- s.executables = ["gherkin"]
18
- s.extra_rdoc_files = [
19
- "LICENSE",
20
- "README.rdoc"
21
- ]
22
- s.files = [
23
- ".gitattributes",
24
- ".gitignore",
25
- ".mailmap",
26
- "History.txt",
27
- "LICENSE",
28
- "README.rdoc",
29
- "Rakefile",
30
- "VERSION.yml",
31
- "bin/gherkin",
32
- "cucumber.yml",
33
- "dotnet/.gitignore",
34
- "features/feature_parser.feature",
35
- "features/native_lexer.feature",
36
- "features/parser_with_native_lexer.feature",
37
- "features/pretty_printer.feature",
38
- "features/step_definitions/gherkin_steps.rb",
39
- "features/step_definitions/pretty_listener_step.rb",
40
- "features/steps_parser.feature",
41
- "features/support/env.rb",
42
- "gherkin.gemspec",
43
- "ikvm/.gitignore",
44
- "java/.gitignore",
45
- "java/Gherkin.iml",
46
- "java/src/main/java/gherkin/lexer/.gitignore",
47
- "lib/.gitignore",
48
- "lib/gherkin.rb",
49
- "lib/gherkin/c_lexer.rb",
50
- "lib/gherkin/cli/main.rb",
51
- "lib/gherkin/core_ext/array.rb",
52
- "lib/gherkin/csharp_lexer.rb",
53
- "lib/gherkin/formatter/argument.rb",
54
- "lib/gherkin/formatter/colors.rb",
55
- "lib/gherkin/formatter/monochrome_format.rb",
56
- "lib/gherkin/formatter/pretty_listener.rb",
57
- "lib/gherkin/i18n.rb",
58
- "lib/gherkin/i18n.yml",
59
- "lib/gherkin/i18n_lexer.rb",
60
- "lib/gherkin/parser/filter_listener.rb",
61
- "lib/gherkin/parser/meta.txt",
62
- "lib/gherkin/parser/parser.rb",
63
- "lib/gherkin/parser/root.txt",
64
- "lib/gherkin/parser/sexp.rb",
65
- "lib/gherkin/parser/steps.txt",
66
- "lib/gherkin/parser/tag_expression.rb",
67
- "lib/gherkin/rb_lexer.rb",
68
- "lib/gherkin/rb_lexer/.gitignore",
69
- "lib/gherkin/rb_lexer/README.rdoc",
70
- "lib/gherkin/tools.rb",
71
- "lib/gherkin/tools/files.rb",
72
- "lib/gherkin/tools/reformat.rb",
73
- "lib/gherkin/tools/stats.rb",
74
- "lib/gherkin/tools/stats_listener.rb",
75
- "nativegems.sh",
76
- "ragel/i18n/.gitignore",
77
- "ragel/lexer.c.rl.erb",
78
- "ragel/lexer.csharp.rl.erb",
79
- "ragel/lexer.java.rl.erb",
80
- "ragel/lexer.rb.rl.erb",
81
- "ragel/lexer_common.rl.erb",
82
- "spec/gherkin/c_lexer_spec.rb",
83
- "spec/gherkin/csharp_lexer_spec.rb",
84
- "spec/gherkin/fixtures/1.feature",
85
- "spec/gherkin/fixtures/comments_in_table.feature",
86
- "spec/gherkin/fixtures/complex.feature",
87
- "spec/gherkin/fixtures/dos_line_endings.feature",
88
- "spec/gherkin/fixtures/i18n_fr.feature",
89
- "spec/gherkin/fixtures/i18n_no.feature",
90
- "spec/gherkin/fixtures/i18n_zh-CN.feature",
91
- "spec/gherkin/fixtures/simple.feature",
92
- "spec/gherkin/fixtures/simple_with_comments.feature",
93
- "spec/gherkin/fixtures/simple_with_tags.feature",
94
- "spec/gherkin/formatter/argument_spec.rb",
95
- "spec/gherkin/formatter/colors_spec.rb",
96
- "spec/gherkin/formatter/pretty_listener_spec.rb",
97
- "spec/gherkin/i18n_lexer_spec.rb",
98
- "spec/gherkin/i18n_spec.rb",
99
- "spec/gherkin/java_lexer_spec.rb",
100
- "spec/gherkin/parser/filter_listener_spec.rb",
101
- "spec/gherkin/parser/parser_spec.rb",
102
- "spec/gherkin/parser/tag_expression_spec.rb",
103
- "spec/gherkin/rb_lexer_spec.rb",
104
- "spec/gherkin/sexp_recorder.rb",
105
- "spec/gherkin/shared/lexer_spec.rb",
106
- "spec/gherkin/shared/py_string_spec.rb",
107
- "spec/gherkin/shared/row_spec.rb",
108
- "spec/gherkin/shared/tags_spec.rb",
109
- "spec/spec_helper.rb",
110
- "tasks/bench.rake",
111
- "tasks/bench/feature_builder.rb",
112
- "tasks/bench/generated/.gitignore",
113
- "tasks/bench/null_listener.rb",
114
- "tasks/compile.rake",
115
- "tasks/cucumber.rake",
116
- "tasks/ikvm.rake",
117
- "tasks/ragel_task.rb",
118
- "tasks/rdoc.rake",
119
- "tasks/rspec.rake"
120
- ]
121
- s.homepage = %q{http://github.com/aslakhellesoy/gherkin}
122
- s.rdoc_options = ["--charset=UTF-8"]
123
- s.require_paths = ["lib"]
124
- s.rubygems_version = %q{1.3.6}
125
- s.summary = %q{Fast Gherkin lexer/parser}
126
- s.test_files = [
127
- "spec/gherkin/c_lexer_spec.rb",
128
- "spec/gherkin/csharp_lexer_spec.rb",
129
- "spec/gherkin/formatter/argument_spec.rb",
130
- "spec/gherkin/formatter/colors_spec.rb",
131
- "spec/gherkin/formatter/pretty_listener_spec.rb",
132
- "spec/gherkin/i18n_lexer_spec.rb",
133
- "spec/gherkin/i18n_spec.rb",
134
- "spec/gherkin/java_lexer_spec.rb",
135
- "spec/gherkin/parser/filter_listener_spec.rb",
136
- "spec/gherkin/parser/parser_spec.rb",
137
- "spec/gherkin/parser/tag_expression_spec.rb",
138
- "spec/gherkin/rb_lexer_spec.rb",
139
- "spec/gherkin/sexp_recorder.rb",
140
- "spec/gherkin/shared/lexer_spec.rb",
141
- "spec/gherkin/shared/py_string_spec.rb",
142
- "spec/gherkin/shared/row_spec.rb",
143
- "spec/gherkin/shared/tags_spec.rb",
144
- "spec/spec_helper.rb"
145
- ]
146
-
147
- if s.respond_to? :specification_version then
148
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
149
- s.specification_version = 3
150
-
151
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
152
- s.add_runtime_dependency(%q<trollop>, [">= 1.15"])
153
- s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
154
- s.add_development_dependency(%q<cucumber>, [">= 0.6.4"])
155
- s.add_development_dependency(%q<rake-compiler>, [">= 0.7.0"])
156
- s.add_development_dependency(%q<albacore>, [">= 0.1.2"])
157
- else
158
- s.add_dependency(%q<trollop>, [">= 1.15"])
159
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
160
- s.add_dependency(%q<cucumber>, [">= 0.6.4"])
161
- s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
162
- s.add_dependency(%q<albacore>, [">= 0.1.2"])
163
- end
164
- else
165
- s.add_dependency(%q<trollop>, [">= 1.15"])
166
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
167
- s.add_dependency(%q<cucumber>, [">= 0.6.4"])
168
- s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
169
- s.add_dependency(%q<albacore>, [">= 0.1.2"])
170
- end
171
- end
172
-
data/java/Gherkin.iml DELETED
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="false">
4
- <output url="file://$MODULE_DIR$/target/classes" />
5
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
- <content url="file://$MODULE_DIR$">
7
- <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
- <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9
- <excludeFolder url="file://$MODULE_DIR$/target" />
10
- </content>
11
- <orderEntry type="inheritedJdk" />
12
- <orderEntry type="sourceFolder" forTests="false" />
13
- <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.1" level="project" />
14
- </component>
15
- </module>
16
-
@@ -1,240 +0,0 @@
1
- namespace Gherkin.Lexer
2
- {
3
- using System.Text;
4
- using System.Text.RegularExpressions;
5
- using System.IO;
6
- using System.Collections.Generic;
7
- using System.Linq;
8
-
9
- [Language("<%= @i18n.sanitized_key.downcase %>")]
10
- public class <%= @i18n.sanitized_key.capitalize %> : ILexer {
11
- %%{
12
- machine lexer;
13
- alphtype char;
14
-
15
- action begin_content {
16
- contentStart = p;
17
- contentCol = p - lastNewline + 1;
18
- contentNewline = lastNewline;
19
- currentLine = lineNumber;
20
- }
21
-
22
- action start_pystring {
23
- currentLine = lineNumber;
24
- pystringStartCol = p - lastNewline;
25
- pystringStartNewline = lastNewline;
26
- }
27
-
28
- action begin_pystring_content {
29
- contentStart = p;
30
- }
31
-
32
- action store_pystring_content {
33
- string con = Unindent(pystringStartCol, new Regex("(\\r?\\n)?( )*\\Z").Replace(Substring(data, contentStart, nextKeywordStart-1), "", 1));
34
- listener.PythonString(new Token(con, GetCharacterPosition(data, pystringStartNewline, currentLine, pystringStartCol+1)));
35
- }
36
-
37
- action store_feature_content {
38
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart).Trim());
39
- listener.Feature(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
40
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
41
- nextKeywordStart = -1;
42
- }
43
-
44
- action store_background_content {
45
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
46
- listener.Background(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
47
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
48
- nextKeywordStart = -1;
49
- }
50
-
51
- action store_scenario_content {
52
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
53
- listener.Scenario(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
54
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
55
- nextKeywordStart = -1;
56
- }
57
-
58
- action store_scenario_outline_content {
59
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
60
- listener.ScenarioOutline(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
61
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
62
- nextKeywordStart = -1;
63
- }
64
-
65
- action store_examples_content {
66
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
67
- listener.Examples(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
68
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
69
- nextKeywordStart = -1;
70
- }
71
-
72
- action store_step_content {
73
- listener.Step(
74
- new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)),
75
- new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, contentNewline, currentLine, contentCol)),
76
- LookupStepKind(keyword));
77
- }
78
-
79
- action store_comment_content {
80
- listener.Comment(new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
81
- keywordStart = -1;
82
- }
83
-
84
- action store_tag_content {
85
- listener.Tag(new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, contentNewline, currentLine, contentCol-1)));
86
- keywordStart = -1;
87
- }
88
-
89
- action inc_line_number {
90
- lineNumber++;
91
- }
92
-
93
- action last_newline {
94
- lastNewline = p + 1;
95
- }
96
-
97
- action start_keyword {
98
- if(keywordStart == -1) keywordStart = p;
99
- if(nextKeywordStart == -1)
100
- {
101
- keywordCol = p - lastNewline + 1;
102
- keywordNewline = lastNewline;
103
- }
104
- }
105
-
106
- action end_keyword {
107
- keyword = new Regex(":$").Replace(Substring(data, keywordStart, p), "", 1);
108
- keywordStart = -1;
109
- }
110
-
111
- action next_keyword_start {
112
- nextKeywordStart = p;
113
- }
114
-
115
- action start_row {
116
- p = p - 1;
117
- contentCol = p - lastNewline + 1;
118
- currentRow = new List<Token>();
119
- currentLine = lineNumber;
120
- }
121
-
122
- action begin_cell_content {
123
- contentStart = p;
124
- }
125
-
126
- action store_cell_content {
127
- currentRow.Add(new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, lastNewline, lineNumber, contentStart - lastNewline + 1)));
128
- }
129
-
130
- action store_row {
131
- listener.Row(currentRow, GetCharacterPosition(data, contentNewline, currentLine, contentCol));
132
- }
133
-
134
- action end_feature {
135
- if(cs < lexer_first_final) {
136
- string content = CurrentLineContent(data, lastNewline);
137
- throw new LexingException("Lexing error on line " + lineNumber + ": '" + content + "'");
138
- } else {
139
- listener.Eof();
140
- }
141
- }
142
-
143
- include lexer_common "lexer_common.<%= @i18n.sanitized_key %>.rl";
144
- }%%
145
-
146
- private readonly IListener listener;
147
-
148
- private static readonly IDictionary<string, StepKind> stepKeywords = new Dictionary<string, StepKind>();
149
-
150
- static <%= @i18n.sanitized_key.capitalize %>()
151
- {
152
- <% @i18n.keywords('given', true).reject{|kw| kw == '* '}.each do |keyword| %>
153
- stepKeywords["<%=keyword%>"] = StepKind.Given;
154
- <% end %>
155
- <% @i18n.keywords('when', true).reject{|kw| kw == '* '}.each do |keyword| %>
156
- stepKeywords["<%=keyword%>"] = StepKind.When;
157
- <% end %>
158
- <% @i18n.keywords('then', true).reject{|kw| kw == '* '}.each do |keyword| %>
159
- stepKeywords["<%=keyword%>"] = StepKind.Then;
160
- <% end %>
161
- <% @i18n.keywords('and', true).reject{|kw| kw == '* '}.each do |keyword| %>
162
- stepKeywords["<%=keyword%>"] = StepKind.And;
163
- <% end %>
164
- <% @i18n.keywords('but', true).reject{|kw| kw == '* '}.each do |keyword| %>
165
- stepKeywords["<%=keyword%>"] = StepKind.But;
166
- <% end %>
167
- stepKeywords["* "] = StepKind.Any;
168
- }
169
-
170
- private static StepKind LookupStepKind(string keyword)
171
- {
172
- if (!stepKeywords.Keys.Contains(keyword))
173
- return StepKind.Unknown;
174
- return stepKeywords[keyword];
175
- }
176
-
177
- public <%= @i18n.sanitized_key.capitalize %>(IListener listener) {
178
- this.listener = listener;
179
-
180
- }
181
-
182
- %% write data noerror;
183
-
184
- public void Scan(TextReader inputSequence) {
185
- string input = inputSequence.ReadToEnd() + "\n%_FEATURE_END_%";
186
- char[] data = Encoding.GetEncoding("iso-8859-1").GetChars(Encoding.UTF8.GetBytes(input));
187
- int cs, p = 0, pe = data.Length;
188
- int eof = pe;
189
-
190
- int lineNumber = 1;
191
- int lastNewline = 0;
192
-
193
- int keywordCol = -1;
194
- int keywordNewline = 0;
195
- int contentCol = -1;
196
- int contentNewline = 0;
197
- int contentStart = -1;
198
- int currentLine = -1;
199
- int pystringStartNewline = 0;
200
- int pystringStartCol = -1;
201
- int nextKeywordStart = -1;
202
- int keywordStart = -1;
203
- string keyword = null;
204
- IList<Token> currentRow = null;
205
-
206
- %% write init;
207
- %% write exec;
208
- }
209
-
210
- private string KeywordContent(char[] data, int p, int eof, int nextKeywordStart, int contentStart) {
211
- int endPoint = (nextKeywordStart == -1 || (p == eof)) ? p : nextKeywordStart;
212
- return Substring(data, contentStart, endPoint);
213
- }
214
-
215
- private string MultilineStrip(string text) {
216
- var result = new StringBuilder();
217
- foreach (var s in text.Split(new [] {'\n'})) {
218
- result.AppendLine(s.Trim());
219
- }
220
- return result.ToString().Trim();
221
- }
222
-
223
- private string Unindent(int startCol, string text) {
224
- return new Regex("^ {0," + startCol + "}", RegexOptions.Multiline).Replace(text, "");
225
- }
226
-
227
- private string CurrentLineContent(char[] data, int lastNewline) {
228
- return Substring(data, lastNewline, data.Length).Trim();
229
- }
230
-
231
- private string Substring(char[] data, int start, int end) {
232
- return Encoding.UTF8.GetString(Encoding.GetEncoding("iso-8859-1").GetBytes(data, start, end-start));
233
- }
234
-
235
- private Position GetCharacterPosition(char[] data, int lineStart, int line, int bytecol) {
236
- return new Position(line,
237
- Encoding.UTF8.GetCharCount(Encoding.GetEncoding("iso-8859-1").GetBytes(data, lineStart, bytecol)));
238
- }
239
- }
240
- }