formtastic_validation 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'formtastic'
4
+ gem 'validation_reflection'
5
+ gem 'rails'
6
+
7
+ group :development do
8
+ gem 'jeweler'
9
+ gem 'rspec'
10
+ gem 'nokogiri'
11
+ gem 'rspec-rails'
12
+ gem 'rspec_tag_matchers'
13
+ end
@@ -0,0 +1,106 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ abstract (1.0.0)
5
+ actionmailer (3.0.5)
6
+ actionpack (= 3.0.5)
7
+ mail (~> 2.2.15)
8
+ actionpack (3.0.5)
9
+ activemodel (= 3.0.5)
10
+ activesupport (= 3.0.5)
11
+ builder (~> 2.1.2)
12
+ erubis (~> 2.6.6)
13
+ i18n (~> 0.4)
14
+ rack (~> 1.2.1)
15
+ rack-mount (~> 0.6.13)
16
+ rack-test (~> 0.5.7)
17
+ tzinfo (~> 0.3.23)
18
+ activemodel (3.0.5)
19
+ activesupport (= 3.0.5)
20
+ builder (~> 2.1.2)
21
+ i18n (~> 0.4)
22
+ activerecord (3.0.5)
23
+ activemodel (= 3.0.5)
24
+ activesupport (= 3.0.5)
25
+ arel (~> 2.0.2)
26
+ tzinfo (~> 0.3.23)
27
+ activeresource (3.0.5)
28
+ activemodel (= 3.0.5)
29
+ activesupport (= 3.0.5)
30
+ activesupport (3.0.5)
31
+ arel (2.0.9)
32
+ builder (2.1.2)
33
+ diff-lcs (1.1.2)
34
+ erubis (2.6.6)
35
+ abstract (>= 1.0.0)
36
+ formtastic (1.2.3)
37
+ actionpack (>= 2.3.7)
38
+ activesupport (>= 2.3.7)
39
+ i18n (~> 0.4)
40
+ git (1.2.5)
41
+ i18n (0.5.0)
42
+ jeweler (1.5.2)
43
+ bundler (~> 1.0.0)
44
+ git (>= 1.2.5)
45
+ rake
46
+ mail (2.2.15)
47
+ activesupport (>= 2.3.6)
48
+ i18n (>= 0.4.0)
49
+ mime-types (~> 1.16)
50
+ treetop (~> 1.4.8)
51
+ mime-types (1.16)
52
+ nokogiri (1.4.4)
53
+ polyglot (0.3.1)
54
+ rack (1.2.1)
55
+ rack-mount (0.6.13)
56
+ rack (>= 1.0.0)
57
+ rack-test (0.5.7)
58
+ rack (>= 1.0)
59
+ rails (3.0.5)
60
+ actionmailer (= 3.0.5)
61
+ actionpack (= 3.0.5)
62
+ activerecord (= 3.0.5)
63
+ activeresource (= 3.0.5)
64
+ activesupport (= 3.0.5)
65
+ bundler (~> 1.0)
66
+ railties (= 3.0.5)
67
+ railties (3.0.5)
68
+ actionpack (= 3.0.5)
69
+ activesupport (= 3.0.5)
70
+ rake (>= 0.8.7)
71
+ thor (~> 0.14.4)
72
+ rake (0.8.7)
73
+ rspec (2.5.0)
74
+ rspec-core (~> 2.5.0)
75
+ rspec-expectations (~> 2.5.0)
76
+ rspec-mocks (~> 2.5.0)
77
+ rspec-core (2.5.1)
78
+ rspec-expectations (2.5.0)
79
+ diff-lcs (~> 1.1.2)
80
+ rspec-mocks (2.5.0)
81
+ rspec-rails (2.5.0)
82
+ actionpack (~> 3.0)
83
+ activesupport (~> 3.0)
84
+ railties (~> 3.0)
85
+ rspec (~> 2.5.0)
86
+ rspec_tag_matchers (1.0.0)
87
+ nokogiri (>= 1.4.0)
88
+ rspec-rails (>= 1.2.6)
89
+ thor (0.14.6)
90
+ treetop (1.4.9)
91
+ polyglot (>= 0.3.1)
92
+ tzinfo (0.3.24)
93
+ validation_reflection (1.0.0)
94
+
95
+ PLATFORMS
96
+ ruby
97
+
98
+ DEPENDENCIES
99
+ formtastic
100
+ jeweler
101
+ nokogiri
102
+ rails
103
+ rspec
104
+ rspec-rails
105
+ rspec_tag_matchers
106
+ validation_reflection
data/Rakefile CHANGED
@@ -1,44 +1,50 @@
1
1
  require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
2
10
  require 'rake'
