judge 0.2.0
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.
- data/.document +5 -0
- data/.travis.yml +18 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +112 -0
- data/LICENSE.txt +20 -0
- data/README.md +20 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/judge.gemspec +155 -0
- data/lib/generators/judge/judge_generator.rb +21 -0
- data/lib/generators/judge/templates/json2.js +483 -0
- data/lib/generators/judge/templates/judge.js +295 -0
- data/lib/generators/judge/templates/underscore.js +840 -0
- data/lib/judge.rb +4 -0
- data/lib/judge/helpers.rb +31 -0
- data/lib/tasks/js_tests.rake +27 -0
- data/spec/javascripts/JudgeSpec.js +670 -0
- data/spec/javascripts/fixtures/form.html +50 -0
- data/spec/javascripts/helpers/customMatchers.js +20 -0
- data/spec/javascripts/helpers/jasmine-jquery.js +204 -0
- data/spec/javascripts/helpers/jquery-1.5.1.min.js +18 -0
- data/spec/javascripts/helpers/json2.js +482 -0
- data/spec/javascripts/helpers/underscore.js +824 -0
- data/spec/javascripts/support/jasmine.yml +79 -0
- data/spec/javascripts/support/jasmine_config.rb +6 -0
- data/spec/javascripts/support/jasmine_runner.rb +32 -0
- data/spec/javascripts/support/phantomRunner.js +28 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/foos_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/foo.rb +11 -0
- data/test/dummy/app/views/foos/new.html.erb +42 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +45 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +22 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20110624115516_create_foos.rb +26 -0
- data/test/dummy/db/schema.rb +34 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +59 -0
- data/test/dummy/log/production.log +0 -0
- data/test/dummy/log/server.log +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/javascripts/application.js +2 -0
- data/test/dummy/public/javascripts/controls.js +965 -0
- data/test/dummy/public/javascripts/dragdrop.js +974 -0
- data/test/dummy/public/javascripts/effects.js +1123 -0
- data/test/dummy/public/javascripts/prototype.js +6001 -0
- data/test/dummy/public/javascripts/rails.js +175 -0
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/judge_test.rb +73 -0
- data/test/test_helper.rb +23 -0
- metadata +275 -0
| @@ -0,0 +1,175 @@ | |
| 1 | 
            +
            (function() {
         | 
| 2 | 
            +
              // Technique from Juriy Zaytsev
         | 
| 3 | 
            +
              // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
         | 
| 4 | 
            +
              function isEventSupported(eventName) {
         | 
| 5 | 
            +
                var el = document.createElement('div');
         | 
| 6 | 
            +
                eventName = 'on' + eventName;
         | 
| 7 | 
            +
                var isSupported = (eventName in el);
         | 
| 8 | 
            +
                if (!isSupported) {
         | 
| 9 | 
            +
                  el.setAttribute(eventName, 'return;');
         | 
| 10 | 
            +
                  isSupported = typeof el[eventName] == 'function';
         | 
| 11 | 
            +
                }
         | 
| 12 | 
            +
                el = null;
         | 
| 13 | 
            +
                return isSupported;
         | 
| 14 | 
            +
              }
         | 
| 15 | 
            +
             | 
| 16 | 
            +
              function isForm(element) {
         | 
| 17 | 
            +
                return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
         | 
| 18 | 
            +
              }
         | 
| 19 | 
            +
             | 
| 20 | 
            +
              function isInput(element) {
         | 
| 21 | 
            +
                if (Object.isElement(element)) {
         | 
| 22 | 
            +
                  var name = element.nodeName.toUpperCase()
         | 
| 23 | 
            +
                  return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
         | 
| 24 | 
            +
                }
         | 
| 25 | 
            +
                else return false
         | 
| 26 | 
            +
              }
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              var submitBubbles = isEventSupported('submit'),
         | 
| 29 | 
            +
                  changeBubbles = isEventSupported('change')
         | 
| 30 | 
            +
             | 
| 31 | 
            +
              if (!submitBubbles || !changeBubbles) {
         | 
| 32 | 
            +
                // augment the Event.Handler class to observe custom events when needed
         | 
| 33 | 
            +
                Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
         | 
| 34 | 
            +
                  function(init, element, eventName, selector, callback) {
         | 
| 35 | 
            +
                    init(element, eventName, selector, callback)
         | 
| 36 | 
            +
                    // is the handler being attached to an element that doesn't support this event?
         | 
| 37 | 
            +
                    if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
         | 
| 38 | 
            +
                         (!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
         | 
| 39 | 
            +
                      // "submit" => "emulated:submit"
         | 
| 40 | 
            +
                      this.eventName = 'emulated:' + this.eventName
         | 
| 41 | 
            +
                    }
         | 
| 42 | 
            +
                  }
         | 
| 43 | 
            +
                )
         | 
| 44 | 
            +
              }
         | 
| 45 | 
            +
             | 
| 46 | 
            +
              if (!submitBubbles) {
         | 
| 47 | 
            +
                // discover forms on the page by observing focus events which always bubble
         | 
| 48 | 
            +
                document.on('focusin', 'form', function(focusEvent, form) {
         | 
| 49 | 
            +
                  // special handler for the real "submit" event (one-time operation)
         | 
| 50 | 
            +
                  if (!form.retrieve('emulated:submit')) {
         | 
| 51 | 
            +
                    form.on('submit', function(submitEvent) {
         | 
| 52 | 
            +
                      var emulated = form.fire('emulated:submit', submitEvent, true)
         | 
| 53 | 
            +
                      // if custom event received preventDefault, cancel the real one too
         | 
| 54 | 
            +
                      if (emulated.returnValue === false) submitEvent.preventDefault()
         | 
| 55 | 
            +
                    })
         | 
| 56 | 
            +
                    form.store('emulated:submit', true)
         | 
| 57 | 
            +
                  }
         | 
| 58 | 
            +
                })
         | 
| 59 | 
            +
              }
         | 
| 60 | 
            +
             | 
| 61 | 
            +
              if (!changeBubbles) {
         | 
| 62 | 
            +
                // discover form inputs on the page
         | 
| 63 | 
            +
                document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
         | 
| 64 | 
            +
                  // special handler for real "change" events
         | 
| 65 | 
            +
                  if (!input.retrieve('emulated:change')) {
         | 
| 66 | 
            +
                    input.on('change', function(changeEvent) {
         | 
| 67 | 
            +
                      input.fire('emulated:change', changeEvent, true)
         | 
| 68 | 
            +
                    })
         | 
| 69 | 
            +
                    input.store('emulated:change', true)
         | 
| 70 | 
            +
                  }
         | 
| 71 | 
            +
                })
         | 
