Browse Source

Hide variables from commented out lines

Andrew Kane 8 years ago
parent
commit
283105a0b7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/controllers/blazer/base_controller.rb

+ 2 - 1
app/controllers/blazer/base_controller.rb

@@ -41,7 +41,8 @@ module Blazer
     end
 
     def extract_vars(statement)
-      statement.scan(/\{.*?\}/).map { |v| v[1...-1] }.uniq
+      # strip commented out lines
+      statement.gsub(/\-\-.+/, "").gsub(/\/\*.+\*\//m, "").scan(/\{.*?\}/).map { |v| v[1...-1] }.uniq
     end
     helper_method :extract_vars