gherkin 1.0.19-i386-mingw32 → 1.0.20-i386-mingw32
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.
- data/History.txt +5 -0
 - data/VERSION.yml +1 -1
 - data/features/step_definitions/pretty_formatter_steps.rb +1 -1
 - data/lib/gherkin/formatter/pretty_formatter.rb +2 -2
 - data/lib/gherkin/tools/files.rb +2 -2
 - data/lib/gherkin/tools/reformat.rb +1 -1
 - data/lib/gherkin/tools/stats.rb +1 -1
 - data/lib/gherkin/tools/stats_listener.rb +4 -1
 - data/spec/gherkin/i18n_spec.rb +3 -3
 - metadata +2 -2
 
    
        data/History.txt
    CHANGED
    
    
    
        data/VERSION.yml
    CHANGED
    
    
| 
         @@ -6,7 +6,7 @@ module PrettyPlease 
     | 
|
| 
       6 
6 
     | 
    
         
             
              def pretty(source)
         
     | 
| 
       7 
7 
     | 
    
         
             
                io       = StringIO.new
         
     | 
| 
       8 
8 
     | 
    
         
             
                listener = Gherkin::Formatter::PrettyFormatter.new(io)
         
     | 
| 
       9 
     | 
    
         
            -
                parser   = Gherkin::Parser.new(listener, true)
         
     | 
| 
      
 9 
     | 
    
         
            +
                parser   = Gherkin::Parser::Parser.new(listener, true)
         
     | 
| 
       10 
10 
     | 
    
         
             
                lexer    = Gherkin::I18nLexer.new(parser)
         
     | 
| 
       11 
11 
     | 
    
         
             
                lexer.scan(source)
         
     | 
| 
       12 
12 
     | 
    
         
             
                io.rewind
         
     | 
| 
         @@ -15,7 +15,7 @@ module Gherkin 
     | 
|
| 
       15 
15 
     | 
    
         
             
                  def initialize(io, monochrome=false)
         
     | 
| 
       16 
16 
     | 
    
         
             
                    @io = io
         
     | 
| 
       17 
17 
     | 
    
         
             
                    @monochrome = monochrome
         
     | 
| 
       18 
     | 
    
         
            -
                    @format =  
     | 
| 
      
 18 
     | 
    
         
            +
                    @format = MonochromeFormat.new #@monochrome ? MonochromeFormat.new : AnsiColorFormat.new
         
     | 
| 
       19 
19 
     | 
    
         
             
                    @tags = nil
         
     | 
| 
       20 
20 
     | 
    
         
             
                    @comments = nil
         
     | 
| 
       21 
21 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -71,7 +71,7 @@ module Gherkin 
     | 
|
| 
       71 
71 
     | 
    
         
             
                  end
         
     | 
| 
       72 
72 
     | 
    
         | 
| 
       73 
73 
     | 
    
         
             
                  def py_string(string, line)
         
     | 
| 
       74 
     | 
    
         
            -
                    @io.puts "      \"\"\"\n" + string.gsub(START, '      ') + "\n      \"\"\""
         
     | 
