rt-client 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/rt/client.rb +8 -2
  2. metadata +4 -4
data/rt/client.rb CHANGED
@@ -22,7 +22,7 @@ require 'pp'
22
22
 
23
23
  class RT_Client
24
24
 
25
- UA = "Mozilla/5.0 ruby RT Client Interface 0.3.2"
25
+ UA = "Mozilla/5.0 ruby RT Client Interface 0.3.5"
26
26
  attr_reader :status, :site, :version, :cookies, :server, :user, :cookie
27
27
 
28
28
  # Create a new RT_Client object. Load up our stored cookie and check it.
@@ -55,7 +55,7 @@ class RT_Client
55
55
  # cookies=<directory>
56
56
  def initialize(*params)
57
57
  @boundary = "----xYzZY#{rand(1000000).to_s}xYzZY"
58
- @version = "0.3.4"
58
+ @version = "0.3.5"
59
59
  @status = "Not connected"
60
60
  @server = "http://localhost/"
61
61
  @user = "rt_user"
@@ -154,8 +154,14 @@ class RT_Client
154
154
  resp.gsub!(/\n\n/,"\n") # remove double spacing, TMail stops at a blank line
155
155
  return {:error => resp, } if resp =~ /does not exist./
156
156
  th = TMail::Mail.parse(resp)
157
+ resp += "\nrtclientend:" # to make the pattern match on the last key in the response
157
158
  th.each_header do |k,v|
158
159
  reply["#{k}"] = v.to_s
160
+ kk = k.gsub(/\{/,"\\\{")
161
+ kk.gsub!(/\}/,"\\\}")
162
+ pattern = "^" + kk + ": (.*?)^\\w+:"
163
+ temp = resp.match(/#{pattern}/mi) # TMail strips line breaks
164
+ reply["#{k}"] = temp[1] if temp.class != NilClass
159
165
  end
160
166
  reply
161
167
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rt-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- version: 0.3.4
9
+ - 5
10
+ version: 0.3.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Lahti
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-25 00:00:00 -07:00
18
+ date: 2010-11-22 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency