Sha256: 9b9ae192cdc170685caf05c517be155a5127e7e44db1d47feee034857a45bb71

Contents?: true

Size: 581 Bytes

Versions: 75

Compression:

Stored size: 581 Bytes

Contents

module Cucumber
  module ThinkingSphinx
    module SqlLogger
      def self.included(base)
        base.send :alias_method_chain, :execute, :query_record
      end
      
      IGNORED_SQL = [
        /^PRAGMA/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/,
        /^SELECT @@ROWCOUNT/, /^SHOW FIELDS/
      ]
      
      def execute_with_query_record(sql, name = nil, &block)
        $queries_executed ||= []
        $queries_executed << sql unless IGNORED_SQL.any? { |r| sql =~ r }
        execute_without_query_record(sql, name, &block)
      end
    end
  end
end

Version data entries

75 entries across 75 versions & 13 rubygems

Version Path
thinking-sphinx-1.5.0 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.14 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.13 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.12 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.11 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.10 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.9 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.8 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.7 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.7 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.5 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.6 lib/cucumber/thinking_sphinx/sql_logger.rb
sayso-thinking-sphinx-2.0.3.002 lib/cucumber/thinking_sphinx/sql_logger.rb
sayso-thinking-sphinx-2.0.3.001 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.4 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.5 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.3 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.4 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-1.4.3 lib/cucumber/thinking_sphinx/sql_logger.rb
thinking-sphinx-2.0.2 lib/cucumber/thinking_sphinx/sql_logger.rb