3
11
 
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "formtastic_validation"
8
- gem.summary = %Q{Client side validation with formtastic}
9
- gem.description = %Q{A formtastic extension that does client side validation}
10
- gem.email = "zan@liangzan.net"
11
- gem.homepage = "http://github.com/liangzan/formtastic_validation"
12
- gem.authors = ["Wong Liang Zan"]
13
- gem.add_dependency "validation_reflection", "~> 1.0.0"
14
- gem.add_dependency "formtastic", "~> 1.1.0"
15
- gem.add_development_dependency "rspec", "= 1.3.0"
16
- gem.add_development_dependency "rspec-rails", "= 1.3.2"
17
- gem.add_development_dependency "rspec_tag_matchers", "= 1.0.0"
18
- gem.add_development_dependency "nokogiri", "= 1.4.2"
19
- gem.add_development_dependency "activesupport", "= 2.3.8"
20
- gem.add_development_dependency "actionpack", "= 2.3.8"
21
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
22
- end
23
- Jeweler::GemcutterTasks.new
24
- rescue LoadError
25
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "formtastic_validation"
16
+ gem.homepage = "http://github.com/liangzan/formtastic_validation"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{Formtastic extension that does form validation}
19
+ gem.description = %Q{Formtastic extension that does client side form validation}
20
+ gem.email = "zan@liangzan.net"
21
+ gem.authors = ["Wong Liang Zan"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
+ gem.add_dependency "validation_reflection", "~> 1.0.0"
26
+ gem.add_dependency "formtastic", "~> 1.2.0"
27
+ gem.add_development_dependency "rails", "~> 3.0.0"
28
+ gem.add_development_dependency "rspec", "~> 2.5.0"
29
+ gem.add_development_dependency "rspec-rails", "~> 2.5.0"
30
+ gem.add_development_dependency "rspec_tag_matchers", "= 1.0.0"
31
+ gem.add_development_dependency "nokogiri", "~> 1.4.4"
32
+ gem.add_development_dependency "activesupport", "~> 3.0.0"
33
+ gem.add_development_dependency "actionpack", "~> 3.0.0"
26
34
  end
35
+ Jeweler::RubygemsDotOrgTasks.new
27
36
 
28
- require 'spec/rake/spectask'
29
- Spec::Rake::SpecTask.new(:spec) do |spec|
30
- spec.libs << 'lib' << 'spec'
31
- spec.spec_files = FileList['spec/**/*_spec.rb']
37
+ require 'rspec/core'
38
+ require 'rspec/core/rake_task'
39
+ RSpec::Core::RakeTask.new(:spec) do |spec|
40
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
41
  end
33
42
 
34
- Spec::Rake::SpecTask.new(:rcov) do |spec|
35
- spec.libs << 'lib' << 'spec'
43
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
36
44
  spec.pattern = 'spec/**/*_spec.rb'
37
45
  spec.rcov = true
38
46
  end
39
47
 
40
- task :spec => :check_dependencies
41
-
42
48
  task :default => :spec
43
49
 
44
50
  require 'rake/rdoctask'
@@ -46,7 +52,7 @@ Rake::RDocTask.new do |rdoc|
46
52
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
47
53
 
48
54
  rdoc.rdoc_dir = 'rdoc'
49
- rdoc.title = "formtastic_validation #{version}"
55
+ rdoc.title = "test #{version}"
50
56
  rdoc.rdoc_files.include('README*')
51
57
  rdoc.rdoc_files.include('lib/**/*.rb')
52
58
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -1,52 +1,55 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{formtastic_validation}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wong Liang Zan"]
12
- s.date = %q{2010-11-08}
13
- s.description = %q{A formtastic extension that does client side validation}
12
+ s.date = %q{2011-03-17}
13
+ s.description = %q{Formtastic extension that does client side form validation}
14
14
  s.email = %q{zan@liangzan.net}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.textile"
17
+ "README.textile"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.textile",
24
- "Rakefile",
25
- "VERSION",
26
- "formtastic_validation.gemspec",
27
- "javascripts/README.textile",
28
- "javascripts/build/formtastic_validation-0.1.0.min.js",
29
- "javascripts/build/formtastic_validation-0.1.1.min.js",
30
- "javascripts/build/formtastic_validation-0.1.2.min.js",
31
- "javascripts/lib/livevalidation-1.3.min.js",
32
- "javascripts/src/formtastic_validation.js",
33
- "lib/formtastic_validation.rb",
34
- "lib/generators/formtastic_validation_generator.rb",
35
- "lib/generators/templates/config/initializers/formtastic_validation.rb",
36
- "lib/generators/templates/public/javascripts/formtastic_validation-0.1.3.min.js",
37
- "lib/generators/templates/public/javascripts/livevalidation-1.3.min.js",
38
- "spec/formtastic_validation_spec.rb",
39
- "spec/spec.opts",
40
- "spec/spec_helper.rb"
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE",
24
+ "README.textile",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "formtastic_validation.gemspec",
28
+ "javascripts/README.textile",
29
+ "javascripts/build/formtastic_validation-0.1.0.min.js",
30
+ "javascripts/build/formtastic_validation-0.1.1.min.js",
31
+ "javascripts/build/formtastic_validation-0.1.2.min.js",
32
+ "javascripts/build/formtastic_validation-0.1.3.min.js",
33
+ "javascripts/build/formtastic_validation-0.1.4.min.js",
34
+ "javascripts/lib/livevalidation-1.3.min.js",
35
+ "javascripts/src/formtastic_validation.js",
36
+ "lib/formtastic_validation.rb",
37
+ "lib/generators/formtastic_validation_generator.rb",
38
+ "lib/generators/templates/config/initializers/formtastic_validation.rb",
39
+ "lib/generators/templates/public/javascripts/formtastic_validation-0.1.4.min.js",
40
+ "lib/generators/templates/public/javascripts/livevalidation-1.3.min.js",
41
+ "spec/formtastic_validation_spec.rb",
42
+ "spec/spec.opts",
43
+ "spec/spec_helper.rb"
41
44
  ]
