easy_captcha 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d4b4cd64f6afe57557da86b631154a0b18be4cd8
4
+ data.tar.gz: 0e70999850af752841bd0f697d1fe5220c0f5031
5
+ SHA512:
6
+ metadata.gz: 84896042be3aafd978e24755cbf0183ebc33bb608d9ef9774c9d984a6251500ad4a883519a8948f01feb5c14f910b19b7b1d76292b0e533a23f932beeecc8469
7
+ data.tar.gz: 540b371f38cc1f89d2712d5c811d8e625dd2ed726d4d718f0250ea97f5a324f73c0624ec69b0f786ebb6d785e696da37a5862959f679497c93d6c665db713069
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- easy_captcha (0.6.3)
4
+ easy_captcha (0.6.4)
5
5
  bundler (>= 1.1.0)
6
6
  rails (>= 3.0.0)
7
7
  rmagick (>= 2.13.1)
@@ -12,101 +12,95 @@ PATH
12
12
  GEM
13
13
  remote: http://rubygems.org/
14
14
  specs:
15
- actionmailer (3.2.12)
16
- actionpack (= 3.2.12)
17
- mail (~> 2.4.4)
18
- actionpack (3.2.12)
19
- activemodel (= 3.2.12)
20
- activesupport (= 3.2.12)
21
- builder (~> 3.0.0)
15
+ actionmailer (4.0.0)
16
+ actionpack (= 4.0.0)
17
+ mail (~> 2.5.3)
18
+ actionpack (4.0.0)
19
+ activesupport (= 4.0.0)
20
+ builder (~> 3.1.0)
22
21
  erubis (~> 2.7.0)
23
- journey (~> 1.0.4)
24
- rack (~> 1.4.5)
25
- rack-cache (~> 1.2)
26
- rack-test (~> 0.6.1)
27
- sprockets (~> 2.2.1)
28
- activemodel (3.2.12)
29
- activesupport (= 3.2.12)
30
- builder (~> 3.0.0)
31
- activerecord (3.2.12)
32
- activemodel (= 3.2.12)
33
- activesupport (= 3.2.12)
34
- arel (~> 3.0.2)
35
- tzinfo (~> 0.3.29)
36
- activeresource (3.2.12)
37
- activemodel (= 3.2.12)
38
- activesupport (= 3.2.12)
39
- activesupport (3.2.12)
40
- i18n (~> 0.6)
41
- multi_json (~> 1.0)
42
- arel (3.0.2)
43
- builder (3.0.4)
44
- diff-lcs (1.2.1)
22
+ rack (~> 1.5.2)
23
+ rack-test (~> 0.6.2)
24
+ activemodel (4.0.0)
25
+ activesupport (= 4.0.0)
26
+ builder (~> 3.1.0)
27
+ activerecord (4.0.0)
28
+ activemodel (= 4.0.0)
29
+ activerecord-deprecated_finders (~> 1.0.2)
30
+ activesupport (= 4.0.0)
31
+ arel (~> 4.0.0)
32
+ activerecord-deprecated_finders (1.0.3)
33
+ activesupport (4.0.0)
34
+ i18n (~> 0.6, >= 0.6.4)
35
+ minitest (~> 4.2)
36
+ multi_json (~> 1.3)
37
+ thread_safe (~> 0.1)
38
+ tzinfo (~> 0.3.37)
39
+ arel (4.0.0)
40
+ atomic (1.1.10)
41
+ builder (3.1.4)
42
+ diff-lcs (1.2.4)
45
43
  erubis (2.7.0)
46
- hike (1.2.1)
47
- i18n (0.6.2)
48
- journey (1.0.4)
49
- json (1.7.7)
50
- mail (2.4.4)
51
- i18n (>= 0.4.0)
44
+ hike (1.2.3)
45
+ i18n (0.6.4)
46
+ mail (2.5.4)
52
47
  mime-types (~> 1.16)
53
48
  treetop (~> 1.4.8)
54
- mime-types (1.21)
55
- multi_json (1.6.1)
49
+ mime-types (1.23)
50
+ minitest (4.7.5)
51
+ multi_json (1.7.7)
56
52
  polyglot (0.3.3)
57
- rack (1.4.5)
58
- rack-cache (1.2)
59
- rack (>= 0.4)
60
- rack-ssl (1.3.3)
61
- rack
53
+ rack (1.5.2)
62
54
  rack-test (0.6.2)
63
55
  rack (>= 1.0)
