Method: BaseDato#database
- Defined in:
- lib/cobreak/function_hash.rb
#database(alg) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cobreak/function_hash.rb', line 10 def database(alg) var1 = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'hash', 'hash.db') if File.exists?(var1) == false FileUtils.touch(var1) end IO.foreach(var1) {|line| line.chomp! $db[:database] << {text_db:line} } if ($db[:database].filter(text_db:alg).map(:text_db)).include?(alg) == true exit end File.open(var1, mode: 'a'){|lin| lin.puts alg } end |