42
45
  s.homepage = %q{http://github.com/liangzan/formtastic_validation}
43
- s.rdoc_options = ["--charset=UTF-8"]
46
+ s.licenses = ["MIT"]
44
47
  s.require_paths = ["lib"]
45
48
  s.rubygems_version = %q{1.3.7}
46
- s.summary = %q{Client side validation with formtastic}
49
+ s.summary = %q{Formtastic extension that does form validation}
47
50
  s.test_files = [
48
51
  "spec/formtastic_validation_spec.rb",
49
- "spec/spec_helper.rb"
52
+ "spec/spec_helper.rb"
50
53
  ]
51
54
 
52
55
  if s.respond_to? :specification_version then
@@ -54,33 +57,60 @@ Gem::Specification.new do |s|
54
57
  s.specification_version = 3
55
58
 
56
59
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
60
+ s.add_runtime_dependency(%q<formtastic>, [">= 0"])
61
+ s.add_runtime_dependency(%q<validation_reflection>, [">= 0"])
62
+ s.add_runtime_dependency(%q<rails>, [">= 0"])
63
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
64
+ s.add_development_dependency(%q<rspec>, [">= 0"])
65
+ s.add_development_dependency(%q<nokogiri>, [">= 0"])
66
+ s.add_development_dependency(%q<rspec-rails>, [">= 0"])
67
+ s.add_development_dependency(%q<rspec_tag_matchers>, [">= 0"])
57
68
  s.add_runtime_dependency(%q<validation_reflection>, ["~> 1.0.0"])
58
- s.add_runtime_dependency(%q<formtastic>, ["~> 1.1.0"])
59
- s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
60
- s.add_development_dependency(%q<rspec-rails>, ["= 1.3.2"])
69
+ s.add_runtime_dependency(%q<formtastic>, ["~> 1.2.0"])
70
+ s.add_development_dependency(%q<rails>, ["~> 3.0.0"])
71
+ s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
72
+ s.add_development_dependency(%q<rspec-rails>, ["~> 2.5.0"])
61
73
  s.add_development_dependency(%q<rspec_tag_matchers>, ["= 1.0.0"])
62
- s.add_development_dependency(%q<nokogiri>, ["= 1.4.2"])
63
- s.add_development_dependency(%q<activesupport>, ["= 2.3.8"])
64
- s.add_development_dependency(%q<actionpack>, ["= 2.3.8"])
74
+ s.add_development_dependency(%q<nokogiri>, ["~> 1.4.4"])
75
+ s.add_development_dependency(%q<activesupport>, ["~> 3.0.0"])
76
+ s.add_development_dependency(%q<actionpack>, ["~> 3.0.0"])
65
77
  else
78
+ s.add_dependency(%q<formtastic>, [">= 0"])
79
+ s.add_dependency(%q<validation_reflection>, [">= 0"])
80
+ s.add_dependency(%q<rails>, [">= 0"])
81
+ s.add_dependency(%q<jeweler>, [">= 0"])
82
+ s.add_dependency(%q<rspec>, [">= 0"])
83
+ s.add_dependency(%q<nokogiri>, [">= 0"])
84
+ s.add_dependency(%q<rspec-rails>, [">= 0"])
85
+ s.add_dependency(%q<rspec_tag_matchers>, [">= 0"])
66
86
  s.add_dependency(%q<validation_reflection>, ["~> 1.0.0"])
67
- s.add_dependency(%q<formtastic>, ["~> 1.1.0"])
68
- s.add_dependency(%q<rspec>, ["= 1.3.0"])
69
- s.add_dependency(%q<rspec-rails>, ["= 1.3.2"])
87
+ s.add_dependency(%q<formtastic>, ["~> 1.2.0"])
88
+ s.add_dependency(%q<rails>, ["~> 3.0.0"])
89
+ s.add_dependency(%q<rspec>, ["~> 2.5.0"])
90
+ s.add_dependency(%q<rspec-rails>, ["~> 2.5.0"])
70
91
  s.add_dependency(%q<rspec_tag_matchers>, ["= 1.0.0"])
71
- s.add_dependency(%q<nokogiri>, ["= 1.4.2"])
72
- s.add_dependency(%q<activesupport>, ["= 2.3.8"])
73
- s.add_dependency(%q<actionpack>, ["= 2.3.8"])
92
+ s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
93
+ s.add_dependency(%q<activesupport>, ["~> 3.0.0"])
94
+ s.add_dependency(%q<actionpack>, ["~> 3.0.0"])
74
95
  end
75
96
  else
97
+ s.add_dependency(%q<formtastic>, [">= 0"])
98
+ s.add_dependency(%q<validation_reflection>, [">= 0"])
99
+ s.add_dependency(%q<rails>, [">= 0"])
100
+ s.add_dependency(%q<jeweler>, [">= 0"])
101
+ s.add_dependency(%q<rspec>, [">= 0"])
102
+ s.add_dependency(%q<nokogiri>, [">= 0"])
103
+ s.add_dependency(%q<rspec-rails>, [">= 0"])
104
+ s.add_dependency(%q<rspec_tag_matchers>, [">= 0"])
76
105
  s.add_dependency(%q<validation_reflection>, ["~> 1.0.0"])
77
- s.add_dependency(%q<formtastic>, ["~> 1.1.0"])
78
- s.add_dependency(%q<rspec>, ["= 1.3.0"])
79
- s.add_dependency(%q<rspec-rails>, ["= 1.3.2"])
106
+ s.add_dependency(%q<formtastic>, ["~> 1.2.0"])
107
+ s.add_dependency(%q<rails>, ["~> 3.0.0"])
108
+ s.add_dependency(%q<rspec>, ["~> 2.5.0"])
109
+ s.add_dependency(%q<rspec-rails>, ["~> 2.5.0"])
80
110
  s.add_dependency(%q<rspec_tag_matchers>, ["= 1.0.0"])
81
- s.add_dependency(%q<nokogiri>, ["= 1.4.2"])
82
- s.add_dependency(%q<activesupport>, ["= 2.3.8"])
83
- s.add_dependency(%q<actionpack>, ["= 2.3.8"])
111
+ s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
112
+ s.add_dependency(%q<activesupport>, ["~> 3.0.0"])
113
+ s.add_dependency(%q<actionpack>, ["~> 3.0.0"])
84
114
  end
85
115
  end
86
116
 
@@ -0,0 +1 @@
1
+ var FormtasticValidation=function(){this.VERSION="0.1.0";this.selectInputElements=function(){var d=document.getElementsByTagName("input");var e=new Array;for(var b=0;b<d.length;b++){var a=d[b];var c=a.getAttribute("type");if(this.isValidInputType(c)){e.push(d[b])}}return e};this.isValidInputType=function(a){switch(a){case"text":case"password":case"radio":case"checkbox":return true;default:return false}};this.getValidationAttributes=function(e){var b={};var f=e.attributes;var d,a;for(var c=0;c<f.length;c++){d=this.extractValidationKey(f[c].name);a=f[c].value;if(d!=null){b[d]=a}}return b};this.extractValidationKey=function(b){var c=/validation_(\w+)/;var a=b.match(c);return a!=null?a[1]:null};this.extractFormatRegex=function(b){var c=/^\/(.*)\/$/;var a=b.match(c);return a!=null?a[1]:null};this.confirmationID=function(b){var a=b.getAttribute("id");return a+"_confirmation"};this.bindInputElements=function(c,a,b){var e=new LiveValidation(c,{validMessage:b.valid_message});var f,d;switch(a){case"validates_acceptance_of":e.add(Validate.Acceptance,{failureMessage:b.message});break;case"validates_confirmation_of":d=new LiveValidation(this.confirmationID(c),{validMessage:b.valid_message});d.add(Validate.Confirmation,{match:c,failureMessage:b.message});break;case"validates_exclusion_of":e.add(Validate.Exclusion,{within:JSON.parse(b["in"]),allowNull:b.allow_nil,failureMessage:b.message});break;case"validates_format_of":f=this.extractFormatRegex(b["with"]);e.add(Validate.Format,{pattern:new RegExp(f),failureMessage:b.message});break;case"validates_inclusion_of":e.add(Validate.Inclusion,{within:JSON.parse(b["in"]),allowNull:b.allow_nil,failureMessage:b.message});break;case"validates_size_of":case"validates_length_of":e.add(Validate.Length,{is:b.is,minimum:b.minimum,maximum:b.maximum,wrongLengthMessage:b.wrong_length,tooShortMessage:b.too_short,tooLongMessage:b.too_long});break;case"validates_numericality_of":e.add(Validate.Numericality,{is:b.equal_to,minimum:b.greater_than_or_equal_to,maximum:b.less_than_or_equal_to,onlyinteger:b.only_integer,failureMessage:b.message});break;case"validates_presence_of":e.add(Validate.Presence,{failureMessage:b.message});break}}};FormtasticValidation.prototype.initialize=function(){var f=this.selectInputElements();var d,e,a;for(var c=0;c<f.length;c++){d=f[c].getAttribute("validation");if(d!=null){e=d.split(" ");for(var b=0;b<e.length;b++){a=this.getValidationAttributes(f[c]);this.bindInputElements(f[c],e[b],a)}}}};
@@ -1,6 +1,3 @@
1
- require 'rubygems'
2
- require 'active_support'
3
-
4
1
  module FormtasticValidation
5
2
 
6
3
  NAMESPACE = 'validation'
@@ -81,7 +78,11 @@ module FormtasticValidation
81
78
  def serialise_options(opts_hash)
82
79
  serialised_hash = Hash.new
83
80
  opts_hash.each do |key, value|
84
- serialised_value = value.class.eql?(String) ? value : value.to_json
81
+ serialised_value = case value.class.to_s
82
+ when "String" then value
83
+ when "Regexp" then value.inspect
84
+ else value.to_json
85
+ end
85
86
  serialised_hash[key] = serialised_value
86
87
  end
87
88
  serialised_hash
@@ -4,7 +4,7 @@ class FormtasticValidationGenerator < Rails::Generators::Base
4
4
  source_root File.expand_path("../templates", __FILE__)
5
5
 
6
6
  def install_formtastic_validations
7
- copy_file 'public/javascripts/formtastic_validation-0.1.3.min.js', 'public/javascripts/formtastic_validation-0.1.3.min.js'
7
+ copy_file 'public/javascripts/formtastic_validation-0.1.4.min.js', 'public/javascripts/formtastic_validation-0.1.4.min.js'
8
8
  copy_file 'public/javascripts/livevalidation-1.3.min.js', 'public/javascripts/livevalidation-1.3.min.js'
9
9
  copy_file 'config/initializers/formtastic_validation.rb', 'config/initializers/formtastic_validation.rb'
10
10
  end
@@ -0,0 +1 @@
1
+ var FormtasticValidation=function(){this.VERSION="0.1.0";this.selectInputElements=function(){var d=document.getElementsByTagName("input");var e=new Array;for(var b=0;b<d.length;b++){var a=d[b];var c=a.getAttribute("type");if(this.isValidInputType(c)){e.push(d[b])}}return e};this.isValidInputType=function(a){switch(a){case"text":case"password":case"radio":case"checkbox":return true;default:return false}};this.getValidationAttributes=function(e){var b={};var f=e.attributes;var d,a;for(var c=0;c<f.length;c++){d=this.extractValidationKey(f[c].name);a=f[c].value;if(d!=null){b[d]=a}}return b};this.extractValidationKey=function(b){var c=/validation_(\w+)/;var a=b.match(c);return a!=null?a[1]:null};this.extractFormatRegex=function(b){var c=/^\/(.*)\/$/;var a=b.match(c);return a!=null?a[1]:null};this.confirmationID=function(b){var a=b.getAttribute("id");return a+"_confirmation"};this.bindInputElements=function(c,a,b){var e=new LiveValidation(c,{validMessage:b.valid_message});var f,d;switch(a){case"validates_acceptance_of":e.add(Validate.Acceptance,{failureMessage:b.message});break;case"validates_confirmation_of":d=new LiveValidation(this.confirmationID(c),{validMessage:b.valid_message});d.add(Validate.Confirmation,{match:c,failureMessage:b.message});break;case"validates_exclusion_of":e.add(Validate.Exclusion,{within:JSON.parse(b["in"]),allowNull:b.allow_nil,failureMessage:b.message});break;case"validates_format_of":f=this.extractFormatRegex(b["with"]);e.add(Validate.Format,{pattern:new RegExp(f),failureMessage:b.message});break;case"validates_inclusion_of":e.add(Validate.Inclusion,{within:JSON.parse(b["in"]),allowNull:b.allow_nil,failureMessage:b.message});break;case"validates_size_of":case"validates_length_of":e.add(Validate.Length,{is:b.is,minimum:b.minimum,maximum:b.maximum,wrongLengthMessage:b.wrong_length,tooShortMessage:b.too_short,tooLongMessage:b.too_long});break;case"validates_numericality_of":e.add(Validate.Numericality,{is:b.equal_to,minimum:b.greater_than_or_equal_to,maximum:b.less_than_or_equal_to,onlyinteger:b.only_integer,failureMessage:b.message});break;case"validates_presence_of":e.add(Validate.Presence,{failureMessage:b.message});break}}};FormtasticValidation.prototype.initialize=function(){var f=this.selectInputElements();var d,e,a;for(var c=0;c<f.length;c++){d=f[c].getAttribute("validation");if(d!=null){e=d.split(" ");for(var b=0;b<e.length;b++){a=this.getValidationAttributes(f[c]);this.bindInputElements(f[c],e[b],a)}}}};
@@ -1,6 +1,7 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "FormtasticValidation#input" do
4
+
4
5
  include FormtasticValidationSpecHelper
5
6
 
6
7
  before do
@@ -15,51 +16,57 @@ describe "FormtasticValidation#input" do
15
16
 
16
17
  it 'should add a validation tag' do
17
18
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_whatever, :name => :name, :options => {})])
18
- semantic_form_for(@bob) do |builder|
19
+ form = semantic_form_for(@bob) do |builder|
19
20
  concat(builder.input(:name))
