judge 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/.travis.yml +2 -1
- data/Gemfile +1 -10
- data/Rakefile +9 -44
- data/judge.gemspec +17 -164
- data/lib/generators/judge/templates/json2.js +46 -42
- data/lib/generators/judge/templates/judge.js +42 -41
- data/lib/generators/judge/templates/underscore.js +219 -97
- data/lib/judge.rb +6 -4
- data/lib/judge/form_builder.rb +75 -0
- data/lib/judge/{utils.rb → message_collection.rb} +45 -28
- data/lib/judge/validator.rb +21 -0
- data/lib/judge/validator_collection.rb +28 -0
- data/lib/judge/version.rb +3 -0
- data/spec/javascripts/JudgeSpec.js +25 -23
- data/test/expected_elements.rb +235 -0
- data/test/factories.rb +23 -0
- data/test/setup.rb +70 -0
- data/test/test_form_builder.rb +69 -0
- data/test/test_helper.rb +8 -20
- data/test/test_message_collection.rb +84 -0
- data/test/test_validator.rb +37 -0
- data/test/test_validator_collection.rb +19 -0
- metadata +46 -137
- data/.document +0 -5
- data/Gemfile.lock +0 -116
- data/VERSION +0 -1
- data/docs/docco.css +0 -196
- data/docs/judge.html +0 -280
- data/lib/judge/form.rb +0 -59
- data/test/dummy/Gemfile +0 -3
- data/test/dummy/Gemfile.lock +0 -75
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/controllers/foos_controller.rb +0 -11
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/models/city.rb +0 -5
- data/test/dummy/app/models/continent.rb +0 -4
- data/test/dummy/app/models/country.rb +0 -6
- data/test/dummy/app/models/fake.rb +0 -2
- data/test/dummy/app/models/foo.rb +0 -19
- data/test/dummy/app/views/foos/new.html.erb +0 -71
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -45
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -22
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -26
- data/test/dummy/config/environments/production.rb +0 -49
- data/test/dummy/config/environments/test.rb +0 -35
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/locales/en.yml +0 -12
- data/test/dummy/config/routes.rb +0 -3
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20110624115516_create_foos.rb +0 -26
- data/test/dummy/db/migrate/20110724201117_create_fake_collections.rb +0 -14
- data/test/dummy/db/migrate/20110724201548_rename_fake_collection_to_fake.rb +0 -9
- data/test/dummy/db/migrate/20110725082530_create_continent_country_and_city_tables.rb +0 -24
- data/test/dummy/db/schema.rb +0 -55
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/server.log +0 -0
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -26
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/javascripts/application.js +0 -2
- data/test/dummy/public/javascripts/controls.js +0 -965
- data/test/dummy/public/javascripts/dragdrop.js +0 -974
- data/test/dummy/public/javascripts/effects.js +0 -1123
- data/test/dummy/public/javascripts/prototype.js +0 -6001
- data/test/dummy/public/javascripts/rails.js +0 -175
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/judge_test.rb +0 -186
data/test/factories.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :user do
|
3
|
+
dob { Time.new(2011,11,5, 17,00,00) }
|
4
|
+
end
|
5
|
+
|
6
|
+
factory :team do
|
7
|
+
sequence(:name) {|n| "Team #{n}" }
|
8
|
+
end
|
9
|
+
|
10
|
+
factory :category do
|
11
|
+
sequence(:name) {|n| "Category #{n}" }
|
12
|
+
end
|
13
|
+
|
14
|
+
factory :sport do
|
15
|
+
sequence(:name) {|n| "Sport #{n}" }
|
16
|
+
category
|
17
|
+
end
|
18
|
+
|
19
|
+
factory :discipline do
|
20
|
+
sequence(:name) {|n| "Discipline #{n}" }
|
21
|
+
sport
|
22
|
+
end
|
23
|
+
end
|
data/test/setup.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# setup fake ActiveRecord class for tests
|
2
|
+
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
3
|
+
ActiveRecord::Schema.define(:version => 1) do
|
4
|
+
create_table :users do |t|
|
5
|
+
t.string :name
|
6
|
+
t.string :username
|
7
|
+
t.string :country
|
8
|
+
t.integer :age
|
9
|
+
t.text :bio
|
10
|
+
t.string :password
|
11
|
+
t.boolean :accepted
|
12
|
+
t.text :gender
|
13
|
+
t.date :dob
|
14
|
+
t.integer :team_id
|
15
|
+
t.string :time_zone
|
16
|
+
t.integer :discipline_id
|
17
|
+
end
|
18
|
+
create_table :teams do |t|
|
19
|
+
t.string :name
|
20
|
+
end
|
21
|
+
create_table :categories do |t|
|
22
|
+
t.string :name
|
23
|
+
end
|
24
|
+
create_table :sports do |t|
|
25
|
+
t.string :name
|
26
|
+
t.integer :category_id
|
27
|
+
end
|
28
|
+
create_table :disciplines do |t|
|
29
|
+
t.string :name
|
30
|
+
t.integer :sport_id
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class User < ActiveRecord::Base
|
35
|
+
belongs_to :team
|
36
|
+
|
37
|
+
validates :name, :presence => true
|
38
|
+
validates :username, :length => { :maximum => 10 }
|
39
|
+
validates :country, :format => { :with => /[A-Za-z]/, :allow_blank => true }
|
40
|
+
validates :age, :numericality => { :only_integer => true, :greater_than => 13 }
|
41
|
+
validates :bio, :presence => true
|
42
|
+
validates :password, :format => { :with => /.+/ }, :confirmation => true
|
43
|
+
validates :accepted, :acceptance => true
|
44
|
+
validates :gender, :inclusion => { :in => ["male", "female", "other", "withheld"] }
|
45
|
+
validates :dob, :presence => true
|
46
|
+
validates :team_id, :presence => true
|
47
|
+
validates :time_zone, :presence => true
|
48
|
+
validates :discipline_id, :presence => true
|
49
|
+
end
|
50
|
+
|
51
|
+
class Team < ActiveRecord::Base; end
|
52
|
+
|
53
|
+
class Category < ActiveRecord::Base
|
54
|
+
has_many :sports
|
55
|
+
end
|
56
|
+
class Sport < ActiveRecord::Base
|
57
|
+
belongs_to :category
|
58
|
+
has_many :disciplines
|
59
|
+
end
|
60
|
+
class Discipline < ActiveRecord::Base
|
61
|
+
belongs_to :sport
|
62
|
+
belongs_to :user
|
63
|
+
end
|
64
|
+
|
65
|
+
# hack to stop #url_for error
|
66
|
+
module ActionDispatch::Routing::PolymorphicRoutes
|
67
|
+
def polymorphic_path(record_or_hash_or_array, options = {})
|
68
|
+
""
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require "action_view/test_case"
|
2
|
+
require "html/document"
|
3
|
+
require "expected_elements"
|
4
|
+
|
5
|
+
class JudgeFormBuilderTest < ActionView::TestCase
|
6
|
+
|
7
|
+
include ExpectedElements
|
8
|
+
|
9
|
+
def test_text_field
|
10
|
+
assert_dom_equal expected_text_field, builder.text_field(:name, :validate => true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_text_area
|
14
|
+
assert_dom_equal expected_text_area, builder.text_area(:bio, :validate => true)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_password_field
|
18
|
+
assert_dom_equal expected_password_field, builder.password_field(:password, :validate => true)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_check_box
|
22
|
+
assert_dom_equal expected_check_box, builder.password_field(:accepted, :validate => true)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_radio_button
|
26
|
+
assert_dom_equal expected_radio_button, builder.radio_button(:gender, "female", :validate => true)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_select
|
30
|
+
assert_dom_equal expected_select, builder.select(:country, [["US", "US"], ["GB", "GB"]], :validate => true)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_collection_select
|
34
|
+
assert_dom_equal expected_collection_select, builder.collection_select(:team_id, FactoryGirl.create_list(:team, 5), :id, :name, :validate => true)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_grouped_collection_select
|
38
|
+
assert_dom_equal expected_grouped_collection_select, builder.grouped_collection_select(:discipline_id, categories, :sports, :name, :id, :name, :validate => true)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_date_select
|
42
|
+
assert_dom_equal expected_date_select, builder.date_select(:dob, :validate => true, :minute_step => 30)
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_datetime_select
|
46
|
+
assert_dom_equal expected_datetime_select, builder.datetime_select(:dob, :validate => true, :minute_step => 30)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_time_select
|
50
|
+
assert_dom_equal expected_time_select, builder.time_select(:dob, :validate => true, :minute_step => 30)
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_time_zone_select
|
54
|
+
assert builder.time_zone_select(:time_zone, ActiveSupport::TimeZone.us_zones, :include_blank => true, :validate => true), "time zone select not present"
|
55
|
+
end
|
56
|
+
|
57
|
+
def builder
|
58
|
+
Judge::FormBuilder.new(:user, FactoryGirl.build(:user), self, {}, nil)
|
59
|
+
end
|
60
|
+
|
61
|
+
def categories
|
62
|
+
category = FactoryGirl.build(:category)
|
63
|
+
sport = FactoryGirl.build(:sport)
|
64
|
+
sport.disciplines << FactoryGirl.build_list(:discipline, 3)
|
65
|
+
category.sports << sport
|
66
|
+
[category]
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,23 +1,11 @@
|
|
1
|
-
require "
|
2
|
-
require "bundler"
|
3
|
-
require "shoulda"
|
4
|
-
require "action_view"
|
5
|
-
require "active_support"
|
6
|
-
require "nokogiri"
|
7
|
-
require "json"
|
1
|
+
require "bundler/setup"
|
8
2
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
$stderr.puts e.message
|
13
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
14
|
-
exit e.status_code
|
3
|
+
# require stuff
|
4
|
+
%w{active_record action_view shoulda factory_girl}.each do |x|
|
5
|
+
require x
|
15
6
|
end
|
16
7
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
require "judge"
|
22
|
-
require "dummy/config/environment"
|
23
|
-
require "rails/test_help"
|
8
|
+
# require judge and test setup files
|
9
|
+
%w{judge setup factories}.each do |x|
|
10
|
+
require x
|
11
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
class JudgeMessageCollectionTest < Test::Unit::TestCase
|
2
|
+
|
3
|
+
context "Judge::MessageCollection" do
|
4
|
+
setup do
|
5
|
+
@user = FactoryGirl.build(:user)
|
6
|
+
end
|
7
|
+
|
8
|
+
should "have hash of messages in messages attr" do
|
9
|
+
amv = User.validators_on(:name).first
|
10
|
+
message_collection = Judge::MessageCollection.new(@user, :name, amv)
|
11
|
+
assert_kind_of Hash, message_collection.messages
|
12
|
+
end
|
13
|
+
|
14
|
+
should "have to_hash method which returns messages hash" do
|
15
|
+
amv = User.validators_on(:name).first
|
16
|
+
message_collection = Judge::MessageCollection.new(@user, :name, amv)
|
17
|
+
assert_respond_to message_collection, :to_hash
|
18
|
+
assert_kind_of Hash, message_collection.to_hash
|
19
|
+
end
|
20
|
+
|
21
|
+
context "#generate_base!" do
|
22
|
+
should "add correct base message to messages hash" do
|
23
|
+
amv = User.validators_on(:name).first
|
24
|
+
message_collection = Judge::MessageCollection.new(@user, :name, amv, :generate => false)
|
25
|
+
assert_equal 0, message_collection.to_hash.length
|
26
|
+
message_collection.send(:generate_base!)
|
27
|
+
assert message_collection.to_hash[:blank]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context "#generate_options!" do
|
32
|
+
should "add correct optional messages to messages hash when present (length)" do
|
33
|
+
amv = User.validators_on(:username).first
|
34
|
+
message_collection = Judge::MessageCollection.new(@user, :username, amv, :generate => false)
|
35
|
+
assert_equal 0, message_collection.to_hash.length
|
36
|
+
message_collection.send(:generate_options!)
|
37
|
+
assert message_collection.to_hash[:too_long]
|
38
|
+
end
|
39
|
+
|
40
|
+
should "add correct optional messages to messages hash when present (numericality)" do
|
41
|
+
amv = User.validators_on(:age).first
|
42
|
+
message_collection = Judge::MessageCollection.new(@user, :age, amv, :generate => false)
|
43
|
+
assert_equal 0, message_collection.to_hash.length
|
44
|
+
message_collection.send(:generate_options!)
|
45
|
+
assert message_collection.to_hash[:greater_than]
|
46
|
+
end
|
47
|
+
|
48
|
+
should "add nothing to messages hash when optional messages not present" do
|
49
|
+
amv = User.validators_on(:name).first
|
50
|
+
message_collection = Judge::MessageCollection.new(@user, :name, amv, :generate => false)
|
51
|
+
message_collection.send(:generate_options!)
|
52
|
+
assert_equal 0, message_collection.to_hash.length
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context "#generate_blank!" do
|
57
|
+
should "add blank message to messages hash if applicable" do
|
58
|
+
amv = User.validators_on(:username).first
|
59
|
+
message_collection = Judge::MessageCollection.new(@user, :username, amv, :generate => false)
|
60
|
+
assert_equal 0, message_collection.to_hash.length
|
61
|
+
message_collection.send(:generate_blank!)
|
62
|
+
assert message_collection.to_hash[:blank]
|
63
|
+
end
|
64
|
+
|
65
|
+
should "not add blank message to messages hash if allow_blank is true" do
|
66
|
+
amv = User.validators_on(:country).first
|
67
|
+
message_collection = Judge::MessageCollection.new(@user, :country, amv, :generate => false)
|
68
|
+
message_collection.send(:generate_blank!)
|
69
|
+
assert_equal 0, message_collection.to_hash.length
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context "#generate_integer!" do
|
74
|
+
should "add not_an_integer message to messages hash if only_integer is true" do
|
75
|
+
amv = User.validators_on(:age).first
|
76
|
+
message_collection = Judge::MessageCollection.new(@user, :age, amv, :generate => false)
|
77
|
+
assert_equal 0, message_collection.to_hash.length
|
78
|
+
message_collection.send(:generate_integer!)
|
79
|
+
assert message_collection.to_hash[:not_an_integer]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class JudgeValidatorTest < Test::Unit::TestCase
|
2
|
+
|
3
|
+
context "Judge::Validator" do
|
4
|
+
setup do
|
5
|
+
user = FactoryGirl.build(:user)
|
6
|
+
amv = User.validators_on(:name).first
|
7
|
+
@validator = Judge::Validator.new(amv, :name, Judge::MessageCollection.new(user, :name, amv))
|
8
|
+
end
|
9
|
+
|
10
|
+
should "have an original validator in validator attr" do
|
11
|
+
assert_instance_of ActiveModel::Validations::PresenceValidator, @validator.active_model_validator
|
12
|
+
end
|
13
|
+
|
14
|
+
should "have correct kind attr" do
|
15
|
+
assert_equal :presence, @validator.kind
|
16
|
+
end
|
17
|
+
|
18
|
+
should "have hash in options attr" do
|
19
|
+
assert_kind_of Hash, @validator.options
|
20
|
+
end
|
21
|
+
|
22
|
+
should "have Judge::MessageCollection in messages attr" do
|
23
|
+
assert_instance_of Judge::MessageCollection, @validator.messages
|
24
|
+
end
|
25
|
+
|
26
|
+
context "to_hash" do
|
27
|
+
should "convert to hash with correct properties" do
|
28
|
+
hash = @validator.to_hash
|
29
|
+
assert_kind_of Hash, hash
|
30
|
+
assert_kind_of Symbol, hash[:kind]
|
31
|
+
assert_kind_of Hash, hash[:options]
|
32
|
+
assert_kind_of Hash, hash[:messages]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class JudgeValidatorCollection < Test::Unit::TestCase
|
2
|
+
|
3
|
+
context "Judge::ValidatorCollection" do
|
4
|
+
setup do
|
5
|
+
user = FactoryGirl.build(:user)
|
6
|
+
@validator_collection = Judge::ValidatorCollection.new(user, :name)
|
7
|
+
end
|
8
|
+
|
9
|
+
should "contain validators" do
|
10
|
+
assert_kind_of Array, @validator_collection.validators
|
11
|
+
assert_instance_of Judge::Validator, @validator_collection.validators.first
|
12
|
+
end
|
13
|
+
|
14
|
+
should "convert to json correctly" do
|
15
|
+
assert_kind_of String, @validator_collection.to_json
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: judge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,34 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-14 00:00:00.000000000 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: bundler
|
17
|
-
requirement: &2168570340 !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
|
-
requirements:
|
20
|
-
- - ~>
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.18
|
23
|
-
type: :development
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: *2168570340
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: jeweler
|
28
|
-
requirement: &2168569740 !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.5.2
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: *2168569740
|
37
15
|
- !ruby/object:Gem::Dependency
|
38
16
|
name: jasmine
|
39
|
-
requirement: &
|
17
|
+
requirement: &2157289920 !ruby/object:Gem::Requirement
|
40
18
|
none: false
|
41
19
|
requirements:
|
42
20
|
- - ~>
|
@@ -44,10 +22,10 @@ dependencies:
|
|
44
22
|
version: 1.0.2
|
45
23
|
type: :development
|
46
24
|
prerelease: false
|
47
|
-
version_requirements: *
|
25
|
+
version_requirements: *2157289920
|
48
26
|
- !ruby/object:Gem::Dependency
|
49
27
|
name: rails
|
50
|
-
requirement: &
|
28
|
+
requirement: &2157289420 !ruby/object:Gem::Requirement
|
51
29
|
none: false
|
52
30
|
requirements:
|
53
31
|
- - ~>
|
@@ -55,10 +33,10 @@ dependencies:
|
|
55
33
|
version: 3.0.10
|
56
34
|
type: :development
|
57
35
|
prerelease: false
|
58
|
-
version_requirements: *
|
36
|
+
version_requirements: *2157289420
|
59
37
|
- !ruby/object:Gem::Dependency
|
60
38
|
name: shoulda
|
61
|
-
requirement: &
|
39
|
+
requirement: &2157288960 !ruby/object:Gem::Requirement
|
62
40
|
none: false
|
63
41
|
requirements:
|
64
42
|
- - ~>
|
@@ -66,10 +44,10 @@ dependencies:
|
|
66
44
|
version: 2.11.3
|
67
45
|
type: :development
|
68
46
|
prerelease: false
|
69
|
-
version_requirements: *
|
47
|
+
version_requirements: *2157288960
|
70
48
|
- !ruby/object:Gem::Dependency
|
71
49
|
name: sqlite3-ruby
|
72
|
-
requirement: &
|
50
|
+
requirement: &2157288500 !ruby/object:Gem::Requirement
|
73
51
|
none: false
|
74
52
|
requirements:
|
75
53
|
- - ~>
|
@@ -77,55 +55,41 @@ dependencies:
|
|
77
55
|
version: 1.3.2
|
78
56
|
type: :development
|
79
57
|
prerelease: false
|
80
|
-
version_requirements: *
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: nokogiri
|
83
|
-
requirement: &2168530420 !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
|
-
requirements:
|
86
|
-
- - ~>
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: 1.4.7
|
89
|
-
type: :development
|
90
|
-
prerelease: false
|
91
|
-
version_requirements: *2168530420
|
58
|
+
version_requirements: *2157288500
|
92
59
|
- !ruby/object:Gem::Dependency
|
93
|
-
name:
|
94
|
-
requirement: &
|
60
|
+
name: factory_girl
|
61
|
+
requirement: &2157309780 !ruby/object:Gem::Requirement
|
95
62
|
none: false
|
96
63
|
requirements:
|
97
64
|
- - ~>
|
98
65
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
66
|
+
version: 2.2.0
|
100
67
|
type: :development
|
101
68
|
prerelease: false
|
102
|
-
version_requirements: *
|
103
|
-
description: Validate forms
|
69
|
+
version_requirements: *2157309780
|
70
|
+
description: Validate forms on the client side, cleanly
|
104
71
|
email: joe@tribesports.com
|
105
72
|
executables: []
|
106
73
|
extensions: []
|
107
|
-
extra_rdoc_files:
|
108
|
-
- LICENSE.txt
|
109
|
-
- README.md
|
74
|
+
extra_rdoc_files: []
|
110
75
|
files:
|
111
|
-
- .
|
76
|
+
- .gitignore
|
112
77
|
- .travis.yml
|
113
78
|
- Gemfile
|
114
|
-
- Gemfile.lock
|
115
79
|
- LICENSE.txt
|
116
80
|
- README.md
|
117
81
|
- Rakefile
|
118
|
-
- VERSION
|
119
|
-
- docs/docco.css
|
120
|
-
- docs/judge.html
|
121
82
|
- judge.gemspec
|
122
83
|
- lib/generators/judge/judge_generator.rb
|
123
84
|
- lib/generators/judge/templates/json2.js
|
124
85
|
- lib/generators/judge/templates/judge.js
|
125
86
|
- lib/generators/judge/templates/underscore.js
|
126
87
|
- lib/judge.rb
|
127
|
-
- lib/judge/
|
128
|
-
- lib/judge/
|
88
|
+
- lib/judge/form_builder.rb
|
89
|
+
- lib/judge/message_collection.rb
|
90
|
+
- lib/judge/validator.rb
|
91
|
+
- lib/judge/validator_collection.rb
|
92
|
+
- lib/judge/version.rb
|
129
93
|
- lib/tasks/js_tests.rake
|
130
94
|
- spec/javascripts/JudgeSpec.js
|
131
95
|
- spec/javascripts/fixtures/form.html
|
@@ -138,56 +102,14 @@ files:
|
|
138
102
|
- spec/javascripts/support/jasmine_config.rb
|
139
103
|
- spec/javascripts/support/jasmine_runner.rb
|
140
104
|
- spec/javascripts/support/phantomRunner.js
|
141
|
-
- test/
|
142
|
-
- test/
|
143
|
-
- test/
|
144
|
-
- test/
|
145
|
-
- test/dummy/app/controllers/foos_controller.rb
|
146
|
-
- test/dummy/app/helpers/application_helper.rb
|
147
|
-
- test/dummy/app/models/city.rb
|
148
|
-
- test/dummy/app/models/continent.rb
|
149
|
-
- test/dummy/app/models/country.rb
|
150
|
-
- test/dummy/app/models/fake.rb
|
151
|
-
- test/dummy/app/models/foo.rb
|
152
|
-
- test/dummy/app/views/foos/new.html.erb
|
153
|
-
- test/dummy/app/views/layouts/application.html.erb
|
154
|
-
- test/dummy/config.ru
|
155
|
-
- test/dummy/config/application.rb
|
156
|
-
- test/dummy/config/boot.rb
|
157
|
-
- test/dummy/config/database.yml
|
158
|
-
- test/dummy/config/environment.rb
|
159
|
-
- test/dummy/config/environments/development.rb
|
160
|
-
- test/dummy/config/environments/production.rb
|
161
|
-
- test/dummy/config/environments/test.rb
|
162
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
163
|
-
- test/dummy/config/initializers/inflections.rb
|
164
|
-
- test/dummy/config/initializers/mime_types.rb
|
165
|
-
- test/dummy/config/initializers/secret_token.rb
|
166
|
-
- test/dummy/config/initializers/session_store.rb
|
167
|
-
- test/dummy/config/locales/en.yml
|
168
|
-
- test/dummy/config/routes.rb
|
169
|
-
- test/dummy/db/development.sqlite3
|
170
|
-
- test/dummy/db/migrate/20110624115516_create_foos.rb
|
171
|
-
- test/dummy/db/migrate/20110724201117_create_fake_collections.rb
|
172
|
-
- test/dummy/db/migrate/20110724201548_rename_fake_collection_to_fake.rb
|
173
|
-
- test/dummy/db/migrate/20110725082530_create_continent_country_and_city_tables.rb
|
174
|
-
- test/dummy/db/schema.rb
|
175
|
-
- test/dummy/db/test.sqlite3
|
176
|
-
- test/dummy/log/server.log
|
177
|
-
- test/dummy/public/404.html
|
178
|
-
- test/dummy/public/422.html
|
179
|
-
- test/dummy/public/500.html
|
180
|
-
- test/dummy/public/favicon.ico
|
181
|
-
- test/dummy/public/javascripts/application.js
|
182
|
-
- test/dummy/public/javascripts/controls.js
|
183
|
-
- test/dummy/public/javascripts/dragdrop.js
|
184
|
-
- test/dummy/public/javascripts/effects.js
|
185
|
-
- test/dummy/public/javascripts/prototype.js
|
186
|
-
- test/dummy/public/javascripts/rails.js
|
187
|
-
- test/dummy/public/stylesheets/.gitkeep
|
188
|
-
- test/dummy/script/rails
|
189
|
-
- test/judge_test.rb
|
105
|
+
- test/expected_elements.rb
|
106
|
+
- test/factories.rb
|
107
|
+
- test/setup.rb
|
108
|
+
- test/test_form_builder.rb
|
190
109
|
- test/test_helper.rb
|
110
|
+
- test/test_message_collection.rb
|
111
|
+
- test/test_validator.rb
|
112
|
+
- test/test_validator_collection.rb
|
191
113
|
has_rdoc: true
|
192
114
|
homepage: http://github.com/joecorcoran/judge
|
193
115
|
licenses:
|
@@ -202,9 +124,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
124
|
- - ! '>='
|
203
125
|
- !ruby/object:Gem::Version
|
204
126
|
version: '0'
|
205
|
-
segments:
|
206
|
-
- 0
|
207
|
-
hash: 780299096256091398
|
208
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
128
|
none: false
|
210
129
|
requirements:
|
@@ -216,34 +135,24 @@ rubyforge_project:
|
|
216
135
|
rubygems_version: 1.6.2
|
217
136
|
signing_key:
|
218
137
|
specification_version: 3
|
219
|
-
summary: Simple client
|
138
|
+
summary: Simple client side ActiveModel::Validators
|
220
139
|
test_files:
|
140
|
+
- spec/javascripts/JudgeSpec.js
|
141
|
+
- spec/javascripts/fixtures/form.html
|
142
|
+
- spec/javascripts/helpers/customMatchers.js
|
143
|
+
- spec/javascripts/helpers/jasmine-jquery.js
|
144
|
+
- spec/javascripts/helpers/jquery-1.5.1.min.js
|
145
|
+
- spec/javascripts/helpers/json2.js
|
146
|
+
- spec/javascripts/helpers/underscore.js
|
147
|
+
- spec/javascripts/support/jasmine.yml
|
221
148
|
- spec/javascripts/support/jasmine_config.rb
|
222
149
|
- spec/javascripts/support/jasmine_runner.rb
|
223
|
-
-
|
224
|
-
- test/
|
225
|
-
- test/
|
226
|
-
- test/
|
227
|
-
- test/
|
228
|
-
- test/dummy/app/models/country.rb
|
229
|
-
- test/dummy/app/models/fake.rb
|
230
|
-
- test/dummy/app/models/foo.rb
|
231
|
-
- test/dummy/config/application.rb
|
232
|
-
- test/dummy/config/boot.rb
|
233
|
-
- test/dummy/config/environment.rb
|
234
|
-
- test/dummy/config/environments/development.rb
|
235
|
-
- test/dummy/config/environments/production.rb
|
236
|
-
- test/dummy/config/environments/test.rb
|
237
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
238
|
-
- test/dummy/config/initializers/inflections.rb
|
239
|
-
- test/dummy/config/initializers/mime_types.rb
|
240
|
-
- test/dummy/config/initializers/secret_token.rb
|
241
|
-
- test/dummy/config/initializers/session_store.rb
|
242
|
-
- test/dummy/config/routes.rb
|
243
|
-
- test/dummy/db/migrate/20110624115516_create_foos.rb
|
244
|
-
- test/dummy/db/migrate/20110724201117_create_fake_collections.rb
|
245
|
-
- test/dummy/db/migrate/20110724201548_rename_fake_collection_to_fake.rb
|
246
|
-
- test/dummy/db/migrate/20110725082530_create_continent_country_and_city_tables.rb
|
247
|
-
- test/dummy/db/schema.rb
|
248
|
-
- test/judge_test.rb
|
150
|
+
- spec/javascripts/support/phantomRunner.js
|
151
|
+
- test/expected_elements.rb
|
152
|
+
- test/factories.rb
|
153
|
+
- test/setup.rb
|
154
|
+
- test/test_form_builder.rb
|
249
155
|
- test/test_helper.rb
|
156
|
+
- test/test_message_collection.rb
|
157
|
+
- test/test_validator.rb
|
158
|
+
- test/test_validator_collection.rb
|