ImpUnit 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/ImpUnit/version.rb +1 -1
 - data/lib/ImpUnit.rb +35 -33
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 50e1426d7afbd2cf0043711b0f4912a030f954949c556ae865ba12c15012ff4e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0dc1ab1f2f0c50752306ec26dd17ea88c75d5b81267e547e3e5fa589dc8c93a6
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e12872c0f887e95d3bc8780906a06c4d87e455aa62e49ec9dfa43cbd86d31fe432c20d898dcfb698e6f83ac4957ea7c54bd15af45f3173002fc67d953afad7c7
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 571cd896ca43da94713afae85856bdf58b5c06e5fa14de52f1e9dc1197b80dfda682c223082ea35b82b0ec0629aabbfc7ee17f7fbfa029b8a61545f1b754f1c5
         
     | 
    
        data/lib/ImpUnit/version.rb
    CHANGED
    
    
    
        data/lib/ImpUnit.rb
    CHANGED
    
    | 
         @@ -140,46 +140,48 @@ module ImpUnit 
     | 
|
| 
       140 
140 
     | 
    
         
             
                  # Base dialogue sequence on size limit.
         
     | 
| 
       141 
141 
     | 
    
         
             
                  size_limit.times do
         
     | 
| 
       142 
142 
     | 
    
         | 
| 
       143 
     | 
    
         
            -
             
     | 
| 
       144 
     | 
    
         
            -
             
     | 
| 
       145 
     | 
    
         
            -
             
     | 
| 
       146 
     | 
    
         
            -
             
     | 
| 
       147 
     | 
    
         
            -
             
     | 
| 
       148 
     | 
    
         
            -
                  if name_limit > character_count
         
     | 
| 
       149 
     | 
    
         
            -
                    name_limit = name_limit % 2
         
     | 
| 
       150 
     | 
    
         
            -
                  else
         
     | 
| 
       151 
     | 
    
         
            -
                    name_limit = name_limit + 1
         
     | 
| 
       152 
     | 
    
         
            -
                  end
         
     | 
| 
      
 143 
     | 
    
         
            +
                    # Username logistics
         
     | 
| 
      
 144 
     | 
    
         
            +
                    name_list   = File.read("data/identity/name_list.txt").split(", ")
         
     | 
| 
      
 145 
     | 
    
         
            +
                    name        = name_list[name_number].to_s
         
     | 
| 
      
 146 
     | 
    
         
            +
                    name_limit  = name_list[name_number].size
         
     | 
| 
       153 
147 
     | 
    
         | 
| 
       154 
     | 
    
         
            -
             
     | 
| 
      
 148 
     | 
    
         
            +
                    if name_limit > character_count
         
     | 
| 
      
 149 
     | 
    
         
            +
                      name_limit = name_limit % 2
         
     | 
| 
      
 150 
     | 
    
         
            +
                    else
         
     | 
| 
      
 151 
     | 
    
         
            +
                      name_limit = name_limit + 1
         
     | 
| 
      
 152 
     | 
    
         
            +
                    end
         
     | 
| 
       155 
153 
     | 
    
         | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
       157 
     | 
    
         
            -
                  system("date > data/date/date.txt")
         
     | 
| 
      
 154 
     | 
    
         
            +
                    old_dialogue = File.read("archive/dialogue.txt").strip.to_s
         
     | 
| 
       158 
155 
     | 
    
         | 
| 
       159 
     | 
    
         
            -
             
     | 
| 
      
 156 
     | 
    
         
            +
                    # Write date to file.
         
     | 
| 
      
 157 
     | 
    
         
            +
                    system("date > data/date/date.txt")
         
     | 
| 
       160 
158 
     | 
    
         | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
                  print "[#{date} #{name.strip}] "; new_dialogue = gets.chomp
         
     | 
| 
      
 159 
     | 
    
         
            +
                    date = File.read("data/date/date.txt").strip
         
     | 
| 
       163 
160 
     | 
    
         | 
| 
       164 
     | 
    
         
            -
             
     | 
| 
       165 
     | 
    
         
            -
             
     | 
| 
       166 
     | 
    
         
            -
             
     | 
| 
       167 
     | 
    
         
            -
             
     | 
| 
      
 161 
     | 
    
         
            +
                    # Print character dialogue to screen.
         
     | 
| 
      
 162 
     | 
    
         
            +
                    print "[#{date} #{name.strip}] "; new_dialogue = gets.chomp
         
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
                    # If writer specifies exit then aborts
         
     | 
| 
      
 165 
     | 
    
         
            +
                    if new_dialogue == "exit"
         
     | 
| 
      
 166 
     | 
    
         
            +
                      abort
         
     | 
| 
      
 167 
     | 
    
         
            +
                    end
         
     | 
| 
       168 
168 
     | 
    
         | 
| 
       169 
     | 
    
         
            -
             
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
             
     | 
| 
       172 
     | 
    
         
            -
             
     | 
| 
       173 
     | 
    
         
            -
             
     | 
| 
       174 
     | 
    
         
            -
             
     | 
| 
       175 
     | 
    
         
            -
             
     | 
| 
       176 
     | 
    
         
            -
             
     | 
| 
       177 
     | 
    
         
            -
             
     | 
| 
       178 
     | 
    
         
            -
             
     | 
| 
       179 
     | 
    
         
            -
             
     | 
| 
       180 
     | 
    
         
            -
             
     | 
| 
      
 169 
     | 
    
         
            +
                    # Autosaves dialogue archive. Auto appends old dialogue above new dialogue.
         
     | 
| 
      
 170 
     | 
    
         
            +
                    open("archive/dialogue.txt", "w") { |f|
         
     | 
| 
      
 171 
     | 
    
         
            +
                      f.puts old_dialogue
         
     | 
| 
      
 172 
     | 
    
         
            +
                      f.print "[#{date} #{name.strip}] "
         
     | 
| 
      
 173 
     | 
    
         
            +
                      f.puts new_dialogue
         
     | 
| 
      
 174 
     | 
    
         
            +
                    }
         
     | 
| 
      
 175 
     | 
    
         
            +
             
     | 
| 
      
 176 
     | 
    
         
            +
                    # Changes name as if in a chatroom.
         
     | 
| 
      
 177 
     | 
    
         
            +
                    if name_number == name_limit
         
     | 
| 
      
 178 
     | 
    
         
            +
                      name_number = 0
         
     | 
| 
      
 179 
     | 
    
         
            +
                    else
         
     | 
| 
      
 180 
     | 
    
         
            +
                      name_number = name_number + 1
         
     | 
| 
      
 181 
     | 
    
         
            +
                    end
         
     | 
| 
       181 
182 
     | 
    
         
             
                  end
         
     | 
| 
       182 
     | 
    
         
            -
                end
         
     | 
| 
       183 
183 
     | 
    
         | 
| 
      
 184 
     | 
    
         
            +
                end
         
     | 
| 
       184 
185 
     | 
    
         
             
              end
         
     | 
| 
      
 186 
     | 
    
         
            +
             
     | 
| 
       185 
187 
     | 
    
         
             
            end
         
     |