OSDN Git Service

Ruby: from_dump was not working because String#each is no longer implemented. Fixed.
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Sun, 1 Nov 2015 15:19:39 +0000 (15:19 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Sun, 1 Nov 2015 15:19:39 +0000 (15:19 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@590 a2be9bc6-48de-4e38-9406-05402d4bc13c

Scripts/loadsave.rb

index ae72290..86c3263 100755 (executable)
@@ -1152,10 +1152,12 @@ end_of_header
        keys = []
        resAtoms = Hash.new
        newBonds = []
+       #  arg can be either a String or an array of String.
+       #  Iterates for each line in the string or each member of the array.
+       if arg.is_a?(String)
+         arg = arg.split("\n")
+       end
     arg.each { |line|
-      #  arg can be either a String or an array of String. If it is a string,
-         #  arg.each iterates for each line in the string. If it is an array,
-         #  arg.each iterates for each member of the array.
          if line =~ /^\#/
            format = line[1..-1]
                keys = []