Skip to content

Commit 62a9f15

Browse files
committed
- update Gemfile
- rename method for better writing
1 parent b614bb8 commit 62a9f15

File tree

4 files changed

+44
-42
lines changed

4 files changed

+44
-42
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source "http://rubygems.org"
2-
gem "rails", ">= 3.0.0"
2+
gem "rails", "~> 3.0.0"
33
gem "rmagick"
44

55
group :development do

Gemfile.lock

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@ GEM
22
remote: http://rubygems.org/
33
specs:
44
abstract (1.0.0)
5-
actionmailer (3.0.4)
6-
actionpack (= 3.0.4)
5+
actionmailer (3.0.7)
6+
actionpack (= 3.0.7)
77
mail (~> 2.2.15)
8-
actionpack (3.0.4)
9-
activemodel (= 3.0.4)
10-
activesupport (= 3.0.4)
8+
actionpack (3.0.7)
9+
activemodel (= 3.0.7)
10+
activesupport (= 3.0.7)
1111
builder (~> 2.1.2)
1212
erubis (~> 2.6.6)
13-
i18n (~> 0.4)
13+
i18n (~> 0.5.0)
1414
rack (~> 1.2.1)
15-
rack-mount (~> 0.6.13)
15+
rack-mount (~> 0.6.14)
1616
rack-test (~> 0.5.7)
1717
tzinfo (~> 0.3.23)
18-
activemodel (3.0.4)
19-
activesupport (= 3.0.4)
18+
activemodel (3.0.7)
19+
activesupport (= 3.0.7)
2020
builder (~> 2.1.2)
21-
i18n (~> 0.4)
22-
activerecord (3.0.4)
23-
activemodel (= 3.0.4)
24-
activesupport (= 3.0.4)
21+
i18n (~> 0.5.0)
22+
activerecord (3.0.7)
23+
activemodel (= 3.0.7)
24+
activesupport (= 3.0.7)
2525
arel (~> 2.0.2)
2626
tzinfo (~> 0.3.23)
27-
activeresource (3.0.4)
28-
activemodel (= 3.0.4)
29-
activesupport (= 3.0.4)
30-
activesupport (3.0.4)
31-
arel (2.0.8)
27+
activeresource (3.0.7)
28+
activemodel (= 3.0.7)
29+
activesupport (= 3.0.7)
30+
activesupport (3.0.7)
31+
arel (2.0.10)
3232
builder (2.1.2)
3333
diff-lcs (1.1.2)
3434
erubis (2.6.6)
@@ -39,32 +39,32 @@ GEM
3939
bundler (~> 1.0.0)
4040
git (>= 1.2.5)
4141
rake
42-
mail (2.2.15)
42+
mail (2.2.19)
4343
activesupport (>= 2.3.6)
4444
i18n (>= 0.4.0)
4545
mime-types (~> 1.16)
4646
treetop (~> 1.4.8)
4747
mime-types (1.16)
4848
polyglot (0.3.1)
49-
rack (1.2.1)
50-
rack-mount (0.6.13)
49+
rack (1.2.3)
50+
rack-mount (0.6.14)
5151
rack (>= 1.0.0)
5252
rack-test (0.5.7)
5353
rack (>= 1.0)
54-
rails (3.0.4)
55-
actionmailer (= 3.0.4)
56-
actionpack (= 3.0.4)
57-
activerecord (= 3.0.4)
58-
activeresource (= 3.0.4)
59-
activesupport (= 3.0.4)
54+
rails (3.0.7)
55+
actionmailer (= 3.0.7)
56+
actionpack (= 3.0.7)
57+
activerecord (= 3.0.7)
58+
activeresource (= 3.0.7)
59+
activesupport (= 3.0.7)
6060
bundler (~> 1.0)
61-
railties (= 3.0.4)
62-
railties (3.0.4)
63-
actionpack (= 3.0.4)
64-
activesupport (= 3.0.4)
61+
railties (= 3.0.7)
62+
railties (3.0.7)
63+
actionpack (= 3.0.7)
64+
activesupport (= 3.0.7)
6565
rake (>= 0.8.7)
6666
thor (~> 0.14.4)
67-
rake (0.8.7)
67+
rake (0.9.2)
6868
rmagick (2.13.1)
6969
rspec (2.3.0)
7070
rspec-core (~> 2.3.0)
@@ -74,22 +74,22 @@ GEM
7474
rspec-expectations (2.3.0)
7575
diff-lcs (~> 1.1.2)
7676
rspec-mocks (2.3.0)
77-
simplecov (0.4.0)
78-
simplecov-html (~> 0.4.0)
79-
simplecov-html (0.4.3)
77+
simplecov (0.4.2)
78+
simplecov-html (~> 0.4.4)
79+
simplecov-html (0.4.5)
8080
thor (0.14.6)
8181
treetop (1.4.9)
8282
polyglot (>= 0.3.1)
83-
tzinfo (0.3.24)
84-
yard (0.6.4)
83+
tzinfo (0.3.27)
84+
yard (0.6.8)
8585

8686
PLATFORMS
8787
ruby
8888

8989
DEPENDENCIES
9090
bundler (~> 1.0.0)
9191
jeweler (~> 1.5.2)
92-
rails (>= 3.0.0)
92+
rails (~> 3.0.0)
9393
rmagick
9494
rspec (~> 2.3.0)
9595
simplecov (>= 0.3.8)

lib/easy_captcha/controller_helpers.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module ControllerHelpers
44

55
def self.included(base) #:nodoc:
66
base.class_eval do
7-
helper_method :valid_captcha?
7+
helper_method :valid_captcha?, :captcha_valid?
88
end
99
end
1010

@@ -46,10 +46,11 @@ def generate_captcha_code
4646
end
4747

4848
# validate given captcha code and re
49-
def valid_captcha?(code)
49+
def captcha_valid?(code)
5050
return false if session[:captcha].blank? or code.blank?
5151
session[:captcha].to_s.upcase == code.to_s.upcase
5252
end
53+
alias_method :valid_captcha?, :captcha_valid?
5354

5455
# reset the captcha code in session for security after each request
5556
def reset_last_captcha_code!

lib/easy_captcha/model_helpers.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ def captcha #:nodoc:
2020
end
2121

2222
# validate captcha
23-
def valid_captcha?
23+
def captcha_valid?
2424
errors.add(:captcha, :invalid) if @captcha.blank? or @captcha_verification.blank? or @captcha.to_s.upcase != @captcha_verification.to_s.upcase
2525
end
26+
alias_method :valid_captcha?, :captcha_valid?
2627
end
2728
end
2829
end

0 commit comments

Comments
 (0)