| 72 | 
            +
              }
         | 
| 73 | 
            +
             | 
| 74 | 
            +
              function handleRemote(element) {
         | 
| 75 | 
            +
                var method, url, params;
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                var event = element.fire("ajax:before");
         | 
| 78 | 
            +
                if (event.stopped) return false;
         | 
| 79 | 
            +
             | 
| 80 | 
            +
                if (element.tagName.toLowerCase() === 'form') {
         | 
| 81 | 
            +
                  method = element.readAttribute('method') || 'post';
         | 
| 82 | 
            +
                  url    = element.readAttribute('action');
         | 
| 83 | 
            +
                  params = element.serialize();
         | 
| 84 | 
            +
                } else {
         | 
| 85 | 
            +
                  method = element.readAttribute('data-method') || 'get';
         | 
| 86 | 
            +
                  url    = element.readAttribute('href');
         | 
| 87 | 
            +
                  params = {};
         | 
| 88 | 
            +
                }
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                new Ajax.Request(url, {
         | 
| 91 | 
            +
                  method: method,
         | 
| 92 | 
            +
                  parameters: params,
         | 
| 93 | 
            +
                  evalScripts: true,
         | 
| 94 | 
            +
             | 
| 95 | 
            +
                  onComplete:    function(request) { element.fire("ajax:complete", request); },
         | 
| 96 | 
            +
                  onSuccess:     function(request) { element.fire("ajax:success",  request); },
         | 
| 97 | 
            +
                  onFailure:     function(request) { element.fire("ajax:failure",  request); }
         | 
| 98 | 
            +
                });
         | 
| 99 | 
            +
             | 
| 100 | 
            +
                element.fire("ajax:after");
         | 
| 101 | 
            +
              }
         | 
| 102 | 
            +
             | 
