Ver código fonte

Hide variables from commented out lines

Andrew Kane 8 anos atrás
pai
commit
283105a0b7
1 arquivos alterados com 2 adições e 1 exclusões
  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