64
- rails (3.2.12)
65
- actionmailer (= 3.2.12)
66
- actionpack (= 3.2.12)
67
- activerecord (= 3.2.12)
68
- activeresource (= 3.2.12)
69
- activesupport (= 3.2.12)
70
- bundler (~> 1.0)
71
- railties (= 3.2.12)
72
- railties (3.2.12)
73
- actionpack (= 3.2.12)
74
- activesupport (= 3.2.12)
75
- rack-ssl (~> 1.3.2)
56
+ rails (4.0.0)
57
+ actionmailer (= 4.0.0)
58
+ actionpack (= 4.0.0)
59
+ activerecord (= 4.0.0)
60
+ activesupport (= 4.0.0)
61
+ bundler (>= 1.3.0, < 2.0)
62
+ railties (= 4.0.0)
63
+ sprockets-rails (~> 2.0.0)
64
+ railties (4.0.0)
65
+ actionpack (= 4.0.0)
66
+ activesupport (= 4.0.0)
76
67
  rake (>= 0.8.7)
77
- rdoc (~> 3.4)
78
- thor (>= 0.14.6, < 2.0)
79
- rake (10.0.3)
80
- rdoc (3.12.2)
81
- json (~> 1.4)
68
+ thor (>= 0.18.1, < 2.0)
69
+ rake (10.1.0)
82
70
  rmagick (2.13.2)
83
- rspec-core (2.13.0)
84
- rspec-expectations (2.13.0)
71
+ rspec-core (2.14.4)
72
+ rspec-expectations (2.14.0)
85
73
  diff-lcs (>= 1.1.3, < 2.0)
86
- rspec-mocks (2.13.0)
87
- rspec-rails (2.13.0)
74
+ rspec-mocks (2.14.1)
75
+ rspec-rails (2.14.0)
88
76
  actionpack (>= 3.0)
89
77
  activesupport (>= 3.0)
90
78
  railties (>= 3.0)
91
- rspec-core (~> 2.13.0)
92
- rspec-expectations (~> 2.13.0)
93
- rspec-mocks (~> 2.13.0)
79
+ rspec-core (~> 2.14.0)
80
+ rspec-expectations (~> 2.14.0)
81
+ rspec-mocks (~> 2.14.0)
94
82
  simplecov (0.7.1)
95
83
  multi_json (~> 1.0)
96
84
  simplecov-html (~> 0.7.1)
97
85
  simplecov-html (0.7.1)
98
- sprockets (2.2.2)
86
+ sprockets (2.10.0)
99
87
  hike (~> 1.2)
100
88
  multi_json (~> 1.0)
101
89
  rack (~> 1.0)
102
90
  tilt (~> 1.1, != 1.3.0)
103
- thor (0.17.0)
104
- tilt (1.3.3)
105
- treetop (1.4.12)
91
+ sprockets-rails (2.0.0)
92
+ actionpack (>= 3.0)
93
+ activesupport (>= 3.0)
94
+ sprockets (~> 2.8)
95
+ thor (0.18.1)
96
+ thread_safe (0.1.0)
97
+ atomic
98
+ tilt (1.4.1)
99
+ treetop (1.4.14)
106
100
  polyglot
107
101
  polyglot (>= 0.3.1)
108
- tzinfo (0.3.35)
109
- yard (0.8.5.2)
102
+ tzinfo (0.3.37)
103
+ yard (0.8.6.2)
110
104
 
111
105
  PLATFORMS
112
106
  ruby
@@ -24,11 +24,11 @@ You can configure easy_captcha in "config/initializers/easy_captcha.rb", if you
24
24
  # Cache
25
25
  # config.cache = true
26
26
  # Cache temp dir from Rails.root
27
- # config.cache_temp_dir = Rails.root.join('tmp/captchas')
27
+ # config.cache_temp_dir = Rails.root.join('tmp', 'captchas')
28
28
  # Cache size
29
29
  # config.cache_size = 500
30
30
  # Cache expire
31
- # config.cache_expire = 1.days
31
+ # config.cache_expire = 1.day
32
32
 
33
33
  # Chars
34
34
  # config.chars = %w(2 3 4 5 6 7 9 A C D E F G H J K L M N P Q R S T U X Y Z)
@@ -91,6 +91,20 @@ You can configure easy_captcha in "config/initializers/easy_captcha.rb", if you
91
91
  # end
92
92
  end
93
93
 
94
+ == Caching
95
+ It is strongly recommended to enable caching. You can see the three paramters which you have to fill in your config file below.
96
+
97
+ EasyCaptcha.setup do |config|
98
+ # Cache
99
+ config.cache = true
100
+ # Cache temp dir from Rails.root
101
+ config.cache_temp_dir = Rails.root.join('tmp', 'captchas')
102
+ # Cache expire
103
+ config.cache_expire = 1.day
104
+ # Cache size
105
+ # config.cache_size = 500
106
+ end
107
+
94
108
  == Requirements
95
109
 