| 103 | 
            +
              function handleMethod(element) {
         | 
| 104 | 
            +
                var method = element.readAttribute('data-method'),
         | 
| 105 | 
            +
                    url = element.readAttribute('href'),
         | 
| 106 | 
            +
                    csrf_param = $$('meta[name=csrf-param]')[0],
         | 
| 107 | 
            +
                    csrf_token = $$('meta[name=csrf-token]')[0];
         | 
| 108 | 
            +
             | 
| 109 | 
            +
                var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
         | 
| 110 | 
            +
                element.parentNode.insert(form);
         | 
| 111 | 
            +
             | 
| 112 | 
            +
                if (method !== 'post') {
         | 
| 113 | 
            +
                  var field = new Element('input', { type: 'hidden', name: '_method', value: method });
         | 
| 114 | 
            +
                  form.insert(field);
         | 
| 115 | 
            +
                }
         | 
| 116 | 
            +
             | 
| 117 | 
            +
                if (csrf_param) {
         | 
| 118 | 
            +
                  var param = csrf_param.readAttribute('content'),
         | 
| 119 | 
            +
                      token = csrf_token.readAttribute('content'),
         | 
| 120 | 
            +
                      field = new Element('input', { type: 'hidden', name: param, value: token });
         | 
| 121 | 
            +
                  form.insert(field);
         | 
| 122 | 
            +
                }
         | 
| 123 | 
            +
             | 
| 124 | 
            +
                form.submit();
         | 
| 125 | 
            +
              }
         | 
| 126 | 
            +
             | 
| 127 | 
            +
             | 
| 128 | 
            +
              document.on("click", "*[data-confirm]", function(event, element) {
         | 
| 129 | 
            +
                var message = element.readAttribute('data-confirm');
         | 
| 130 | 
            +
                if (!confirm(message)) event.stop();
         | 
| 131 | 
            +
              });
         | 
| 132 | 
            +
             | 
| 133 | 
            +
              document.on("click", "a[data-remote]", function(event, element) {
         | 
| 134 | 
            +
                if (event.stopped) return;
         | 
| 135 | 
            +
                handleRemote(element);
         | 
| 136 | 
            +
                event.stop();
         | 
| 137 | 
            +
              });
         | 
| 138 | 
            +
             | 
| 139 | 
            +
              document.on("click", "a[data-method]", function(event, element) {
         | 
| 140 | 
            +
                if (event.stopped) return;
         | 
| 141 | 
            +
                handleMethod(element);
         | 
| 142 | 
            +
                event.stop();
         | 
| 143 | 
            +
              });
         | 
| 144 | 
            +
             | 
| 145 | 
            +
              document.on("submit", function(event) {
         | 
| 146 | 
            +
                var element = event.findElement(),
         | 
| 147 | 
            +
                    message = element.readAttribute('data-confirm');
         | 
| 148 | 
            +
                if (message && !confirm(message)) {
         | 
| 149 | 
            +
                  event.stop();
         | 
| 150 | 
            +
                  return false;
         | 
| 151 | 
            +
                }
         | 
| 152 | 
            +
             | 
| 153 | 
            +
                var inputs = element.select("input[type=submit][data-disable-with]");
         | 
| 154 | 
            +
                inputs.each(function(input) {
         | 
| 155 | 
            +
                  input.disabled = true;
         | 
| 156 | 
            +
                  input.writeAttribute('data-original-value', input.value);
         | 
| 157 | 
            +
                  input.value = input.readAttribute('data-disable-with');
         | 
| 158 | 
            +
                });
         | 
| 159 | 
            +
             | 
| 160 | 
            +
                var element = event.findElement("form[data-remote]");
         | 
| 161 | 
            +
                if (element) {
         | 
| 162 | 
            +
                  handleRemote(element);
         | 
| 163 | 
            +
                  event.stop();
         | 
| 164 | 
            +
                }
         | 
| 165 | 
            +
              });
         | 
| 166 | 
            +
             | 
| 167 | 
            +
              document.on("ajax:after", "form", function(event, element) {
         | 
| 168 | 
            +
                var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
         | 
| 169 | 
            +
                inputs.each(function(input) {
         | 
| 170 | 
            +
                  input.value = input.readAttribute('data-original-value');
         | 
| 171 | 
            +
                  input.removeAttribute('data-original-value');
         | 
| 172 | 
            +
                  input.disabled = false;
         | 
| 173 | 
            +
                });
         | 
| 174 | 
            +
              });
         | 
| 175 | 
            +
            })();
         | 
| 
            File without changes
         | 
| @@ -0,0 +1,6 @@ | |
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
            # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            APP_PATH = File.expand_path('../../config/application',  __FILE__)
         | 
| 5 | 
            +
            require File.expand_path('../../config/boot',  __FILE__)
         | 