20
21
  end
22
+ output_buffer.concat(form)
21
23
  output_buffer.should have_tag('input[@validation="validates_whatever"]')
22
24
  end
23
25
 
24
26
  it 'should add a valid message tag' do
25
27
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_whatever, :name => :name, :options => {})])
26
- semantic_form_for(@bob) do |builder|
28
+ form = semantic_form_for(@bob) do |builder|
27
29
  concat(builder.input(:name))
28
30
  end
31
+ output_buffer.concat(form)
29
32
  output_buffer.should have_tag('input[@validation_valid_message="Thank you!"]')
30
33
  end
31
34
 
32
35
  it 'should allow changes to the valid message tag' do
33
36
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_whatever, :name => :name, :options => {})])
34
37
  FormtasticValidation.valid_message = "Its correct!"
35
- semantic_form_for(@bob) do |builder|
38
+ form = semantic_form_for(@bob) do |builder|
36
39
  concat(builder.input(:name))
37
40
  end
41
+ output_buffer.concat(form)
38
42
  output_buffer.should have_tag('input[@validation_valid_message="Its correct!"]')
39
43
  end
40
44
 
41
45
  it "should add multiple validation tags separated by space" do
42
46
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_whatever, :name => :name, :options => {}), mock('MacroReflection', :macro => :validates_anything, :name => :name, :options => {})])
43
- semantic_form_for(@bob) do |builder|
47
+ form = semantic_form_for(@bob) do |builder|
44
48
  concat(builder.input(:name))
