Rename effective_options to effectiveOptions.

This commit is contained in:
Miao Jiang 2012-11-29 17:03:12 +08:00
parent a21831a17e
commit 5dc00f43dc
2 changed files with 17 additions and 15 deletions

View file

@ -18,7 +18,7 @@ class CurlBuilder
curl.perform = (args...) ->
if @running
throw new Error 'the cURL session is busy, use CurlBuilder.create to create another cURL Session'
throw new Error 'the cURL session is busy, use curl.create to create another cURL Session'
if !@curl_
throw new Error 'the cURL is closed.'
@ -37,15 +37,15 @@ class CurlBuilder
@debug = @defaultOptions.DEBUG ? @options.DEBUG ? @debug
@effective_options = {}
@effectiveOptions = {}
for k, v of @defaultOptions
@effective_options[k] = v
@effectiveOptions[k] = v
for k, v of @options
@effective_options[k] = v
@effectiveOptions[k] = v
@setOptions @effective_options
@curl_.setopt('URL', @url)
@setOptions @effectiveOptions
@setOptions {URL: @url}
c.on_write = (chunk) ->
curl.log "receive #{chunk.length} bytes"
@ -84,7 +84,7 @@ class CurlBuilder
curl.setDefaultOptions = (options = {}, reset = true) ->
@defaultOptions = options
defaultOptions = options
if reset
@log 'Set default options and reset cURL'
@reset()