| 6 | 
            +
            require 'rails/commands'
         | 
    
        data/test/judge_test.rb
    ADDED
    
    | @@ -0,0 +1,73 @@ | |
| 1 | 
            +
            require 'test_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            class JudgeTest < ActionController::TestCase
         | 
| 4 | 
            +
              tests FoosController
         | 
| 5 | 
            +
              
         | 
| 6 | 
            +
              context "form tag" do
         | 
| 7 | 
            +
                should "include validation messages in data attribute" do
         | 
| 8 | 
            +
                  get :new
         | 
| 9 | 
            +
                  assert_equal Hash, error_messages.class
         | 
| 10 | 
            +
                  assert error_messages.include? "inclusion"
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
              end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              context "validators" do
         | 
| 15 | 
            +
                setup { get :new }
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                should "include presence validation in data attribute" do
         | 
| 18 | 
            +
                  assert_equal "presence", validators_from("input#foo_one").first["kind"]
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                should "include length (within range) validation in data attribute" do
         | 
| 22 | 
            +
                  validators = validators_from("input#foo_two")
         | 
| 23 | 
            +
                  assert_equal "length", validators.first["kind"]
         | 
| 24 | 
            +
                  assert_equal Fixnum, validators.first["options"]["minimum"].class
         | 
| 25 | 
            +
                  assert_equal Fixnum, validators.first["options"]["maximum"].class
         | 
| 26 | 
            +
                  assert validators.first["options"]["allow_blank"]
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                should "include allow_blank validation in data attribute" do
         | 
| 30 | 
            +
                  validators = validators_from("input#foo_two")
         | 
| 31 | 
            +
                  assert validators.first["options"]["allow_blank"]
         | 
| 32 | 
            +
                end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                should "include exclusion validation in data atribute" do
         | 
| 35 | 
            +
                  validators = validators_from("input#foo_three")
         | 
| 36 | 
            +
                  assert_equal "exclusion", validators.first["kind"]
         | 
| 37 | 
            +
                  assert_equal Array, validators.first["options"]["in"].class
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                should "include numericality validation in data attribute" do
         | 
| 41 | 
            +
                  validator = validators_from("textarea#foo_four").first
         | 
| 42 | 
            +
                  assert_equal "numericality", validator["kind"]
         | 
| 43 | 
            +
                  assert validator["options"]["only_integer"]
         | 
| 44 | 
            +
                  assert validator["options"]["odd"]
         | 
| 45 | 
            +
                  assert_equal false, validator["options"]["allow_nil"]
         | 
| 46 | 
            +
                  assert_equal Fixnum, validator["options"]["less_than_or_equal_to"].class
         | 
| 47 | 
            +
                end
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                should "include exclusion validation in data attribute" do
         | 
| 50 | 
            +
                  validator = validators_from("textarea#foo_four")[1]
         | 
| 51 | 
            +
                  assert_equal "exclusion", validator["kind"]
         | 
| 52 | 
            +
                  assert_equal Array, validator["options"]["in"].class
         | 
| 53 | 
            +
                end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                should "include format validator in data attribute" do
         | 
| 56 | 
            +
                  validator = validators_from("textarea#foo_five").first
         | 
| 57 | 
            +
                  assert_equal "format", validator["kind"]
         | 
| 58 | 
            +
                  assert_match /\(.+\:.+\)/, validator["options"]["without"]
         | 
| 59 | 
            +
                end
         | 
| 60 | 
            +
              end
         | 
| 61 | 
            +
             | 
| 62 | 
            +
              def validators_from(input_selector)
         | 
| 63 | 
            +
                form = Nokogiri::HTML(css_select("form[data-error-messages]").first.to_s)
         | 
| 64 | 
            +
                data_attribute = form.css(input_selector).first["data-validate"]
         | 
| 65 | 
            +
                JSON.parse(data_attribute)
         | 
| 66 | 
            +
              end
         | 
| 67 | 
            +
             | 
| 68 | 
            +
              def error_messages
         | 
| 69 | 
            +
                form = Nokogiri::HTML(css_select("form[data-error-messages]").first.to_s)
         | 
| 70 | 
            +
                data_attribute = form.css("form").first["data-error-messages"]
         | 
| 71 | 
            +
                JSON.parse(data_attribute)
         | 
| 72 | 
            +
              end
         | 
| 73 | 
            +
            end
         | 
    
        data/test/test_helper.rb
    ADDED
    
    | @@ -0,0 +1,23 @@ | |
