Sha256: 06cefd349ca66fe18b014f2f38f7fd69dc9318a953ce15dc2ee16da07fd87868

Contents?: true

Size: 231 Bytes

Versions: 13

Compression:

Stored size: 231 Bytes

Contents

require 'rouge'

module Adhoq::QueryDecorator
  def query_with_highlight
    formatter = Rouge::Formatters::HTML.new(css_class: 'highlight query')
    lexer = Rouge::Lexers::SQL.new
    formatter.format(lexer.lex(query))
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
adhoq-1.0.2 app/decorators/adhoq/query_decorator.rb
adhoq-1.0.1 app/decorators/adhoq/query_decorator.rb
adhoq-1.0.0 app/decorators/adhoq/query_decorator.rb
adhoq-0.5.0 app/decorators/adhoq/query_decorator.rb
adhoq-0.5.0.beta1 app/decorators/adhoq/query_decorator.rb
adhoq-0.4.0 app/decorators/adhoq/query_decorator.rb
adhoq-0.3.0 app/decorators/adhoq/query_decorator.rb
adhoq-0.2.0 app/decorators/adhoq/query_decorator.rb
adhoq-0.1.2 app/decorators/adhoq/query_decorator.rb
adhoq-0.1.1 app/decorators/adhoq/query_decorator.rb
adhoq-0.1.0 app/decorators/adhoq/query_decorator.rb
adhoq-0.0.7 app/decorators/adhoq/query_decorator.rb
adhoq-0.0.6 app/decorators/adhoq/query_decorator.rb