Skip to content

Commit

Permalink
Copyright updated.
Browse files Browse the repository at this point in the history
Upload method updated to receive options for the input captcha image.
  • Loading branch information
barbolo committed Apr 6, 2011
1 parent a1de76e commit ba0aadf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion MIT-LICENSE
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2011 by Rafael Barbolo, Rafael Ivan Copyright (C) 2011 by Infosimples. http://www.infosimples.com.br/


Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Get the solution of a captcha:


== License == License


MIT License. MIT License. Copyright (C) 2011 by Infosimples. http://www.infosimples.com.br/
9 changes: 4 additions & 5 deletions deathbycaptcha.gemspec
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ $:.push File.expand_path("../lib", __FILE__)
require "deathbycaptcha/version" require "deathbycaptcha/version"


Gem::Specification.new do |s| Gem::Specification.new do |s|
s.add_dependency 'rest-client' s.add_dependency 'rest-client', '~> 1.6.1'
s.add_dependency 'addressable' s.add_dependency 'json', '~> 1.4.6'
s.add_dependency 'json'


s.name = "deathbycaptcha" s.name = "deathbycaptcha"
s.version = DeathByCaptcha::VERSION s.version = DeathByCaptcha::VERSION
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.authors = ["Rafael Barbolo Lopes, Rafael Ivan Garcia"] s.authors = ["Rafael Barbolo Lopes, Rafael Ivan Garcia"]
s.email = [] s.email = ["tech@infosimples.com.br"]
s.homepage = "" s.homepage = "http://github.com/infosimples/deathbycaptcha"
s.summary = %q{Ruby API for DeathByCaptcha (Captcha Solver as a Service)} s.summary = %q{Ruby API for DeathByCaptcha (Captcha Solver as a Service)}
s.description = %q{Ruby API for DeathByCaptcha (Captcha Solver as a Service)} s.description = %q{Ruby API for DeathByCaptcha (Captcha Solver as a Service)}


Expand Down
2 changes: 1 addition & 1 deletion lib/deathbycaptcha/client.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def remove(cid)
# whether the CAPTCHA is case-sensitive or not. Returns CAPTCHA details # whether the CAPTCHA is case-sensitive or not. Returns CAPTCHA details
# on success. # on success.
# #
def upload(captcha, is_case_sensitive=false) def upload(captcha, options={})
raise DeathByCaptcha::Errors::NotImplemented raise DeathByCaptcha::Errors::NotImplemented
end end


Expand Down
11 changes: 8 additions & 3 deletions lib/deathbycaptcha/http_client.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ def remove(cid)
not call("captcha/#{cid}/remove", userpwd)['captcha'] not call("captcha/#{cid}/remove", userpwd)['captcha']
end end


def a(nome, test=false, valor="verdade")
puts nome,test,valor
end

protected protected
def upload(captcha, is_case_sensitive=false, is_raw_content=false) def upload(captcha, options={})
options = {:is_case_sensitive => false, :is_raw_content => false}.merge(options)
data = userpwd data = userpwd
data[:swid] = config.software_vendor_id data[:swid] = config.software_vendor_id
data[:is_case_sensitive] = is_case_sensitive ? 1 : 0 data[:is_case_sensitive] = options[:is_case_sensitive] ? 1 : 0
data[:captchafile] = load_file(captcha, is_raw_content) data[:captchafile] = load_file(captcha, options[:is_raw_content])
response = call('captcha', data) response = call('captcha', data)
return response if response['captcha'] return response if response['captcha']
end end
Expand Down

0 comments on commit ba0aadf

Please sign in to comment.