| 1 | 
            +
            require "rubygems"
         | 
| 2 | 
            +
            require "bundler"
         | 
| 3 | 
            +
            require "shoulda"
         | 
| 4 | 
            +
            require "action_view"
         | 
| 5 | 
            +
            require "active_support"
         | 
| 6 | 
            +
            require "nokogiri"
         | 
| 7 | 
            +
            require "json"
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            begin
         | 
| 10 | 
            +
              Bundler.setup(:default, :development)
         | 
| 11 | 
            +
            rescue Bundler::BundlerError => e
         | 
| 12 | 
            +
              $stderr.puts e.message
         | 
| 13 | 
            +
              $stderr.puts "Run `bundle install` to install missing gems"
         | 
| 14 | 
            +
              exit e.status_code
         | 
| 15 | 
            +
            end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            ENV["RAILS_ENV"] = "test"
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
         | 
| 20 | 
            +
            $LOAD_PATH.unshift(File.dirname(__FILE__))
         | 
| 21 | 
            +
            require "judge"
         | 
| 22 | 
            +
            require "dummy/config/environment"
         | 
| 23 | 
            +
            require "rails/test_help"
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,275 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification 
         | 
| 2 | 
            +
            name: judge
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            +
              prerelease: false
         | 
| 5 | 
            +
              segments: 
         | 
| 6 | 
            +
              - 0
         | 
| 7 | 
            +
              - 2
         | 
| 8 | 
            +
              - 0
         | 
| 9 | 
            +
              version: 0.2.0
         | 
| 10 | 
            +
            platform: ruby
         | 
| 11 | 
            +
            authors: 
         | 
| 12 | 
            +
            - Joe Corcoran
         | 
| 13 | 
            +
            autorequire: 
         | 
| 14 | 
            +
            bindir: bin
         | 
| 15 | 
            +
            cert_chain: []
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            date: 2011-07-21 00:00:00 +01:00
         | 
| 18 | 
            +
            default_executable: 
         | 
| 19 | 
            +
            dependencies: 
         | 
| 20 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 21 | 
            +
              name: bundler
         | 
| 22 | 
            +
              requirement: &id001 !ruby/object:Gem::Requirement 
         | 
| 23 | 
            +
                none: false
         | 
| 24 | 
            +
                requirements: 
         | 
| 25 | 
            +
                - - ~>
         | 
| 26 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 27 | 
            +
                    segments: 
         | 
| 28 | 
            +
                    - 1
         | 
| 29 | 
            +
                    - 0
         | 
| 30 | 
            +
                    - 0
         | 
| 31 | 
            +
                    version: 1.0.0
         | 
| 32 | 
            +
              type: :development
         | 
| 33 | 
            +
              prerelease: false
         | 
| 34 | 
            +
              version_requirements: *id001
         | 
| 35 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 36 | 
            +
              name: jeweler
         | 
| 37 | 
            +
              requirement: &id002 !ruby/object:Gem::Requirement 
         | 
| 38 | 
            +
                none: false
         | 
| 39 | 
            +
                requirements: 
         | 
| 40 | 
            +
                - - ~>
         | 
| 41 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 42 | 
            +
                    segments: 
         | 
| 43 | 
            +
                    - 1
         | 
| 44 | 
            +
                    - 5
         | 
| 45 | 
            +
                    - 2
         | 
| 46 | 
            +
                    version: 1.5.2
         | 
| 47 | 
            +
              type: :development
         | 
| 48 | 
            +
              prerelease: false
         | 
| 49 | 
            +
              version_requirements: *id002
         | 
| 50 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 51 | 
            +
              name: jasmine
         | 
| 52 | 
            +
              requirement: &id003 !ruby/object:Gem::Requirement 
         | 
| 53 | 
            +
                none: false
         | 
| 54 | 
            +
                requirements: 
         | 
| 55 | 
            +
                - - ~>
         | 
| 56 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 57 | 
            +
                    segments: 
         | 
| 58 | 
            +
                    - 1
         | 
| 59 | 
            +
                    - 0
         | 
| 60 | 
            +
                    - 2
         | 
| 61 | 
            +
                    version: 1.0.2
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: *id003
         | 
| 65 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 66 | 
            +
              name: rails
         | 
| 67 | 
            +
              requirement: &id004 !ruby/object:Gem::Requirement 
         | 
| 68 | 
            +
                none: false
         | 
