deathbycaptcha 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd52fe97e5ea7f1e12508b4493c81ccae8325e03
4
- data.tar.gz: 103578ff684f01a035ba01e6cebd985a05cbad24
3
+ metadata.gz: d578d0181a5e858098bc2329884daff5971f7bbd
4
+ data.tar.gz: b2681b030c07099cc78cb52dfc4382c6015d64b6
5
5
  SHA512:
6
- metadata.gz: 5abe419b602a8e27cec06d5ff934f567c4dbe9e3a93132a852cf4bb2a6bfac6b55ace0c7f575cac69332089d72b7d91c6f434a7508e17bfa2d6154e9eff90004
7
- data.tar.gz: e41f0460ac71a5ca5c482346d227f824a862c06209786aecfa027aa52c27a1955944910e652bbd4c84c24b37beebc854a11bf33978a51a574443664be91695d7
6
+ metadata.gz: 1eaf72f64a8b7e83d4e7b6933d17d3d48ea14a890cae901c1aa1f3e9693f7bbdac4e85ad23ba075010714a166946668fb60cd8032aa4d3814a31cf228e80a66c
7
+ data.tar.gz: 2628bb9faeba7ee4e1438d307d3a20357bb69f3b2195afbf804add2c9d1979f48ddbc719c6f01d084e38572c76ec03b7d623f56d96733eec784d96a5e056a327
data/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
1
1
  ### Comming next
2
2
 
3
- * Review Socket client, check if it's worth keeping a pool of open connections
4
- * Add more tests
3
+ * Add Travis CI
4
+ * Add Code Climate
5
+ * Add Hakiri
6
+ * Add Hound
7
+ * Add Rubocop
8
+
9
+ ### 5.0.1 - 2015-01-27
10
+
11
+ * Fix socket unsafe threads with Ruby < 2.2.0
5
12
 
6
13
  ### 5.0.0 - 2015-01-26
7
14
 
data/README.md CHANGED
@@ -32,7 +32,7 @@ Or install it yourself as:
32
32
  ```ruby
33
33
  # Create a client (:socket and :http clients are available)
34
34
  #
35
- client = DeathByCaptcha.new('myusername', 'mypassword', :socket)
35
+ client = DeathByCaptcha.new('myusername', 'mypassword', :http)
36
36
  ```
37
37
 
38
38
  2. **Solve a captcha**
@@ -114,6 +114,10 @@ When using the socket client, make sure that outgoing TCP traffic to
114
114
  **api.dbcapi.me** to the ports in range **8123-8130** is not blocked by your
115
115
  firewall.
116
116
 
117
+ > We are currently suggesting developers to use HTTP connection because Socket
118
+ > seems to be unstable with older Ruby versions. While we are investigating,
119
+ > consider using only HTTP connection.
120
+
117
121
  #### Ruby dependencies
118
122
 
119
123
  DeathByCaptcha >= 5.0.0 don't require specific dependencies. That saves you
@@ -82,22 +82,21 @@ module DeathByCaptcha
82
82
  # @return [DeathByCaptcha::Captcha] The captcha (with solution if an error is not raised).
83
83
  #
84
84
  def decode!(options = {})
85
- ::Timeout.timeout(self.timeout) do
86
- raw64 = load_captcha(options)
87
- raise DeathByCaptcha::InvalidCaptcha if raw64.to_s.empty?
85
+ started_at = Time.now
88
86
 
89
- _captcha = self.upload(raw64)
90
- while _captcha.text.to_s.empty?
91
- sleep(self.polling)
92
- _captcha = self.captcha(_captcha.id)
93
- end
87
+ raw64 = load_captcha(options)
88
+ raise DeathByCaptcha::InvalidCaptcha if raw64.to_s.empty?
94
89
 
95
- raise DeathByCaptcha::IncorrectSolution if !_captcha.is_correct
96
-
97
- _captcha
90
+ _captcha = self.upload(raw64)
91
+ while _captcha.text.to_s.empty?
92
+ sleep(self.polling)
93
+ _captcha = self.captcha(_captcha.id)
94
+ raise DeathByCaptcha::Timeout if (Time.now - started_at) > self.timeout
98
95
  end
99
- rescue ::Timeout::Error
100
- raise DeathByCaptcha::Timeout
96
+
97
+ raise DeathByCaptcha::IncorrectSolution if !_captcha.is_correct
98
+
99
+ _captcha
101
100
  end
102
101
 
103
102
  # Retrieve information from an uploaded captcha.
@@ -1,4 +1,4 @@
1
1
  module DeathByCaptcha
2
- VERSION = "5.0.1"
2
+ VERSION = "5.0.2"
3
3
  API_VERSION = "DBC/Ruby v#{VERSION}"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deathbycaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Débora Setton Fernandes, Rafael Barbolo, Rafael Ivan Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.4.5
104
+ rubygems_version: 2.4.3
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Ruby API for DeathByCaptcha (Captcha Solver as a Service)