| 
      
 74 
     | 
    
         
            +
                    @io.puts "      \"\"\"\n" + string.gsub(START, '      ').gsub(/"""/,'\"\"\"') + "\n      \"\"\""
         
     | 
| 
       75 
75 
     | 
    
         
             
                  end
         
     | 
| 
       76 
76 
     | 
    
         | 
| 
       77 
77 
     | 
    
         
             
                  def syntax_error(state, event, legal_events, line)
         
     | 
    
        data/lib/gherkin/tools/files.rb
    CHANGED
    
    | 
         @@ -21,8 +21,8 @@ module Gherkin 
     | 
|
| 
       21 
21 
     | 
    
         
             
                  end
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
                  def scan(file, listener)
         
     | 
| 
       24 
     | 
    
         
            -
                    parser = Parser.new(listener, true)
         
     | 
| 
       25 
     | 
    
         
            -
                    lexer = I18nLexer.new(parser)
         
     | 
| 
      
 24 
     | 
    
         
            +
                    parser = Gherkin::Parser::Parser.new(listener, true, "root")
         
     | 
| 
      
 25 
     | 
    
         
            +
                    lexer = Gherkin::I18nLexer.new(parser, false)
         
     | 
| 
       26 
26 
     | 
    
         
             
                    begin
         
     | 
| 
       27 
27 
     | 
    
         
             
                      lexer.scan(IO.read(file))
         
     | 
| 
       28 
28 
     | 
    
         
             
                    rescue => e
         
     | 
    
        data/lib/gherkin/tools/stats.rb
    CHANGED
    
    
| 
         @@ -37,7 +37,7 @@ module Gherkin 
     | 
|
| 
       37 
37 
     | 
    
         
             
                    @steps += 1
         
     | 
| 
       38 
38 
     | 
    
         
             
                  end
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
     | 
    
         
            -
                  def  
     | 
| 
      
 40 
     | 
    
         
            +
                  def row(row, line)
         
     | 
| 
       41 
41 
     | 
    
         
             
                  end
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
43 
     | 
    
         
             
                  def py_string(string, line)
         
     | 
| 
         @@ -45,6 +45,9 @@ module Gherkin 
     | 
|
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
                  def syntax_error(state, event, legal_events, line)
         
     | 
| 
       47 
47 
     | 
    
         
             
                  end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                  def eof
         
     | 
| 
      
 50 
     | 
    
         
            +
                  end
         
     | 
| 
       48 
51 
     | 
    
         
             
                end
         
     | 
| 
       49 
52 
     | 
    
         
             
              end
         
     | 
| 
       50 
53 
     | 
    
         
             
            end
         
     | 
    
        data/spec/gherkin/i18n_spec.rb
    CHANGED
    
    | 
         @@ -64,13 +64,13 @@ module Gherkin 
     | 
|
| 
       64 
64 
     | 
    
         
             
                  describe 'keywords' do
         
     | 
| 
       65 
65 
     | 
    
         
             
                    it "should have code keywords without space, comma or apostrophe" do
         
     | 
| 
       66 
66 
     | 
    
         
             
                      ['Akkor', 'Etantdonné', 'Lorsque', '假設'].each do |code_keyword|
         
     | 
| 
       67 
     | 
    
         
            -
                        I18n.code_keywords.should include(code_keyword)
         
     | 
| 
      
 67 
     | 
    
         
            +
                        Gherkin::I18n.code_keywords.should include(code_keyword)
         
     | 
| 
       68 
68 
     | 
    
         
             
                      end
         
     | 
| 
       69 
69 
     | 
    
         
             
                    end
         
     | 
| 
       70 
70 
     | 
    
         | 
| 
       71 
71 
     | 
    
         
             
                    unless defined?(JRUBY_VERSION)
         
     | 
| 
       72 
72 
     | 
    
         
             
                    it "should print available languages" do
         
     | 
| 
       73 
     | 
    
         
            -
                      ("\n" + I18n.language_table).should == %{
         
     | 
| 
      
 73 
     | 
    
         
            +
                      ("\n" + Gherkin::I18n.language_table).should == %{
         
     | 
| 
       74 
74 
     | 
    
         
             
                  | ar        | Arabic                 | العربية              |
         
     | 
| 
       75 
75 
     | 
    
         
             
                  | bg        | Bulgarian              | български            |
         
     | 
| 
       76 
76 
     | 
    
         
             
                  | ca        | Catalan                | català               |
         
     | 
| 
         @@ -119,7 +119,7 @@ module Gherkin 
     | 
|
| 
       119 
119 
     | 
    
         
             
                    end
         
     | 
| 
       120 
120 
     | 
    
         | 
| 
       121 
121 
     | 
    
         
             
                    it "should print keywords for a given language" do
         
     | 
| 
       122 
     | 
    
         
            -
                      ("\n" + I18n.get('fr').keyword_table).should == %{
         
     | 
| 
      
 122 
     | 
    
         
            +
                      ("\n" + Gherkin::I18n.get('fr').keyword_table).should == %{
         
     | 
| 
       123 
123 
     | 
    
         
             
                  | feature          | "Fonctionnalité"                       |
         
     | 
| 
       124 
124 
     | 
    
         
             
                  | background       | "Contexte"                             |
         
     | 
| 
       125 
125 
     | 
    
         
             
                  | scenario         | "Scénario"                             |
         
     |