| 69 | 
            +
                requirements: 
         | 
| 70 | 
            +
                - - ~>
         | 
| 71 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 72 | 
            +
                    segments: 
         | 
| 73 | 
            +
                    - 3
         | 
| 74 | 
            +
                    - 0
         | 
| 75 | 
            +
                    - 3
         | 
| 76 | 
            +
                    version: 3.0.3
         | 
| 77 | 
            +
              type: :development
         | 
| 78 | 
            +
              prerelease: false
         | 
| 79 | 
            +
              version_requirements: *id004
         | 
| 80 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 81 | 
            +
              name: shoulda
         | 
| 82 | 
            +
              requirement: &id005 !ruby/object:Gem::Requirement 
         | 
| 83 | 
            +
                none: false
         | 
| 84 | 
            +
                requirements: 
         | 
| 85 | 
            +
                - - ~>
         | 
| 86 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 87 | 
            +
                    segments: 
         | 
| 88 | 
            +
                    - 2
         | 
| 89 | 
            +
                    - 11
         | 
| 90 | 
            +
                    - 3
         | 
| 91 | 
            +
                    version: 2.11.3
         | 
| 92 | 
            +
              type: :development
         | 
| 93 | 
            +
              prerelease: false
         | 
| 94 | 
            +
              version_requirements: *id005
         | 
| 95 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 96 | 
            +
              name: sqlite3-ruby
         | 
| 97 | 
            +
              requirement: &id006 !ruby/object:Gem::Requirement 
         | 
| 98 | 
            +
                none: false
         | 
| 99 | 
            +
                requirements: 
         | 
| 100 | 
            +
                - - ~>
         | 
| 101 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 102 | 
            +
                    segments: 
         | 
| 103 | 
            +
                    - 1
         | 
| 104 | 
            +
                    - 3
         | 
| 105 | 
            +
                    - 2
         | 
| 106 | 
            +
                    version: 1.3.2
         | 
| 107 | 
            +
              type: :development
         | 
| 108 | 
            +
              prerelease: false
         | 
| 109 | 
            +
              version_requirements: *id006
         | 
| 110 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 111 | 
            +
              name: nokogiri
         | 
| 112 | 
            +
              requirement: &id007 !ruby/object:Gem::Requirement 
         | 
| 113 | 
            +
                none: false
         | 
| 114 | 
            +
                requirements: 
         | 
| 115 | 
            +
                - - ~>
         | 
| 116 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 117 | 
            +
                    segments: 
         | 
| 118 | 
            +
                    - 1
         | 
| 119 | 
            +
                    - 4
         | 
| 120 | 
            +
                    - 4
         | 
| 121 | 
            +
                    version: 1.4.4
         | 
| 122 | 
            +
              type: :development
         | 
| 123 | 
            +
              prerelease: false
         | 
| 124 | 
            +
              version_requirements: *id007
         | 
| 125 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 126 | 
            +
              name: json
         | 
| 127 | 
            +
              requirement: &id008 !ruby/object:Gem::Requirement 
         | 
| 128 | 
            +
                none: false
         | 
| 129 | 
            +
                requirements: 
         | 
| 130 | 
            +
                - - ~>
         | 
| 131 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 132 | 
            +
                    segments: 
         | 
| 133 | 
            +
                    - 1
         | 
| 134 | 
            +
                    - 4
         | 
| 135 | 
            +
                    - 6
         | 
| 136 | 
            +
                    version: 1.4.6
         | 
| 137 | 
            +
              type: :development
         | 
| 138 | 
            +
              prerelease: false
         | 
| 139 | 
            +
              version_requirements: *id008
         | 
| 140 | 
            +
            description: Validate forms in-place using your model validations
         | 
| 141 | 
            +
            email: joe@tribesports.com
         | 
| 142 | 
            +
            executables: []
         | 
| 143 | 
            +
             | 
| 144 | 
            +
            extensions: []
         | 
| 145 | 
            +
             | 
| 146 | 
            +
            extra_rdoc_files: 
         | 
| 147 | 
            +
            - LICENSE.txt
         | 
| 148 | 
            +
            - README.md
         | 
| 149 | 
            +
            files: 
         | 
| 150 | 
            +
            - .document
         | 
| 151 | 
            +
            - .travis.yml
         | 
| 152 | 
            +
            - Gemfile
         | 
| 153 | 
            +
            - Gemfile.lock
         | 
| 154 | 
            +
            - LICENSE.txt
         | 
