forked from e621ng/e621ng
Remove unused term-ansicolor and query tracer config
This commit is contained in:
parent
3a0c2fbdc2
commit
c28ad3b8a3
1
Gemfile
1
Gemfile
@ -16,7 +16,6 @@ gem "whenever", :require => false
|
||||
gem "sanitize"
|
||||
gem 'ruby-vips'
|
||||
gem 'net-sftp'
|
||||
gem 'term-ansicolor', :require => "term/ansicolor"
|
||||
gem 'diff-lcs', :require => "diff/lcs/array"
|
||||
gem 'bcrypt', :require => "bcrypt"
|
||||
gem 'draper'
|
||||
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'term_cdiff' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("term-ansicolor", "term_cdiff")
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'term_colortab' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("term-ansicolor", "term_colortab")
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'term_decolor' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("term-ansicolor", "term_decolor")
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'term_display' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("term-ansicolor", "term_display")
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'term_mandel' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("term-ansicolor", "term_mandel")
|
@ -1,73 +0,0 @@
|
||||
# yields a stacktrace for each SQL query
|
||||
# put this file in config/initializers
|
||||
class QueryTrace < ActiveSupport::LogSubscriber
|
||||
include Term::ANSIColor
|
||||
attr_accessor :trace_queries
|
||||
|
||||
def sql(event) #:nodoc:
|
||||
return unless QueryTrace.enabled? && logger.debug? && Rails.env.development?
|
||||
stack = Rails.backtrace_cleaner.clean(caller)
|
||||
first_line = stack.shift
|
||||
return unless first_line
|
||||
|
||||
msg = prefix + bold + cyan + "#{first_line}\n" + reset
|
||||
msg += cyan + stack.join("\n") + reset
|
||||
debug msg
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
# Klass.enabled?
|
||||
#
|
||||
# yields boolean if SQL queries should be logged or not
|
||||
|
||||
def self.enabled?
|
||||
defined?(@trace_queries) && @trace_queries
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
# Klass.status
|
||||
#
|
||||
# yields text if QueryTrace has been enabled or not
|
||||
|
||||
def self.status
|
||||
QueryTrace.enabled? ? 'enabled' : 'disabled'
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
# Klass.enable!
|
||||
#
|
||||
# turn on SQL query origin logging
|
||||
|
||||
def self.enable!
|
||||
@trace_queries = true
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
# Klass.disable!
|
||||
#
|
||||
# turn off SQL query origin logging
|
||||
|
||||
def self.disable!
|
||||
@trace_queries = false
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
# Klass.toggle!
|
||||
#
|
||||
# Toggles query tracing yielding a boolean indicating the new state of query
|
||||
# origin tracing
|
||||
|
||||
def self.toggle!
|
||||
enabled? ? disable! : enable!
|
||||
enabled?
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def prefix #:nodoc:
|
||||
bold(magenta('Called from: ')) + reset
|
||||
end
|
||||
end
|
||||
|
||||
QueryTrace.attach_to :active_record
|
||||
QueryTrace.enable! if ENV['QUERY_TRACE']
|
Loading…
Reference in New Issue
Block a user