captcha_img 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/captcha_img.rb +43 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f174a520cb7012da325bd90ca91b87f5cd671e5f
|
4
|
+
data.tar.gz: 8b2f89822f4d3eada81341aba6b3774cb2055b01
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cf651c5050fed3d38d51aa3509b3c89025b046e299439e93012407fcdad62d57212a8dd26d9c73d821767be9f090add675ed4c8a75f65386abfde7bb1c75de5d
|
7
|
+
data.tar.gz: e62fff94be25ee5da9aac23825b850b72ca8298c05484aa8454c3c2386dcd862343e042eadf66d07938efcbad56b07aa215f1a9344383f8a09e383bf31afa61e
|
data/lib/captcha_img.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
class Captcha_img
|
2
|
+
def initialize
|
3
|
+
end
|
4
|
+
|
5
|
+
def self.array
|
6
|
+
action= [ "+" , "-" , "*" ]
|
7
|
+
|
8
|
+
r = Random.new
|
9
|
+
@no1=r.rand(1..9)
|
10
|
+
a = @no1
|
11
|
+
@no2=r.rand(1..9)
|
12
|
+
b = @no2
|
13
|
+
# no2=@no[r.rand(9)]
|
14
|
+
ac= action[rand(3)]
|
15
|
+
|
16
|
+
if ac=='-'
|
17
|
+
if a<b
|
18
|
+
temp = a
|
19
|
+
a = b
|
20
|
+
b = temp
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
ans = eval "#{a}#{ac}#{b}"
|
25
|
+
cap_view = "#{a} #{ac} #{b} = "
|
26
|
+
|
27
|
+
result = "#{ans}~ #{cap_view}"
|
28
|
+
# @source = ans + "~" + cap_view
|
29
|
+
# puts result
|
30
|
+
# cap_view = "#{@no_letter[no1]} #{@action[ac]} #{@no_letter[no2]}"
|
31
|
+
# puts ans
|
32
|
+
# puts cap_view
|
33
|
+
return result
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
#t= Captcha_img.array
|
41
|
+
#puts t
|
42
|
+
|
43
|
+
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: captcha_img
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- rohit
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: you will get arithmatic sum with answer you just have to compare with
|
14
|
+
ur user in controller
|
15
|
+
email: rohitnnisal@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/captcha_img.rb
|
21
|
+
homepage: http://rubygems.org/gems/captcha_img
|
22
|
+
licenses: []
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.6.8
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: giving captcha with result
|
44
|
+
test_files: []
|