| 155 | 
            +
            - README.md
         | 
| 156 | 
            +
            - Rakefile
         | 
| 157 | 
            +
            - VERSION
         | 
| 158 | 
            +
            - judge.gemspec
         | 
| 159 | 
            +
            - lib/generators/judge/judge_generator.rb
         | 
| 160 | 
            +
            - lib/generators/judge/templates/json2.js
         | 
| 161 | 
            +
            - lib/generators/judge/templates/judge.js
         | 
| 162 | 
            +
            - lib/generators/judge/templates/underscore.js
         | 
| 163 | 
            +
            - lib/judge.rb
         | 
| 164 | 
            +
            - lib/judge/helpers.rb
         | 
| 165 | 
            +
            - lib/tasks/js_tests.rake
         | 
| 166 | 
            +
            - spec/javascripts/JudgeSpec.js
         | 
| 167 | 
            +
            - spec/javascripts/fixtures/form.html
         | 
| 168 | 
            +
            - spec/javascripts/helpers/customMatchers.js
         | 
| 169 | 
            +
            - spec/javascripts/helpers/jasmine-jquery.js
         | 
| 170 | 
            +
            - spec/javascripts/helpers/jquery-1.5.1.min.js
         | 
| 171 | 
            +
            - spec/javascripts/helpers/json2.js
         | 
| 172 | 
            +
            - spec/javascripts/helpers/underscore.js
         | 
| 173 | 
            +
            - spec/javascripts/support/jasmine.yml
         | 
| 174 | 
            +
            - spec/javascripts/support/jasmine_config.rb
         | 
| 175 | 
            +
            - spec/javascripts/support/jasmine_runner.rb
         | 
| 176 | 
            +
            - spec/javascripts/support/phantomRunner.js
         | 
| 177 | 
            +
            - test/dummy/Rakefile
         | 
| 178 | 
            +
            - test/dummy/app/controllers/application_controller.rb
         | 
| 179 | 
            +
            - test/dummy/app/controllers/foos_controller.rb
         | 
| 180 | 
            +
            - test/dummy/app/helpers/application_helper.rb
         | 
| 181 | 
            +
            - test/dummy/app/models/foo.rb
         | 
| 182 | 
            +
            - test/dummy/app/views/foos/new.html.erb
         | 
| 183 | 
            +
            - test/dummy/app/views/layouts/application.html.erb
         | 
| 184 | 
            +
            - test/dummy/config.ru
         | 
| 185 | 
            +
            - test/dummy/config/application.rb
         | 
| 186 | 
            +
            - test/dummy/config/boot.rb
         | 
| 187 | 
            +
            - test/dummy/config/database.yml
         | 
| 188 | 
            +
            - test/dummy/config/environment.rb
         | 
| 189 | 
            +
            - test/dummy/config/environments/development.rb
         | 
| 190 | 
            +
            - test/dummy/config/environments/production.rb
         | 
| 191 | 
            +
            - test/dummy/config/environments/test.rb
         | 
| 192 | 
            +
            - test/dummy/config/initializers/backtrace_silencers.rb
         | 
| 193 | 
            +
            - test/dummy/config/initializers/inflections.rb
         | 
| 194 | 
            +
            - test/dummy/config/initializers/mime_types.rb
         | 
| 195 | 
            +
            - test/dummy/config/initializers/secret_token.rb
         | 
| 196 | 
            +
            - test/dummy/config/initializers/session_store.rb
         | 
| 197 | 
            +
            - test/dummy/config/locales/en.yml
         | 
| 198 | 
            +
            - test/dummy/config/routes.rb
         | 
| 199 | 
            +
            - test/dummy/db/development.sqlite3
         | 
| 200 | 
            +
            - test/dummy/db/migrate/20110624115516_create_foos.rb
         | 
| 201 | 
            +
            - test/dummy/db/schema.rb
         | 
| 202 | 
            +
            - test/dummy/db/test.sqlite3
         | 
| 203 | 
            +
            - test/dummy/log/development.log
         | 
| 204 | 
            +
            - test/dummy/log/production.log
         | 
| 205 | 
            +
            - test/dummy/log/server.log
         | 
| 206 | 
            +
            - test/dummy/public/404.html
         | 
| 207 | 
            +
            - test/dummy/public/422.html
         | 
| 208 | 
            +
            - test/dummy/public/500.html
         | 
| 209 | 
            +
            - test/dummy/public/favicon.ico
         | 
