vit_captcha 1.0.1

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: 62c0b21253d8ad0e65a32e6fa6e3142035ab949c
4
+ data.tar.gz: 1cfcec927bca453ff6976552142faaee669b39fe
5
+ SHA512:
6
+ metadata.gz: eafa57194ae4cb6d186bc842c395c44612ea4edf64edfefc028515e82586b27974682360ae0872b86be48939f0480e5ec498535de821a81b80c18abb9e61753d
7
+ data.tar.gz: 00368c7678533fb223c91d496b8c87677fde70570841aceb84f0eab597d71152f95772e6e0ddf2f39dea657d95609d75ebe0cd8b244715c4708bcfdf1a87d90b
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
@@ -0,0 +1 @@
1
+ vit_captcha
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Remove rake task
5
+ 2. Add existing rake tasks
6
+ To add existing rake tasks automatically delete this file and reload the project.
7
+ --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build vit_captcha-0.0.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install vit_captcha-0.0.1.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.0.1 and build and push vit_captcha-0.0.1.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
4
+ <OptionsSetting value="true" id="Add" />
5
+ <OptionsSetting value="true" id="Remove" />
6
+ <OptionsSetting value="true" id="Checkout" />
7
+ <OptionsSetting value="true" id="Update" />
8
+ <OptionsSetting value="true" id="Status" />
9
+ <OptionsSetting value="true" id="Edit" />
10
+ <ConfirmationsSetting value="0" id="Add" />
11
+ <ConfirmationsSetting value="0" id="Remove" />
12
+ </component>
13
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.1.5-p273" project-jdk-type="RUBY_SDK" />
14
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/vit_captcha.iml" filepath="$PROJECT_DIR$/.idea/vit_captcha.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="gem" name="Ruby Gem">
5
+ <configuration>
6
+ <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
7
+ <option name="GEM_APP_TEST_PATH" value="" />
8
+ <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="NewModuleRootManager">
13
+ <content url="file://$MODULE_DIR$" />
14
+ <orderEntry type="inheritedJdk" />
15
+ <orderEntry type="sourceFolder" forTests="false" />
16
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.7, ruby-2.1.5-p273) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.4.2, ruby-2.1.5-p273) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="rmagick (v2.15.4, ruby-2.1.5-p273) [gem]" level="application" />
19
+ </component>
20
+ </module>
@@ -0,0 +1,270 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="9a12ad66-0185-4c03-b664-6a95103bac89" name="Default" comment="">
5
+ <change type="DELETED" beforePath="C:\Users\Hadi Nishad\RubymineProjects\vit_captcha\test.png" afterPath="" />
6
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/vit_captcha/version.rb" afterPath="$PROJECT_DIR$/lib/vit_captcha/version.rb" />
7
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/vit_captcha.rb" afterPath="$PROJECT_DIR$/lib/vit_captcha.rb" />
8
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
9
+ </list>
10
+ <ignored path="vit_captcha.iws" />
11
+ <ignored path=".idea/workspace.xml" />
12
+ <ignored path=".idea/dataSources.local.xml" />
13
+ <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
14
+ <option name="TRACKING_ENABLED" value="true" />
15
+ <option name="SHOW_DIALOG" value="false" />
16
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
17
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
18
+ <option name="LAST_RESOLUTION" value="IGNORE" />
19
+ </component>
20
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
21
+ <component name="CreatePatchCommitExecutor">
22
+ <option name="PATCH_PATH" value="" />
23
+ </component>
24
+ <component name="FavoritesManager">
25
+ <favorites_list name="vit_captcha" />
26
+ </component>
27
+ <component name="FileEditorManager">
28
+ <leaf>
29
+ <file leaf-file-name="vit_captcha.gemspec" pinned="false" current-in-tab="true">
30
+ <entry file="file://$PROJECT_DIR$/vit_captcha.gemspec">
31
+ <provider selected="true" editor-type-id="text-editor">
32
+ <state vertical-scroll-proportion="0.0">
33
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="2" selection-end-column="55" />
34
+ <folding />
35
+ </state>
36
+ </provider>
37
+ </entry>
38
+ </file>
39
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
40
+ <entry file="file://$PROJECT_DIR$/lib/vit_captcha/version.rb">
41
+ <provider selected="true" editor-type-id="text-editor">
42
+ <state vertical-scroll-proportion="0.0">
43
+ <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
44
+ <folding />
45
+ </state>
46
+ </provider>
47
+ </entry>
48
+ </file>
49
+ <file leaf-file-name="vit_captcha.rb" pinned="false" current-in-tab="false">
50
+ <entry file="file://$PROJECT_DIR$/lib/vit_captcha.rb">
51
+ <provider selected="true" editor-type-id="text-editor">
52
+ <state vertical-scroll-proportion="0.0">
53
+ <caret line="7" column="71" selection-start-line="7" selection-start-column="71" selection-end-line="7" selection-end-column="71" />
54
+ <folding />
55
+ </state>
56
+ </provider>
57
+ </entry>
58
+ </file>
59
+ </leaf>
60
+ </component>
61
+ <component name="Git.Settings">
62
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
63
+ </component>
64
+ <component name="IdeDocumentHistory">
65
+ <option name="CHANGED_PATHS">
66
+ <list>
67
+ <option value="$PROJECT_DIR$/../CaptchaParser/CaptchaParserLite.rb" />
68
+ <option value="$PROJECT_DIR$/lib/vit_captcha.rb" />
69
+ <option value="$PROJECT_DIR$/lib/vit_captcha/version.rb" />
70
+ <option value="$PROJECT_DIR$/vit_captcha.gemspec" />
71
+ </list>
72
+ </option>
73
+ </component>
74
+ <component name="JsBuildToolGruntFileManager" detection-done="true" />
75
+ <component name="JsGulpfileManager">
76
+ <detection-done>true</detection-done>
77
+ </component>
78
+ <component name="NamedScopeManager">
79
+ <order />
80
+ </component>
81
+ <component name="ProjectFrameBounds">
82
+ <option name="x" value="-8" />
83
+ <option name="y" value="-8" />
84
+ <option name="width" value="1382" />
85
+ <option name="height" value="744" />
86
+ </component>
87
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
88
+ <OptionsSetting value="true" id="Add" />
89
+ <OptionsSetting value="true" id="Remove" />
90
+ <OptionsSetting value="true" id="Checkout" />
91
+ <OptionsSetting value="true" id="Update" />
92
+ <OptionsSetting value="true" id="Status" />
93
+ <OptionsSetting value="true" id="Edit" />
94
+ <ConfirmationsSetting value="0" id="Add" />
95
+ <ConfirmationsSetting value="0" id="Remove" />
96
+ </component>
97
+ <component name="ProjectView">
98
+ <navigator currentView="ProjectPane" proportions="" version="1">
99
+ <flattenPackages />
100
+ <showMembers />
101
+ <showModules />
102
+ <showLibraryContents />
103
+ <hideEmptyPackages />
104
+ <abbreviatePackageNames />
105
+ <autoscrollToSource />
106
+ <autoscrollFromSource />
107
+ <sortByType />
108
+ </navigator>
109
+ <panes>
110
+ <pane id="Scratches" />
111
+ <pane id="ProjectPane">
112
+ <subPane>
113
+ <PATH>
114
+ <PATH_ELEMENT>
115
+ <option name="myItemId" value="vit_captcha" />
116
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
117
+ </PATH_ELEMENT>
118
+ </PATH>
119
+ <PATH>
120
+ <PATH_ELEMENT>
121
+ <option name="myItemId" value="vit_captcha" />
122
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
123
+ </PATH_ELEMENT>
124
+ <PATH_ELEMENT>
125
+ <option name="myItemId" value="vit_captcha" />
126
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
127
+ </PATH_ELEMENT>
128
+ </PATH>
129
+ <PATH>
130
+ <PATH_ELEMENT>
131
+ <option name="myItemId" value="vit_captcha" />
132
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
133
+ </PATH_ELEMENT>
134
+ <PATH_ELEMENT>
135
+ <option name="myItemId" value="vit_captcha" />
136
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
137
+ </PATH_ELEMENT>
138
+ <PATH_ELEMENT>
139
+ <option name="myItemId" value="lib" />
140
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
141
+ </PATH_ELEMENT>
142
+ </PATH>
143
+ <PATH>
144
+ <PATH_ELEMENT>
145
+ <option name="myItemId" value="vit_captcha" />
146
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
147
+ </PATH_ELEMENT>
148
+ <PATH_ELEMENT>
149
+ <option name="myItemId" value="vit_captcha" />
150
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
151
+ </PATH_ELEMENT>
152
+ <PATH_ELEMENT>
153
+ <option name="myItemId" value="lib" />
154
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
155
+ </PATH_ELEMENT>
156
+ <PATH_ELEMENT>
157
+ <option name="myItemId" value="vit_captcha" />
158
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
159
+ </PATH_ELEMENT>
160
+ </PATH>
161
+ </subPane>
162
+ </pane>
163
+ <pane id="Scope" />
164
+ </panes>
165
+ </component>
166
+ <component name="PropertiesComponent">
167
+ <property name="last_opened_file_path" value="$PROJECT_DIR$/../CaptchaParser/CaptchaParserLite.rb" />
168
+ <property name="WebServerToolWindowFactoryState" value="false" />
169
+ </component>
170
+ <component name="ShelveChangesManager" show_recycled="false" />
171
+ <component name="TaskManager">
172
+ <task active="true" id="Default" summary="Default task">
173
+ <changelist id="9a12ad66-0185-4c03-b664-6a95103bac89" name="Default" comment="" />
174
+ <created>1447217531198</created>
175
+ <option name="number" value="Default" />
176
+ <updated>1447217531198</updated>
177
+ </task>
178
+ <servers />
179
+ </component>
180
+ <component name="ToolWindowManager">
181
+ <frame x="-8" y="-8" width="1382" height="744" extended-state="6" />
182
+ <editor active="true" />
183
+ <layout>
184
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32980332" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
185
+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
186
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
187
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
188
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
189
+ <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
190
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24963397" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
191
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
192
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
193
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
194
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
195
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
196
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
197
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
198
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
199
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
200
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
201
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
202
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
203
+ </layout>
204
+ </component>
205
+ <component name="VcsContentAnnotationSettings">
206
+ <option name="myLimit" value="2678400000" />
207
+ </component>
208
+ <component name="XDebuggerManager">
209
+ <breakpoint-manager />
210
+ <watches-manager />
211
+ </component>
212
+ <component name="editorHistoryManager">
213
+ <entry file="file://$PROJECT_DIR$/Gemfile">
214
+ <provider selected="true" editor-type-id="text-editor">
215
+ <state vertical-scroll-proportion="0.0">
216
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
217
+ <folding />
218
+ </state>
219
+ </provider>
220
+ </entry>
221
+ <entry file="file://$PROJECT_DIR$/../CaptchaParser/CaptchaParserLite.rb">
222
+ <provider selected="true" editor-type-id="text-editor">
223
+ <state vertical-scroll-proportion="94.07407">
224
+ <caret line="62" column="21109" selection-start-line="62" selection-start-column="21109" selection-end-line="62" selection-end-column="21109" />
225
+ <folding />
226
+ </state>
227
+ </provider>
228
+ </entry>
229
+ <entry file="file://$PROJECT_DIR$/.gitignore">
230
+ <provider selected="true" editor-type-id="text-editor">
231
+ <state vertical-scroll-proportion="0.0">
232
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
233
+ <folding />
234
+ </state>
235
+ </provider>
236
+ </entry>
237
+ <entry file="file://$PROJECT_DIR$/Rakefile">
238
+ <provider selected="true" editor-type-id="text-editor">
239
+ <state vertical-scroll-proportion="0.0">
240
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
241
+ <folding />
242
+ </state>
243
+ </provider>
244
+ </entry>
245
+ <entry file="file://$PROJECT_DIR$/lib/vit_captcha.rb">
246
+ <provider selected="true" editor-type-id="text-editor">
247
+ <state vertical-scroll-proportion="0.0">
248
+ <caret line="7" column="71" selection-start-line="7" selection-start-column="71" selection-end-line="7" selection-end-column="71" />
249
+ <folding />
250
+ </state>
251
+ </provider>
252
+ </entry>
253
+ <entry file="file://$PROJECT_DIR$/lib/vit_captcha/version.rb">
254
+ <provider selected="true" editor-type-id="text-editor">
255
+ <state vertical-scroll-proportion="0.0">
256
+ <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
257
+ <folding />
258
+ </state>
259
+ </provider>
260
+ </entry>
261
+ <entry file="file://$PROJECT_DIR$/vit_captcha.gemspec">
262
+ <provider selected="true" editor-type-id="text-editor">
263
+ <state vertical-scroll-proportion="0.0">
264
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="2" selection-end-column="55" />
265
+ <folding />
266
+ </state>
267
+ </provider>
268
+ </entry>
269
+ </component>
270
+ </project>
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vit_captcha.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Hadi Nishad
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+ # VitCaptcha
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'vit_captcha'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install vit_captcha
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/vit_captcha/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,75 @@
1
+ require "vit_captcha/version"
2
+ require "Rmagick"
3
+ include Magick
4
+
5
+ class Captcha
6
+
7
+ def initialize(file_location)
8
+ @img = ImageList.new(file_location).crop(20,3,87,22).threshold(100)
9
+ @matrix = get_matrix(@img)
10
+ @row = @matrix.size
11
+ @col = @matrix[0].size
12
+ @order = Hash.new()
13
+ end
14
+
15
+ def get_matrix(img)
16
+ matrix = Array.new
17
+ temp_arr = Array.new
18
+ col_count = 0
19
+ img.each_pixel do |pixel, col, row|
20
+ val = "0"
21
+ val = "1" if pixel.green == 0
22
+ if col_count > col
23
+ matrix.push(temp_arr)
24
+ col_count = 0
25
+ temp_arr = Array.new
26
+ end
27
+ temp_arr.push(val)
28
+ col_count+=1
29
+ end
30
+
31
+ return matrix
32
+ end
33
+
34
+ def check_match(letter ,mask, col, row)
35
+ @matrix.each_with_index do |matrix_row, x_off|
36
+ matrix_row.each_with_index do |matrix_ele, y_off|
37
+ next if x_off+col>@row || y_off+row>@col
38
+ flag = 0
39
+ mask.each_with_index do |row, x|
40
+ row.each_with_index do |element, y|
41
+ if element == "1" && @matrix[x+x_off][y+y_off] != "1"
42
+ flag = 1
43
+ break
44
+ end
45
+ end
46
+ break if flag == 1
47
+ end
48
+ @order[y_off]=letter if flag == 0
49
+ end
50
+ end
51
+ end
52
+
53
+ def answer
54
+ answer = ""
55
+ @order.sort.each do |letter|
56
+ answer += letter[1].to_s
57
+ end
58
+ answer.delete! '_'
59
+ end
60
+
61
+ def get_captcha
62
+ keys = { _0: [["0", "0", "0", "1", "1", "1", "1", "0", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "0", "0", "1", "1", "0"], ["1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "0", "0", "0", "1", "1", "0", "1", "1"], ["1", "1", "0", "0", "1", "1", "0", "0", "1", "1"], ["1", "1", "0", "1", "1", "0", "0", "0", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "0", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1"], ["0", "1", "1", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "0", "1", "1", "1", "1", "0", "0", "0"] ], _1: [ ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"] ], _2: [ ["0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "0", "0", "0", "1", "1", "1", "1", "0"], ["1", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "1", "1", "1", "1", "0", "0", "0", "0"], ["0", "1", "1", "1", "1", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1"] ], _3: [ ["0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"] ], _4: [ ["0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "1", "1", "0", "1", "1", "1", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0", "0"] ], _5: [ ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"] ], _6: [ ["0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "0"] ], _7: [ ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "0", "0", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "0", "0", "0", "0"] ], _8: [ ["0", "0", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "0", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"] ], _9: [ ["0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "1", "1", "1", "0", "1", "1", "1"], ["0", "0", "1", "1", "1", "1", "1", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0"] ], A: [ ["0", "0", "0", "0", "1", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "1", "0", "0", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1"] ], B: [ ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"] ], C: [ ["0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "1", "1", "1", "1", "0", "0", "0", "0", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "1"], ["0", "1", "1", "1", "1", "0", "0", "0", "0", "1", "1"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "0"] ], D: [ ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0"] ], E: [ ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"] ], F: [ ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"] ], G: [ ["0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "1", "1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "0", "0"] ], H: [ ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"] ], I: [ ["1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1"] ], J: [ ["0", "0", "1", "1", "1", "1", "1", "1"], ["0", "0", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1"], ["0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "0", "0"] ], K: [ ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "0", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "0", "1", "1", "1", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "0", "0", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"] ], L: [ ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1"] ], M: [ ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "0", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "1", "1", "0", "1", "1", "0", "1", "1", "1"], ["1", "1", "1", "0", "1", "1", "1", "1", "1", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "1", "1", "1", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "1", "1", "1", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"] ], N: [ ["1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "1", "1", "1", "0", "1", "1", "1"], ["1", "1", "1", "0", "1", "1", "1", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"] ], O: [ ["0", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "0", "0"] ], P: [ ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0"] ], Q: [ ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1"], ["1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1"], ["1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1"], ["1", "1", "0", "0", "0", "0", "0", "1", "0", "0", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "0", "1", "1"], ["0", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "1", "0"] ], R: [ ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["1", "1", "1", "0", "0", "1", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "0", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"] ], S: [ ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "0"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "0"], ["1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0"] ], T: [ ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"] ], U: [ ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1"], ["0", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "0"] ], V: [ ["1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "1", "0", "0", "0", "0"] ], W: [ ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "1", "1", "0", "1", "1", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "0", "1", "1", "0", "1", "1", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "1", "1", "1", "0", "1", "1", "1", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "1", "1", "1", "0", "1", "1", "1", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "1", "1", "0", "0", "0", "1", "1", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "0", "1", "1", "0", "0", "0", "1", "1", "0", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1", "1", "0", "0"] ], X: [ ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["0", "1", "1", "1", "1", "0", "0", "1", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0"], ["0", "1", "1", "1", "1", "0", "0", "1", "1", "1", "1", "0"], ["1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1"] ], Y: [ ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["1", "1", "1", "0", "0", "0", "0", "0", "1", "1", "1"], ["0", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0"], ["0", "1", "1", "1", "1", "0", "1", "1", "1", "1", "0"], ["0", "0", "1", "1", "1", "0", "1", "1", "1", "0", "0"], ["0", "0", "1", "1", "1", "1", "1", "1", "1", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0"] ], Z: [ ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "0", "1", "1", "1", "1"], ["0", "0", "0", "0", "0", "1", "1", "1", "1", "0"], ["0", "0", "0", "0", "0", "1", "1", "1", "0", "0"], ["0", "0", "0", "0", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "1", "0", "0", "0"], ["0", "0", "0", "1", "1", "1", "0", "0", "0", "0"], ["0", "0", "1", "1", "1", "0", "0", "0", "0", "0"], ["0", "1", "1", "1", "1", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "0", "0", "0", "0", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1"] ] }
63
+ count = 0
64
+ keys.each_pair do |letter, mask|
65
+
66
+ break if count>=6
67
+ mask_row = mask.size
68
+ mask_col = mask[0].size
69
+ check_match(letter, mask, mask_col, mask_row)
70
+ count = @order.size
71
+
72
+ end
73
+ return answer
74
+ end
75
+ end
@@ -0,0 +1,3 @@
1
+ module VitCaptcha
2
+ VERSION = "1.0.1"
3
+ end
Binary file
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vit_captcha/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vit_captcha"
8
+ spec.version = VitCaptcha::VERSION
9
+ spec.authors = ["Hadi Nishad"]
10
+ spec.email = ["hadinishad42@gmail.com"]
11
+ spec.summary = %q{Solves CAPTCHA on VIT Academics page}
12
+ spec.description = %q{Ruby port of VIT AutoCaptcha}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'rmagick'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.7"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vit_captcha
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Hadi Nishad
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rmagick
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Ruby port of VIT AutoCaptcha
56
+ email:
57
+ - hadinishad42@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".idea/.name"
64
+ - ".idea/.rakeTasks"
65
+ - ".idea/misc.xml"
66
+ - ".idea/modules.xml"
67
+ - ".idea/vcs.xml"
68
+ - ".idea/vit_captcha.iml"
69
+ - ".idea/workspace.xml"
70
+ - Gemfile
71
+ - LICENSE.txt
72
+ - README.md
73
+ - Rakefile
74
+ - lib/vit_captcha.rb
75
+ - lib/vit_captcha/version.rb
76
+ - vit_captcha-1.0.0.gem
77
+ - vit_captcha.gemspec
78
+ homepage: ''
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.3.0
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Solves CAPTCHA on VIT Academics page
102
+ test_files: []