Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>(Not an answer.)</p> <p>I'm having problems reading your code. For example:</p> <pre><code>$schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false # Did you mean: scheme_exists = $schemes.has_key?(scheme_name.chop) </code></pre> <p>And:</p> <pre><code>if !scheme_exists $schemes[scheme_name.chop] = [] puts "Scheme #{scheme_name.chop} doesn't exist" else scheme_exists = true # ... </code></pre> <p>Why do you set <code>scheme_exists</code> to true? You just tested that it <em>wasn't</em> true.</p> <p>Your "scheme exists" looks a lot like your "module exists", if they're the same, make them the same. There is a lot of <code>chop</code>ping going on, perhaps you should just chop after input and stop chopping everywhere else&ndash;it seems error-prone and adds a lot of noise.</p> <p>Overall I find it difficult to reason about your code without actually stepping through it. I'd recommend refactoring, making things read "out loud" like the problem you're trying to solve.</p> <p>We also don't know if anything else touches <code>$schemes</code>. Whether or not you "should" be using a database depends <em>entirely</em> on your goals, your constraints, how you're running the app, etc. You could also serialize YAML, write a plain text file, all sorts of things.</p> <p>If you restart/rerun the app you'll obviously lose all your data that isn't persisted. If you stay within the app the whole time, then it's likely either the code or your assumptions are wrong, but it's an onerous task for someone to look over the code and determine because of the way it's structured and named.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload