ruby-2captcha 1.0.0 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bceae77fdd7d62a0bf9865844cb82de261c988e77a5cdb8eadf7291033db46cf
4
- data.tar.gz: 28a960abf150e63c7a73262ea0a7ae6c23e5c86b63809ea003a515c252cf1e8f
3
+ metadata.gz: 6faa77836721484cbde480e6915021cb39fb199d05ab52333240e34db98de1a8
4
+ data.tar.gz: 621afa748b261f8a1f0e85fad80e95597d268358874931864abc7f670e9f994a
5
5
  SHA512:
6
- metadata.gz: a636a333b794a6d8626bdea77e7617d864ed3199309e711069bf25a9c1e31027012d75c2c6bc90eadf4120e3c364e8dfcb48beda2a39feed33ed0c9884554dca
7
- data.tar.gz: 425f31c29721c8fe3a762a621430f5d3e81dde90a3a8126e3c4f26453714edd8f4e79c82c463080b73d3c10ffcf8f2597dceb25c8aab1536f4b4c2dd02cebc93
6
+ metadata.gz: a53cc1fe3f45c0b7a157eaa25bf85c22298351916ae992ae851a2d32e726e45e00ac6a91c7a23b4508643abd76c29ca8c04225ef6f2a4f49f2396c84b8266127
7
+ data.tar.gz: 9b738e21dd5af75ae17986a3a28f5229e1994cb6cbca67823dadb16ff766ae1ea88a425dec1281dbb8c4ac93f7fd1f670d92da093d043dacb507c51057f0f018
data/README.md CHANGED
@@ -56,13 +56,13 @@ To use the api2captcha gem, you'll need to import the module and create a Client
56
56
  ```ruby
57
57
  require 'api-2captcha'
58
58
 
59
- client = Api2Captcha.new(api_key: "YOUR_API_KEY")
59
+ client = Api2Captcha.new("YOUR_API_KEY")
60
60
  ```
61
61
 
62
62
  There are a few options that can be configured using the Client instance:
63
63
 
64
64
  ```ruby
65
- client.apy_key = "YOUR_API_KEY"
65
+ client.api_key = "YOUR_API_KEY"
66
66
  ```
67
67
 
68
68
  ### Client instance options
data/api_2captcha.gemspec CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = "https://github.com/2captcha/2captcha-ruby"
19
19
  spec.metadata["changelog_uri"] = "https://github.com/2captcha/2captcha-ruby/releases"
20
+ spec.metadata["github_repo"] = "ssh://github.com/2captcha/2captcha-ruby"
20
21
 
21
22
  # Specify which files should be added to the gem when it is released.
22
23
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -31,10 +31,16 @@ class Api2Captcha::Client
31
31
  params["key"] = @api_key
32
32
  params["soft_id"] = @soft_id
33
33
  params["json"] = 1
34
-
34
+ if @callback
35
+ params["pingback"] = @callback
36
+ return_id = true
37
+ else
38
+ return_id
39
+ end
35
40
  complete_params = get_params(params)
36
41
  captcha_id = send_request(complete_params)
37
- return_id ? get_result(captcha_id) : captcha_id
42
+
43
+ return_id ? captcha_id : get_result(captcha_id)
38
44
  end
39
45
 
40
46
  def send(*args)
@@ -184,7 +190,6 @@ class Api2Captcha::Client
184
190
  req.content_type = 'application/json'
185
191
  req.body = params.to_json
186
192
  captcha_id = get_captcha_id(make_request(uri, req))
187
- handle_response(captcha_id)
188
193
  end
189
194
 
190
195
  def get_params(params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Api2Captcha
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-2captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - 2captcha.com
@@ -40,6 +40,7 @@ metadata:
40
40
  homepage_uri: https://2captcha.com/
41
41
  source_code_uri: https://github.com/2captcha/2captcha-ruby
42
42
  changelog_uri: https://github.com/2captcha/2captcha-ruby/releases
43
+ github_repo: ssh://github.com/2captcha/2captcha-ruby
43
44
  post_install_message:
44
45
  rdoc_options: []
45
46
  require_paths: