From c28ad3b8a304f10fab8268608cc2fa9e8e1c60bd Mon Sep 17 00:00:00 2001 From: Kira Date: Sat, 10 Aug 2019 04:49:18 -0700 Subject: [PATCH] Remove unused term-ansicolor and query tracer config --- Gemfile | 1 - bin/term_cdiff | 29 ------------ bin/term_colortab | 29 ------------ bin/term_decolor | 29 ------------ bin/term_display | 29 ------------ bin/term_mandel | 29 ------------ config/initializers/query_trace.rb | 73 ------------------------------ 7 files changed, 219 deletions(-) delete mode 100755 bin/term_cdiff delete mode 100755 bin/term_colortab delete mode 100755 bin/term_decolor delete mode 100755 bin/term_display delete mode 100755 bin/term_mandel delete mode 100644 config/initializers/query_trace.rb diff --git a/Gemfile b/Gemfile index e3ff7a86d..7f3559841 100644 --- a/Gemfile +++ b/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' diff --git a/bin/term_cdiff b/bin/term_cdiff deleted file mode 100755 index 669d7d89e..000000000 --- a/bin/term_cdiff +++ /dev/null @@ -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") diff --git a/bin/term_colortab b/bin/term_colortab deleted file mode 100755 index f03be701b..000000000 --- a/bin/term_colortab +++ /dev/null @@ -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") diff --git a/bin/term_decolor b/bin/term_decolor deleted file mode 100755 index 238b84c39..000000000 --- a/bin/term_decolor +++ /dev/null @@ -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") diff --git a/bin/term_display b/bin/term_display deleted file mode 100755 index 84c6191b9..000000000 --- a/bin/term_display +++ /dev/null @@ -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") diff --git a/bin/term_mandel b/bin/term_mandel deleted file mode 100755 index 0c064431f..000000000 --- a/bin/term_mandel +++ /dev/null @@ -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") diff --git a/config/initializers/query_trace.rb b/config/initializers/query_trace.rb deleted file mode 100644 index 8ec579182..000000000 --- a/config/initializers/query_trace.rb +++ /dev/null @@ -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']