45
49
  end
50
+ output_buffer.concat(form)
46
51
  output_buffer.should have_tag('input[@validation="validates_whatever validates_anything"]')
47
52
  end
48
53
 
49
54
  it 'should add a single option as tag' do
50
55
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_whatever, :name => :name, :options => {:one => 'one'})])
51
- semantic_form_for(@bob) do |builder|
56
+ form = semantic_form_for(@bob) do |builder|
52
57
  concat(builder.input(:name))
53
58
  end
59
+ output_buffer.concat(form)
54
60
  output_buffer.should have_tag('input[@validation="validates_whatever"]')
55
61
  output_buffer.should have_tag('input[@validation_one="one"]')
56
62
  end
57
63
 
58
64
  it "should add multiple options as separate tags" do
59
65
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_whatever, :name => :name, :options => {:one => 'one', :two => 'two'})])
60
- semantic_form_for(@bob) do |builder|
66
+ form = semantic_form_for(@bob) do |builder|
61
67
  concat(builder.input(:name))
62
68
  end
69
+ output_buffer.concat(form)
63
70
  output_buffer.should have_tag('input[@validation="validates_whatever"]')
64
71
  output_buffer.should have_tag('input[@validation_one="one"]')
65
72
  output_buffer.should have_tag('input[@validation_two="two"]')
@@ -67,9 +74,10 @@ describe "FormtasticValidation#input" do
67
74
 
68
75
  it "should include the input_html" do
