lib/brid.rb in brid-0.1.3 vs lib/brid.rb in brid-0.2.0
- old
+ new
@@ -1,11 +1,29 @@
-['version.rb', 'mod11.rb', 'generic_id.rb'].each do |filename|
- require File.join(File.dirname(__FILE__), 'brid', filename)
-end
+#requires
-['cpf.rb', 'cnpj.rb', 'titulo_eleitor.rb', 'pis.rb'].each do |filename|
- require File.join(File.dirname(__FILE__), 'brid', 'ids', filename)
+root_dir = File.join(File.dirname(__FILE__), 'brid')
+
+require File.join(root_dir, 'version.rb')
+
+#mod algorithms
+[
+ 'luhn.rb',
+ 'mod10.rb',
+ 'mod11.rb'
+].each do |filename|
+ require File.join(root_dir, 'algorithms', filename)
end
+#ids and documents
+[
+ 'generic_id',
+ 'cpf.rb',
+ 'cnpj.rb',
+ 'titulo_eleitor.rb',
+ 'pis.rb',
+ 'cred_card.rb'
+].each do |filename|
+ require File.join(root_dir, 'ids', filename)
+end
require File.join(File.dirname(__FILE__), 'brid', 'detector.rb')