96
110
  * RMagick
@@ -123,6 +137,7 @@ You find an example app under: http://github.com/phatworx/easy_captcha_example
123
137
  * Team Phatworx (http://github.com/phatworx)
124
138
  * Marco Scholl (http://github.com/traxanos)
125
139
  * Alexander Dreher (http://github.com/alexdreher)
140
+ * Christoph Chilian (http://github.com/cc-web)
126
141
 
127
142
  == Contributing to EasyCaptcha
128
143
 
@@ -24,11 +24,11 @@ module EasyCaptcha
24
24
 
25
25
  # Cache size
26
26
  mattr_accessor :cache_size
27
- @@cache_size = 0
27
+ @@cache_size = 500
28
28
 
29
29
  # Cache expire
30
30
  mattr_accessor :cache_expire
31
- @@cache_expire = 0
31
+ @@cache_expire = nil
32
32
 
33
33
  # Chars
34
34
  mattr_accessor :chars
@@ -1,6 +1,7 @@
1
1
  module EasyCaptcha
2
2
  # captcha controller
3
3
  class Controller < ActionController::Base
4
+ before_filter :overwrite_cache_control
4
5
  # captcha action send the generated image to browser
5
6
  def captcha
6
7
  if params[:format] == "wav" and EasyCaptcha.espeak?
@@ -9,5 +10,13 @@ module EasyCaptcha
9
10
  send_data generate_captcha, :disposition => 'inline', :type => 'image/png'
10
11
  end
11
12
  end
13
+
14
+ private
15
+ # Overwrite cache control for Samsung Galaxy S3 (remove no-store)
16
+ def overwrite_cache_control
17
+ response.headers["Cache-Control"] = "no-cache, max-age=0, must-revalidate"
18
+ response.headers["Pragma"] = "no-cache"
19
+ response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
20
+ end
12
21
  end
13
22
  end
@@ -1,3 +1,3 @@
1
1
  module EasyCaptcha
2
- VERSION = '0.6.3'
2
+ VERSION = '0.6.4'
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
5
- prerelease:
4
+ version: 0.6.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marco Scholl
@@ -15,97 +14,85 @@ dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - '>='
21
19
  - !ruby/object:Gem::Version
22
20
  version: 3.0.0
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - '>='
29
26
  - !ruby/object:Gem::Version
30
27
  version: 3.0.0
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: bundler
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - '>='
37
33
  - !ruby/object:Gem::Version
38
34
  version: 1.1.0
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - '>='
45
40
  - !ruby/object:Gem::Version
46
41
  version: 1.1.0
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: simplecov
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - '>='
53
47
  - !ruby/object:Gem::Version
54
48
  version: 0.3.8
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: 0.3.8
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: rspec-rails
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - '>='
69
61
  - !ruby/object:Gem::Version
70
62
  version: 2.8.1
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - '>='
77
68
  - !ruby/object:Gem::Version
78
69
  version: 2.8.1
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: yard
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - '>='
85
75
  - !ruby/object:Gem::Version
86
76
  version: 0.7.0
87
77
  type: :runtime
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - '>='
93
82
  - !ruby/object:Gem::Version
94
83
  version: 0.7.0
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: rmagick
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - '>='
101
89
  - !ruby/object:Gem::Version
102
90
  version: 2.13.1
103
91
  type: :runtime
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - '>='
109
96
  - !ruby/object:Gem::Version
110
97
  version: 2.13.1
111
98
  description: Captcha-Plugin for Rails
@@ -147,30 +134,26 @@ files:
147
134
  homepage: http://github.com/phatworx/easy_captcha
148
135
  licenses:
149
136
  - MIT
137
+ metadata: {}
150
138
  post_install_message:
151
139
  rdoc_options: []
152
140
  require_paths:
153
141
  - lib
154
142
  required_ruby_version: !ruby/object:Gem::Requirement
155
- none: false
156
143
  requirements:
157
- - - ! '>='
144
+ - - '>='
158
145
  - !ruby/object:Gem::Version
159
146
  version: '0'
160
- segments:
161
- - 0
162
- hash: 3972133126308610203
163
147
  required_rubygems_version: !ruby/object:Gem::Requirement
164
- none: false
165
148
  requirements:
166
- - - ! '>='
149
+ - - '>='
167
150
  - !ruby/object:Gem::Version
168
151
  version: '0'
169
152
  requirements: []
170
153
  rubyforge_project:
171
- rubygems_version: 1.8.24
154
+ rubygems_version: 2.0.3
172
155
  signing_key:
173
- specification_version: 3
156
+ specification_version: 4
174
157
  summary: Captcha-Plugin for Rails
175
158
  test_files: []
176
159
  has_rdoc: