rt-client 0.7.4 → 0.7.5
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.
- data/rt_client.rb +10 -17
- data/rtxmlsrv.rb +1 -1
- metadata +19 -17
- checksums.yaml +0 -7
data/rt_client.rb
CHANGED
@@ -37,7 +37,7 @@ end
|
|
37
37
|
|
38
38
|
class RT_Client
|
39
39
|
|
40
|
-
UA = "Mozilla/5.0 ruby RT Client Interface 0.7.
|
40
|
+
UA = "Mozilla/5.0 ruby RT Client Interface 0.7.5"
|
41
41
|
attr_reader :status, :site, :version, :cookies, :server, :user, :cookie
|
42
42
|
|
43
43
|
# Create a new RT_Client object. Load up our stored cookie and check it.
|
@@ -70,7 +70,7 @@ class RT_Client
|
|
70
70
|
# cookies=<directory>
|
71
71
|
def initialize(*params)
|
72
72
|
@boundary = "----xYzZY#{rand(1000000).to_s}xYzZY"
|
73
|
-
@version = "0.7.
|
73
|
+
@version = "0.7.5"
|
74
74
|
@status = "Not connected"
|
75
75
|
@server = "http://localhost/"
|
76
76
|
@user = "rt_user"
|
@@ -437,7 +437,7 @@ class RT_Client
|
|
437
437
|
replies
|
438
438
|
end
|
439
439
|
|
440
|
-
|
440
|
+
# Get a list of history transactions for a ticket. Takes a ticket ID and
|
441
441
|
# an optional format parameter. If the format is ommitted, the short
|
442
442
|
# format is assumed. If the short format is requested, it returns an
|
443
443
|
# array of 2 element arrays, where each 2-element array is [ticket_id,
|
@@ -509,22 +509,16 @@ class RT_Client
|
|
509
509
|
when "attachments"
|
510
510
|
temp = item.match(/Attachments:\s*(.*)/m)
|
511
511
|
if temp.class != NilClass
|
512
|
-
atarr = temp[1].
|
513
|
-
atarr.map { |a| a.gsub!(/^\s*/,"") }
|
512
|
+
atarr = temp[1].scan(/(\d+):\s*(\w+)\s*\((\w+)\)/)
|
514
513
|
atarr.each do |a|
|
515
|
-
i = a.match(/(\d+):\s*(.*)/)
|
516
514
|
s={}
|
517
|
-
s[:id] =
|
518
|
-
s[:name] =
|
519
|
-
|
520
|
-
if sz.class == MatchData
|
521
|
-
s[:name] = sz[1].to_s
|
522
|
-
s[:size] = sz[2].to_s
|
523
|
-
end
|
515
|
+
s[:id] = a[0].to_s
|
516
|
+
s[:name] = a[1].to_s
|
517
|
+
s[:size] = a[2].to_s
|
524
518
|
attachments.push s
|
525
|
-
if s[:name] == 'untitled' # this is the content in HTML, I hope
|
519
|
+
if s[:name] == 'untitled' and s[:size].to_i > 0 # this is the content in HTML, I hope
|
526
520
|
unt_att = get_attachment(id,s[:id])
|
527
|
-
if (unt_att["contenttype"]
|
521
|
+
if (['text/html','text/plain'].include? unt_att["contenttype"]) # hurray
|
528
522
|
reply["content_html"] = sterilize(unt_att["content"])
|
529
523
|
end
|
530
524
|
end
|
@@ -774,8 +768,7 @@ class RT_Client
|
|
774
768
|
# helper to convert responses from RT REST to a hash
|
775
769
|
def response_to_h(resp) # :nodoc:
|
776
770
|
resp.gsub!(/RT\/\d+\.\d+\.\d+\s\d{3}\s.*\n\n/,"") # toss the HTTP response
|
777
|
-
|
778
|
-
|
771
|
+
|
779
772
|
# unfold folded fields
|
780
773
|
# A newline followed by one or more spaces is treated as a
|
781
774
|
# single space
|
data/rtxmlsrv.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
## around the rt/client library.
|
6
6
|
|
7
7
|
require "rubygems" # so we can load gems
|
8
|
-
require "
|
8
|
+
require "rt_client/rt_client" # rt-client REST library
|
9
9
|
require "xmlrpc/server" # that's what we're doing
|
10
10
|
require "date" # for parsing arbitrary date formats
|
11
11
|
|
metadata
CHANGED
@@ -1,69 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rt-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Tom Lahti
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2014-03-07 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rest-client
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0.9'
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0.9'
|
27
|
-
description:
|
28
|
-
|
29
|
-
|
30
|
-
Request Tracker.
|
30
|
+
description: ! "RT_Client is a ruby object that accesses the REST interface version
|
31
|
+
1.0\n of a Request Tracker instance. See http://www.bestpractical.com/ for\n
|
32
|
+
\ Request Tracker.\n"
|
31
33
|
email: tlahti@dmsolutions.com
|
32
34
|
executables: []
|
33
35
|
extensions: []
|
34
36
|
extra_rdoc_files: []
|
35
37
|
files:
|
36
|
-
- ".yardopts"
|
37
38
|
- rt_client.rb
|
38
39
|
- rtxmlsrv.rb
|
39
40
|
- rt/client.rb
|
41
|
+
- .yardopts
|
40
42
|
homepage: http://rubygems.org/gems/rt-client
|
41
43
|
licenses:
|
42
44
|
- APACHE-2.0
|
43
|
-
metadata: {}
|
44
45
|
post_install_message:
|
45
46
|
rdoc_options:
|
46
|
-
-
|
47
|
-
-
|
47
|
+
- --inline-source
|
48
|
+
- --main
|
48
49
|
- RT_Client
|
49
50
|
require_paths:
|
50
|
-
-
|
51
|
+
- .
|
51
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
52
54
|
requirements:
|
53
|
-
- -
|
55
|
+
- - ! '>='
|
54
56
|
- !ruby/object:Gem::Version
|
55
57
|
version: 1.8.6
|
56
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
57
60
|
requirements:
|
58
|
-
- -
|
61
|
+
- - ! '>='
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '0'
|
61
64
|
requirements:
|
62
65
|
- A working installation of RT with the REST 1.0 interface
|
63
66
|
rubyforge_project:
|
64
|
-
rubygems_version:
|
67
|
+
rubygems_version: 1.8.23
|
65
68
|
signing_key:
|
66
69
|
specification_version: 4
|
67
70
|
summary: Ruby object for RT access via REST
|
68
71
|
test_files: []
|
69
|
-
has_rdoc: true
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: c4fced7d3efdfc2bce79c8e560176e52d8ae6df5
|
4
|
-
data.tar.gz: a55fa908b9e3720d11fb942244404052fe7fc6f6
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: db916782f65a180792f7376310cb11c528aa5f451d6d90d92ebacc30e3007b226a17b600589f2335329f1fb2959fb9a9e2583cade4dfcac7203eda2534fb4c27
|
7
|
-
data.tar.gz: 86448e3a01d3817414f5d16499705c728ec6fdb8e30e64604aaf578e6c238e72d1f8e532ab7b2f411982ea5c2455e2fc713279417b380e6736452d86cc40d8c7
|