formkeeper 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module FormKeeper
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
data/lib/formkeeper.rb CHANGED
@@ -599,11 +599,14 @@ module FormKeeper
599
599
  @fields[name.to_sym] = Criteria::Field.new(criteria)
600
600
  end
601
601
 
602
- def checkbox(name, criteria)
602
+ def selection(name, criteria)
603
603
  raise ArgumentError.new unless criteria.kind_of?(Hash)
604
604
  @checkboxes[name.to_sym] = Criteria::Checkbox.new(criteria)
605
605
  end
606
606
 
607
+ # for backward-compatibility
608
+ alias_method :checkbox, :selection
609
+
607
610
  def combination(name, criteria)
608
611
  raise ArgumentError.new unless criteria.kind_of?(Hash)
609
612
  @combinations[name.to_sym] = Criteria::Combination.new(criteria)
@@ -80,7 +80,7 @@ describe FormKeeper::Validator do
80
80
  rule.filters :strip
81
81
  rule.field :username, :present => true, :length => 8..16
82
82
  rule.field :password, :present => true, :length => 8..16
83
- rule.checkbox :colors, :count => 1..2
83
+ rule.selection :colors, :count => 1..2
84
84
 
85
85
  params = {}
86
86
  params['username'] = ' hogehogefoo'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -70,7 +70,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
70
  version: '0'
71
71
  segments:
72
72
  - 0
73
- hash: -3327834832335453683
73
+ hash: 467354677147035923
74
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  segments:
81
81
  - 0
82
- hash: -3327834832335453683
82
+ hash: 467354677147035923
83
83
  requirements: []
84
84
  rubyforge_project:
85
85
  rubygems_version: 1.8.24