| 210 | 
            +
            - test/dummy/public/javascripts/application.js
         | 
| 211 | 
            +
            - test/dummy/public/javascripts/controls.js
         | 
| 212 | 
            +
            - test/dummy/public/javascripts/dragdrop.js
         | 
| 213 | 
            +
            - test/dummy/public/javascripts/effects.js
         | 
| 214 | 
            +
            - test/dummy/public/javascripts/prototype.js
         | 
| 215 | 
            +
            - test/dummy/public/javascripts/rails.js
         | 
| 216 | 
            +
            - test/dummy/public/stylesheets/.gitkeep
         | 
| 217 | 
            +
            - test/dummy/script/rails
         | 
| 218 | 
            +
            - test/judge_test.rb
         | 
| 219 | 
            +
            - test/test_helper.rb
         | 
| 220 | 
            +
            has_rdoc: true
         | 
| 221 | 
            +
            homepage: http://github.com/joecorcoran/judge
         | 
| 222 | 
            +
            licenses: 
         | 
| 223 | 
            +
            - MIT
         | 
| 224 | 
            +
            post_install_message: 
         | 
| 225 | 
            +
            rdoc_options: []
         | 
| 226 | 
            +
             | 
| 227 | 
            +
            require_paths: 
         | 
| 228 | 
            +
            - lib
         | 
| 229 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         | 
| 230 | 
            +
              none: false
         | 
| 231 | 
            +
              requirements: 
         | 
| 232 | 
            +
              - - ">="
         | 
| 233 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 234 | 
            +
                  hash: -1767971986953238841
         | 
| 235 | 
            +
                  segments: 
         | 
| 236 | 
            +
                  - 0
         | 
| 237 | 
            +
                  version: "0"
         | 
| 238 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 239 | 
            +
              none: false
         | 
| 240 | 
            +
              requirements: 
         | 
| 241 | 
            +
              - - ">="
         | 
| 242 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 243 | 
            +
                  segments: 
         | 
| 244 | 
            +
                  - 0
         | 
| 245 | 
            +
                  version: "0"
         | 
| 246 | 
            +
            requirements: []
         | 
| 247 | 
            +
             | 
| 248 | 
            +
            rubyforge_project: 
         | 
| 249 | 
            +
            rubygems_version: 1.3.7
         | 
| 250 | 
            +
            signing_key: 
         | 
| 251 | 
            +
            specification_version: 3
         | 
| 252 | 
            +
            summary: Simple client-side ActiveModel::Validators
         | 
| 253 | 
            +
            test_files: 
         | 
| 254 | 
            +
            - spec/javascripts/support/jasmine_config.rb
         | 
| 255 | 
            +
            - spec/javascripts/support/jasmine_runner.rb
         | 
| 256 | 
            +
            - test/dummy/app/controllers/application_controller.rb
         | 
| 257 | 
            +
            - test/dummy/app/controllers/foos_controller.rb
         | 
| 258 | 
            +
            - test/dummy/app/helpers/application_helper.rb
         | 
| 259 | 
            +
            - test/dummy/app/models/foo.rb
         | 
| 260 | 
            +
            - test/dummy/config/application.rb
         | 
| 261 | 
            +
            - test/dummy/config/boot.rb
         | 
| 262 | 
            +
            - test/dummy/config/environment.rb
         | 
| 263 | 
            +
            - test/dummy/config/environments/development.rb
         | 
| 264 | 
            +
            - test/dummy/config/environments/production.rb
         | 
| 265 | 
            +
            - test/dummy/config/environments/test.rb
         | 
| 266 | 
            +
            - test/dummy/config/initializers/backtrace_silencers.rb
         | 
| 267 | 
            +
            - test/dummy/config/initializers/inflections.rb
         | 
| 268 | 
            +
            - test/dummy/config/initializers/mime_types.rb
         | 
| 269 | 
            +
            - test/dummy/config/initializers/secret_token.rb
         | 
| 270 | 
            +
            - test/dummy/config/initializers/session_store.rb
         | 
| 271 | 
            +
            - test/dummy/config/routes.rb
         | 
| 272 | 
            +
            - test/dummy/db/migrate/20110624115516_create_foos.rb
         | 
| 273 | 
            +
            - test/dummy/db/schema.rb
         | 
| 274 | 
            +
            - test/judge_test.rb
         | 
| 275 | 
            +
            - test/test_helper.rb
         |