ficonabses 0.3.6 → 0.3.7

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.
@@ -31,7 +31,7 @@ def send_row(ficonab,row,flag)
31
31
  row['destination'].strip!
32
32
  row['campaign'].strip! if flag
33
33
  row['template'].strip! if !flag
34
- sleep(0.05)
34
+ # sleep(0.05)
35
35
  if row!=nil then
36
36
  res =ficonab.send_template_params(row['destination'],row['template'],row) if !flag
37
37
  res =ficonab.send_campaign_flow(row['destination'],row['campaign'],row) if flag
@@ -62,7 +62,15 @@ module FiconabSES
62
62
  f=FiconabSES::Base.new
63
63
  f.set_credentials(account,password)
64
64
  f.send_campaign_flow(destination,templatename,options)
65
- end
65
+ end
66
+ def build_client
67
+ if @clnt==nil then
68
+ @clnt=HTTPClient.new
69
+ @clnt.set_auth(nil, @account, @password)
70
+ @extheader = { 'Content-Type' => 'application/xml' }
71
+ end
72
+ @clnt
73
+ end
66
74
  def perform(url)
67
75
  @uri=URI.parse(url)
68
76
  # puts "url is #{url}"
@@ -70,10 +78,8 @@ module FiconabSES
70
78
  res=''
71
79
  begin
72
80
  # Don't take longer than 60 seconds -- incase there is a problem with our server continue
73
- @clnt=HTTPClient.new
74
- Timeout::timeout(60) do
75
- @clnt.set_auth(nil, @account, @password)
76
- @extheader = { 'Content-Type' => 'application/xml' }
81
+ @clnt=self.build_client
82
+ Timeout::timeout(60) do
77
83
  res=self.clnt.get_content(self.uri,self.extheader)
78
84
  end
79
85
  rescue Timeout::Error,HTTPClient::BadResponseError
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 6
9
- version: 0.3.6
8
+ - 7
9
+ version: 0.3.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Scott Sproule
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-05-06 00:00:00 +08:00
17
+ date: 2012-05-18 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20