Business intelligence made simple
Removed extract_vars method [skip ci]
Andrew Kane9aaf41922a6a
diff --git a/lib/blazer.rb b/lib/blazer.rbindex 0fe03894..629d148d 100644--- a/lib/blazer.rb+++ b/lib/blazer.rb@@ -135,13 +135,6 @@ module Blazerendend- # TODO move to Statement and remove in 3.0.0- def self.extract_vars(statement)- # strip commented out lines- # and regex {1} or {1,2}- statement.to_s.gsub(/\-\-.+/, "").gsub(/\/\*.+\*\//m, "").scan(/\{\w*?\}/i).map { |v| v[1...-1] }.reject { |v| /\A\d+(\,\d+)?\z/.match(v) || v.empty? }.uniq- end-def self.run_checks(schedule: nil)checks = Blazer::Check.includes(:query)checks = checks.where(schedule: schedule) if schedulediff --git a/lib/blazer/statement.rb b/lib/blazer/statement.rbindex 994d733e..af378331 100644--- a/lib/blazer/statement.rb+++ b/lib/blazer/statement.rb@@ -10,7 +10,9 @@ module Blazerenddef variables- @variables ||= Blazer.extract_vars(statement)+ # strip commented out lines+ # and regex {1} or {1,2}+ @variables ||= statement.to_s.gsub(/\-\-.+/, "").gsub(/\/\*.+\*\//m, "").scan(/\{\w*?\}/i).map { |v| v[1...-1] }.reject { |v| /\A\d+(\,\d+)?\z/.match(v) || v.empty? }.uniqenddef add_values(var_params)