69
76
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_whatever, :name => :name, :options => {:one => 'one', :two => 'two'})])
70
- semantic_form_for(@bob) do |builder|
77
+ form = semantic_form_for(@bob) do |builder|
71
78
  concat(builder.input(:name, :input_html => {:three => 'three'}))
72
79
  end
80
+ output_buffer.concat(form)
73
81
  output_buffer.should have_tag('input[@validation="validates_whatever"]')
74
82
  output_buffer.should have_tag('input[@validation_one="one"]')
75
83
  output_buffer.should have_tag('input[@validation_two="two"]')
@@ -81,27 +89,30 @@ describe "FormtasticValidation#input" do
81
89
  describe "validation options" do
82
90
  it "should serialise regex as json strings" do
83
91
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_format_of, :name => :name, :options => {:with => /^a garden$/})])
84
- semantic_form_for(@bob) do |builder|
92
+ form = semantic_form_for(@bob) do |builder|
85
93
  concat(builder.input(:name))
86
94
  end
95
+ output_buffer.concat(form)
87
96
  output_buffer.should have_tag('input[@validation="validates_format_of"]')
88
97
  output_buffer.should have_tag('input[@validation_with="/^a garden$/"]')
89
98
  end
90
99
 
91
100
  it "should serialise array as json strings" do
92
101
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_inclusion_of, :name => :name, :options => {:in => %w(one two three)})])
93
- semantic_form_for(@bob) do |builder|
102
+ form = semantic_form_for(@bob) do |builder|
94
103
  concat(builder.input(:name))
95
104
  end
105
+ output_buffer.concat(form)
96
106
  output_buffer.should have_tag('input[@validation="validates_inclusion_of"]')
97
107
  output_buffer.should have_tag(%\input[@validation_in='["one","two","three"]']\)
98
108
  end
99
109
 
100
110
  it "should serialise range as array" do
101
111
  @bob.class.should_receive(:reflect_on_validations_for).with(:name).any_number_of_times.and_return([mock('MacroReflection', :macro => :validates_inclusion_of, :name => :name, :options => {:in => 1..3})])
102
- semantic_form_for(@bob) do |builder|
112
+ form = semantic_form_for(@bob) do |builder|
103
113
  concat(builder.input(:name))
104
114
  end
115
+ output_buffer.concat(form)
105
116
  output_buffer.should have_tag('input[@validation="validates_inclusion_of"]')
106
117
  output_buffer.should have_tag(%\input[@validation_in='[1,2,3]']\)
107
118
  end
@@ -1,58 +1,91 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- require 'formtastic_validation'
4
3
 
5
4
  require 'rubygems'
6
- gem 'activesupport', '2.3.8'
7
- gem 'actionpack', '2.3.8'
5
+ require 'bundler'
6
+ begin
7
+ Bundler.setup(:default, :development)
8
+ rescue Bundler::BundlerError => e
9
+ $stderr.puts e.message
10
+ $stderr.puts "Run `bundle install` to install missing gems"
11
+ exit e.status_code
12
+ end
13
+
8
14
  require 'active_support'
9
- require 'active_record'
10
15
  require 'action_pack'
11
16
  require 'action_view'
12
17
  require 'action_controller'
13
18
 
14
- gem 'rspec', '>= 1.3.0'
15
- gem 'rspec-rails', '>= 1.3.2'
16
- gem 'nokogiri', '>= 1.4.2'
17
- gem 'rspec_tag_matchers', '>= 1.0.0'
18
- gem 'validation_reflection', '>=0.3.8'
19
- gem 'formtastic', '>=1.0.0'
19
+ require 'formtastic'
20
+ require 'formtastic_validation'
21
+
20
22
  require 'rspec_tag_matchers'
23
+ require 'action_controller/railtie'
24
+ require 'active_resource/railtie'
25
+ require 'active_model'
21
26
  require 'validation_reflection'
22
27
  require 'nokogiri'
23
- require 'rspec_tag_matchers'
24
- require 'formtastic'
25
28
 
26
- Spec::Runner.configure do |config|
29
+ module FormtasticTest
30
+ class Application < Rails::Application
31
+ # Configure the default encoding used in templates for Ruby 1.9.
32
+ config.encoding = "utf-8"
33
+ config.active_support.deprecation = :stderr
34
+ end
35
+ end
36
+ FormtasticTest::Application.initialize!
37
+
38
+ require 'rspec/rails'
39
+
40
+ RSpec.configure do |config|
27
41
  config.include(RspecTagMatchers)
42
+ config.mock_with :rspec
43
+ end
44
+
45
+ module ActionView
46
+ class OutputBuffer < Formtastic::Util.rails_safe_buffer_class
47
+ end
28
48
  end
29
49
 
30
50
  module FormtasticValidationSpecHelper
51
+ include ActionPack
52
+ include ActionView::Context if defined?(ActionView::Context)
53
+ include ActionController::RecordIdentifier
31
54
  include ActionView::Helpers::FormHelper
32
55
  include ActionView::Helpers::FormTagHelper
33
56
  include ActionView::Helpers::FormOptionsHelper
34
57
  include ActionView::Helpers::UrlHelper
35
58
  include ActionView::Helpers::TagHelper
36
59
  include ActionView::Helpers::TextHelper
37
- include ActionView::Helpers::ActiveRecordHelper
38
- include ActionView::Helpers::RecordIdentificationHelper
60
+ include ActionView::Helpers::ActiveRecordHelper if defined?(ActionView::Helpers::ActiveRecordHelper)
61
+ include ActionView::Helpers::ActiveModelHelper if defined?(ActionView::Helpers::ActiveModelHelper)
39
62
  include ActionView::Helpers::DateHelper
