/usr/bin/gherkin-generate-pickles is in ruby-gherkin 4.0.0-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/usr/bin/ruby
$VERBOSE=nil # Shut up JRuby warnings on Travis
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"../lib"))
require 'gherkin/pickles/compiler'
require 'gherkin/parser'
require 'json'
compiler = Gherkin::Pickles::Compiler.new
parser = Gherkin::Parser.new
parser.stop_at_first_error = false
files = ARGV.any? ? ARGV : (STDIN.tty? ? [] : [STDIN])
start_time = Time.now
files.each do |file|
begin
File.open(file, 'r:UTF-8') do |io|
feature = parser.parse(io)
pickles = compiler.compile(feature, file);
puts JSON.generate(pickles)
end
rescue Gherkin::ParserError => e
STDERR.puts e.message
exit 1
end
end
end_time = Time.now
STDERR.puts (end_time - start_time)*1000 if ENV['GHERKIN_PERF']
|