judge-simple_form 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fe91ed5cedd668b8af7f67d959667de4f74b6acd
4
+ data.tar.gz: 05ea5ea478532775ea7496e363fcd86bd9de3f8d
5
+ SHA512:
6
+ metadata.gz: 6950934a9a69cea2504562eacf66ad80eaad931e06413122693be1b96eb34ac5fea2fe973622b22bb890d2c1c820c03c3ee9583ddbe46e01469a2631bd8cc94e
7
+ data.tar.gz: d401811399d62dc5a1c835bb2b78199e0ad087c967b133e6492497a581e0ef84531b4d57ff92b702da55befb14382eee04486f971dd3b5d036959e80972b7cab
data/README.md CHANGED
@@ -2,26 +2,36 @@
2
2
 
3
3
  [![Build status](https://secure.travis-ci.org/joecorcoran/judge-simple_form.png?branch=master)](http://travis-ci.org/joecorcoran/judge-simple_form)
4
4
 
5
- This is an adapter gem which allows you to use [Judge](http://judge.joecorcoran.co.uk) from within your [SimpleForm](http://github.com/plataformatec/simple_form) forms.
5
+ This is an adapter gem which allows you to use [Judge][judge] from within your [SimpleForm](http://github.com/plataformatec/simple_form) forms.
6
6
 
7
7
  ## Usage
8
8
 
9
9
  Do this in your Gemfile:
10
10
 
11
- gem 'judge-simple_form'
11
+ ```ruby
12
+ gem 'judge-simple_form'
13
+ ```
14
+
15
+ Remember to setup Judge in your SimpleForm initializer:
16
+
17
+ ```ruby
18
+ config.wrappers do |b|
19
+ b.use :judge
20
+ end
21
+ ```
12
22
 
13
23
  Then add <code>:validate => true</code> to the input options in your views. That's all.
14
24
 
15
- <%= simple_form_for(@user) do |f| %>
16
- <%= f.input :name, :validate => true %>
17
- <% end %>
25
+ ```erb
26
+ <%= simple_form_for(@user) do |f| %>
27
+ <%= f.input :name, :validate => true %>
28
+ <% end %>
29
+ ```
18
30
 
19
31
  ## Judge
20
32
 
21
- Judge is a client-side validation gem for Rails 3. You can read more about it at [judge.joecorcoran.co.uk](http://judge.joecorcoran.co.uk).
22
-
23
- ## License
33
+ [Judge][judge] is a client-side validation gem for Rails.
24
34
 
25
- Released under an MIT license (see LICENSE.txt).
35
+ http://blog.joecorcoran.co.uk
26
36
 
27
- http://blog.joecorcoran.co.uk
37
+ [judge]: https://github.com/joecorcoran/judge
@@ -1,24 +1,24 @@
1
1
  require 'judge' unless defined?(::Judge::VERSION)
2
2
  require 'simple_form' unless defined?(::SimpleForm)
3
3
 
4
- module Judge
5
- module SimpleForm
6
- module Inputs
4
+ module SimpleForm
5
+ module Components
6
+ module Judge
7
+ include ::Judge::Html
7
8
 
8
- include Judge::Html
9
-
10
- def self.included(base)
11
- base.send(:alias_method, :old_input_html_options, :input_html_options)
12
- base.send(:alias_method, :input_html_options, :new_input_html_options)
9
+ def judge
10
+ if has_judge?
11
+ input_html_options.deep_merge!(attrs_for(object, attribute_name))
12
+ end
13
+ nil
13
14
  end
14
15
 
15
- def new_input_html_options
16
- attrs = options[:validate].present? ? attrs_for(object, attribute_name) : {}
17
- attrs.merge(old_input_html_options)
16
+ def has_judge?
17
+ options[:validate] == true
18
18
  end
19
19
 
20
20
  end
21
21
  end
22
22
  end
23
23
 
24
- ::SimpleForm::Inputs::Base.send(:include, ::Judge::SimpleForm::Inputs)
24
+ ::SimpleForm::Inputs::Base.send(:include, ::SimpleForm::Components::Judge)
@@ -1,5 +1,5 @@
1
1
  module Judge
2
2
  module SimpleForm
3
- VERSION = "0.2.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judge-simple_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Joe Corcoran
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-27 00:00:00.000000000 Z
11
+ date: 2014-01-07 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: judge
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,115 +27,118 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: simple_form
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '2.0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '2.0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
- name: rails
56
+ name: sqlite3
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
69
- version: '3.2'
61
+ version: '1.3'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
77
- version: '3.2'
68
+ version: '1.3'
78
69
  - !ruby/object:Gem::Dependency
79
- name: sqlite3
70
+ name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
85
- version: 1.3.7
75
+ version: '2.13'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
93
- version: 1.3.7
82
+ version: '2.13'
94
83
  - !ruby/object:Gem::Dependency
95
- name: rspec
84
+ name: nokogiri
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
101
- version: '2.13'
89
+ version: '1.6'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
109
- version: '2.13'
96
+ version: '1.6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: appraisal
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '0.5'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '0.5'
110
111
  description: Easily add Judge client side validation to your SimpleForm forms.
111
112
  email: joe@tribesports.com
112
113
  executables: []
113
114
  extensions: []
114
115
  extra_rdoc_files: []
115
116
  files:
116
- - lib/judge/simple_form/version.rb
117
- - lib/judge/simple_form.rb
118
117
  - LICENSE.txt
119
118
  - README.md
119
+ - lib/judge/simple_form.rb
120
+ - lib/judge/simple_form/version.rb
120
121
  homepage: http://github.com/joecorcoran/judge-simple_form
121
122
  licenses: []
123
+ metadata: {}
122
124
  post_install_message:
123
125
  rdoc_options: []
124
126
  require_paths:
125
127
  - lib
126
128
  required_ruby_version: !ruby/object:Gem::Requirement
127
- none: false
128
129
  requirements:
129
- - - ! '>='
130
+ - - '>='
130
131
  - !ruby/object:Gem::Version
131
132
  version: '0'
132
133
  required_rubygems_version: !ruby/object:Gem::Requirement
133
- none: false
134
134
  requirements:
135
- - - ! '>='
135
+ - - '>='
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 1.8.25
140
+ rubygems_version: 2.2.0
141
141
  signing_key:
142
- specification_version: 3
142
+ specification_version: 4
143
143
  summary: SimpleForm adapter for Judge
144
144
  test_files: []