40
63
  include ActionView::Helpers::CaptureHelper
41
64
  include ActionView::Helpers::AssetTagHelper
42
65
  include ActiveSupport
43
- include ActionController::PolymorphicRoutes
66
+ include ActionController::PolymorphicRoutes if defined?(ActionController::PolymorphicRoutes)
44
67
 
45
68
  include Formtastic::SemanticFormHelper
46
69
  Formtastic::SemanticFormBuilder.class_eval { include FormtasticValidation }
47
70
 
48
- class ::User ; end
71
+ class ::User
72
+ extend ActiveModel::Naming if defined?(ActiveModel::Naming)
73
+ include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
74
+
75
+ def id
76
+ end
77
+
78
+ def persisted?
79
+ end
80
+ end
49
81
 
50
82
  def setup_mocks
51
83
  def user_path(o); "/users/1"; end
52
84
  def users_path; "/users"; end
53
85
  def new_user_path; "/users/new"; end
54
86
 
55
- @bob = User.new
87
+ @bob = ::User.new
88
+ @bob.stub!(:class).and_return(::User)
56
89
  @bob.stub!(:name).and_return('Bob')
57
90
  @bob.stub!(:email).and_return('bob@mail.com')
58
91
  @bob.stub!(:mobile).and_return('123456')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formtastic_validation
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wong Liang Zan
@@ -15,13 +15,125 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 +08:00
18
+ date: 2011-03-17 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
+ prerelease: false
23
+ name: formtastic
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ requirement: *id001
34
+ type: :runtime
35
+ - !ruby/object:Gem::Dependency
36
+ prerelease: false
22
37
  name: validation_reflection
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ requirement: *id002
48
+ type: :runtime
49
+ - !ruby/object:Gem::Dependency
50
+ prerelease: false
51
+ name: rails
52
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ requirement: *id003
62
+ type: :runtime
63
+ - !ruby/object:Gem::Dependency
64
+ prerelease: false
65
+ name: jeweler
66
+ version_requirements: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ requirement: *id004
76
+ type: :development
77
+ - !ruby/object:Gem::Dependency
78
+ prerelease: false
79
+ name: rspec
80
+ version_requirements: &id005 !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ hash: 3
86
+ segments:
87
+ - 0
88
+ version: "0"
89
+ requirement: *id005
90
+ type: :development
91
+ - !ruby/object:Gem::Dependency
92
+ prerelease: false
93
+ name: nokogiri
94
+ version_requirements: &id006 !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ hash: 3
100
+ segments:
101
+ - 0
102
+ version: "0"
103
+ requirement: *id006
104
+ type: :development
105
+ - !ruby/object:Gem::Dependency
23
106
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
107
+ name: rspec-rails
108
+ version_requirements: &id007 !ruby/object:Gem::Requirement
109
+ none: false
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ hash: 3
114
+ segments:
115
+ - 0
116
+ version: "0"
117
+ requirement: *id007
118
+ type: :development
119
+ - !ruby/object:Gem::Dependency
120
+ prerelease: false
121
+ name: rspec_tag_matchers
122
+ version_requirements: &id008 !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ hash: 3
128
+ segments:
129
+ - 0
130
+ version: "0"
131
+ requirement: *id008
132
+ type: :development
133
+ - !ruby/object:Gem::Dependency
134
+ prerelease: false
135
+ name: validation_reflection
136
+ version_requirements: &id009 !ruby/object:Gem::Requirement
25
137
  none: false
26
138
  requirements:
27
139
  - - ~>
@@ -32,60 +144,76 @@ dependencies:
32
144
  - 0
33
145
  - 0
34
146
  version: 1.0.0
147
+ requirement: *id009
35
148
  type: :runtime
36
- version_requirements: *id001
37
149
  - !ruby/object:Gem::Dependency
38
- name: formtastic
39
150
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
151
+ name: formtastic
152
+ version_requirements: &id010 !ruby/object:Gem::Requirement
41
153
  none: false
42
154
  requirements:
43
155
  - - ~>
44
156
  - !ruby/object:Gem::Version
45
- hash: 19
157
+ hash: 31
46
158
  segments:
47
159
  - 1
48
- - 1
160
+ - 2
49
161
  - 0
50
- version: 1.1.0
162
+ version: 1.2.0
163
+ requirement: *id010
51
164
  type: :runtime
52
- version_requirements: *id002
53
165
  - !ruby/object:Gem::Dependency
54
- name: rspec
55
166
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
167
+ name: rails
168
+ version_requirements: &id011 !ruby/object:Gem::Requirement
57
169
  none: false
58
170
  requirements:
59
- - - "="
171
+ - - ~>
60
172
  - !ruby/object:Gem::Version
61
- hash: 27
173
+ hash: 7
62
174
  segments:
63
- - 1
64
175
  - 3
65
176
  - 0
66
- version: 1.3.0
177
+ - 0
178
+ version: 3.0.0
179
+ requirement: *id011
67
180
  type: :development
68
- version_requirements: *id003
69
181
  - !ruby/object:Gem::Dependency
70
- name: rspec-rails
71
182
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
183
+ name: rspec
184
+ version_requirements: &id012 !ruby/object:Gem::Requirement
73
185
  none: false
74
186
  requirements:
75
- - - "="
187
+ - - ~>
76
188
  - !ruby/object:Gem::Version
77
- hash: 31
189
+ hash: 27
78
190
  segments:
79
- - 1
80
- - 3
81
191
  - 2
82
- version: 1.3.2
192
+ - 5
193
+ - 0
194
+ version: 2.5.0
195
+ requirement: *id012
83
196
  type: :development
84
- version_requirements: *id004
85
197
  - !ruby/object:Gem::Dependency
86
- name: rspec_tag_matchers
87
198
  prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
199
+ name: rspec-rails
200
+ version_requirements: &id013 !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ~>
204
+ - !ruby/object:Gem::Version
205
+ hash: 27
206
+ segments:
207
+ - 2
208
+ - 5
209
+ - 0
210
+ version: 2.5.0
211
+ requirement: *id013
212
+ type: :development
213
+ - !ruby/object:Gem::Dependency
214
+ prerelease: false
215
+ name: rspec_tag_matchers
216
+ version_requirements: &id014 !ruby/object:Gem::Requirement
89
217
  none: false
90
218
  requirements:
91
219
  - - "="
@@ -96,57 +224,57 @@ dependencies:
96
224
  - 0
97
225
  - 0
98
226
  version: 1.0.0
227
+ requirement: *id014
99
228
  type: :development
100
- version_requirements: *id005
101
229
  - !ruby/object:Gem::Dependency
102
- name: nokogiri
103
230
  prerelease: false
104
- requirement: &id006 !ruby/object:Gem::Requirement
231
+ name: nokogiri
232
+ version_requirements: &id015 !ruby/object:Gem::Requirement
105
233
  none: false
106
234
  requirements:
107
- - - "="
235
+ - - ~>
108
236
  - !ruby/object:Gem::Version
109
- hash: 3
237
+ hash: 15
110
238
  segments:
111
239
  - 1
112
240
  - 4
113
- - 2
114
- version: 1.4.2
241
+ - 4
242
+ version: 1.4.4
243
+ requirement: *id015
115
244
  type: :development
116
- version_requirements: *id006
117
245
  - !ruby/object:Gem::Dependency
118
- name: activesupport
119
246
  prerelease: false
120
- requirement: &id007 !ruby/object:Gem::Requirement
247
+ name: activesupport
248
+ version_requirements: &id016 !ruby/object:Gem::Requirement
121
249
  none: false
122
250
  requirements:
123
- - - "="
251
+ - - ~>
124
252
  - !ruby/object:Gem::Version
125
- hash: 19
253
+ hash: 7
126
254
  segments:
127
- - 2
128
255
  - 3
129
- - 8
130
- version: 2.3.8
256
+ - 0
257
+ - 0
258
+ version: 3.0.0
259
+ requirement: *id016
131
260
  type: :development
132
- version_requirements: *id007
133
261
  - !ruby/object:Gem::Dependency
134
- name: actionpack
135
262
  prerelease: false
136
- requirement: &id008 !ruby/object:Gem::Requirement
263
+ name: actionpack
264
+ version_requirements: &id017 !ruby/object:Gem::Requirement
137
265
  none: false
138
266
  requirements:
139
- - - "="
267
+ - - ~>
140
268
  - !ruby/object:Gem::Version
141
- hash: 19
269
+ hash: 7
142
270
  segments:
143
- - 2
144
271
  - 3
145
- - 8
146
- version: 2.3.8
272
+ - 0
273
+ - 0
274
+ version: 3.0.0
275
+ requirement: *id017
147
276
  type: :development
148
- version_requirements: *id008
149
- description: A formtastic extension that does client side validation
277
+ description: Formtastic extension that does client side form validation
150
278
  email: zan@liangzan.net
151
279
  executables: []
152
280
 
@@ -157,7 +285,8 @@ extra_rdoc_files:
157
285
  - README.textile
158
286
  files:
159
287
  - .document
160
- - .gitignore
288
+ - Gemfile
289
+ - Gemfile.lock
161
290
  - LICENSE
162
291
  - README.textile
163
292
  - Rakefile
@@ -167,23 +296,25 @@ files:
167
296
  - javascripts/build/formtastic_validation-0.1.0.min.js
168
297
  - javascripts/build/formtastic_validation-0.1.1.min.js
169
298
  - javascripts/build/formtastic_validation-0.1.2.min.js
299
+ - javascripts/build/formtastic_validation-0.1.3.min.js
300
+ - javascripts/build/formtastic_validation-0.1.4.min.js
170
301
  - javascripts/lib/livevalidation-1.3.min.js
171
302
  - javascripts/src/formtastic_validation.js
172
303
  - lib/formtastic_validation.rb
173
304
  - lib/generators/formtastic_validation_generator.rb
174
305
  - lib/generators/templates/config/initializers/formtastic_validation.rb
175
- - lib/generators/templates/public/javascripts/formtastic_validation-0.1.3.min.js
306
+ - lib/generators/templates/public/javascripts/formtastic_validation-0.1.4.min.js
176
307
  - lib/generators/templates/public/javascripts/livevalidation-1.3.min.js
177
308
  - spec/formtastic_validation_spec.rb
178
309
  - spec/spec.opts
179
310
  - spec/spec_helper.rb
180
311
  has_rdoc: true
181
312
  homepage: http://github.com/liangzan/formtastic_validation
182
- licenses: []
183
-
313
+ licenses:
314
+ - MIT
184
315
  post_install_message:
185
- rdoc_options:
186
- - --charset=UTF-8
316
+ rdoc_options: []
317
+
187
318
  require_paths:
188
319
  - lib
189
320
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -210,7 +341,7 @@ rubyforge_project:
210
341
  rubygems_version: 1.3.7
211
342
  signing_key:
212
343
  specification_version: 3
213
- summary: Client side validation with formtastic
344
+ summary: Formtastic extension that does form validation
214
345
  test_files:
215
346
  - spec/formtastic_validation_spec.rb
216
347
  - spec/spec_helper.rb
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC