Last active
December 15, 2015 05:39
-
-
Save killme2008/5211094 to your computer and use it in GitHub Desktop.
Revisions
-
killme2008 revised this gist
Mar 21, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,9 @@ File.open(name,"r") do |f| content = f.read if content =~ /environ.core/ content.scan(/\(env :([a-zA-Z\-]+) ("([^\)]+)")?\)/).each do |matches| $stderr.puts "Duplicated var #{matches[0]} in #{name}:current #{vars[matches[0]]},found:#{matches[2]}" if vars[matches[0]] vars[matches[0]]= matches[2] end end end -
killme2008 revised this gist
Mar 21, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ File.open(name,"r") do |f| content = f.read if content =~ /environ.core/ content.scan(/\(env :([a-zA-Z\-]+) ("[^\)]+")?\)/).each do |matches| $stderr.puts "Duplicated var #{matches[0]} in #{name}:current #{vars[matches[0]]},found:#{matches[1]}" if vars[matches[0]] vars[matches[0]]= matches[1] end -
killme2008 created this gist
Mar 21, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/ruby if __FILE__ == $0 vars = {} Dir.glob("**/*") do |name| if File.file? name and name =~ /\.clj$/ File.open(name,"r") do |f| content = f.read if content =~ /environ.core/ content.scan(/\(env :([a-zA-Z\-]+) "([^\)]+)"\)/).each do |matches| $stderr.puts "Duplicated var #{matches[0]} in #{name}:current #{vars[matches[0]]},found:#{matches[1]}" if vars[matches[0]] vars[matches[0]]= matches[1] end end end end end vars.each do |k,v| puts "export #{k.gsub(/\-/,"_").upcase}=#{v.gsub(/\$/,"\\$")}" end end