Created
November 18, 2010 18:42
-
-
Save paveltyk/705404 to your computer and use it in GitHub Desktop.
This file contains 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 characters
output_file = File.open 'activemerchant_gateway_output.rb', 'w' | |
output_file.puts "PAYMENT_GATEWAYS = {" | |
File.open 'activemerchant_gateway_input.txt' do |input_file| | |
input_file.each_line do |line| | |
match = line.match /^.*?(\w*).rb:.*class (\w*)Gateway.*$/ | |
next unless match | |
output_file.puts " \"#{match[1]}\" => {" | |
output_file.puts " :name => \"#{match[2]}\"," | |
output_file.puts " :class => ActiveMerchant::Billing::#{match[2]}Gateway" | |
output_file.puts " }," | |
end | |
end | |
output_file.puts "}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment