roust 1.8.5 → 1.8.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2298e6d0f0bd3c9bd60f21dea7b7b666056aad7
4
- data.tar.gz: ea7acab12c73cdf2ef50d20bd332a44e71ad0886
3
+ metadata.gz: 06d83413925d3be6efe31717c2b7e5d3dc762287
4
+ data.tar.gz: 17fb5123c6b5494c7763ded1ef99705c03e9289d
5
5
  SHA512:
6
- metadata.gz: a604c28a6a017e1261c642f766bb6feece34132b61bb85ab3e47956c196e427ecd513e463f85972ed4a1f6e362c37fc57faea5f9d8df579a2588a75e34732c31
7
- data.tar.gz: d02080811bd8c6a02e5190e7885507cea8870c466b15c40acd7417590c3dfde8259d4f5d975831bbcd7770ccab112599fab286c811b3b5634b3a6086f79fd185
6
+ metadata.gz: 9d21dc4901aa09586a91ebe1d217d02354f8f32b5179af7f26e5c38635c5c0eac3380893a65dd77672e201c0255601a6cbac2f12379d10a8aae91e4a0a45e78f
7
+ data.tar.gz: 1819b32f24930ad13a35c8326c26843a50d023d7f1a8a85e2cec4455a198e4e0864144d1abc12afb47c146c018021fc6047beb49daed14c56a6f4c808648ec20
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roust (1.8.5)
4
+ roust (1.8.6)
5
5
  activesupport (>= 4.0.10)
6
6
  httparty (>= 0.13.1)
7
7
  mail (>= 2.5.4)
@@ -9,7 +9,7 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (4.2.0)
12
+ activesupport (4.2.1)
13
13
  i18n (~> 0.7)
14
14
  json (~> 1.7, >= 1.7.7)
15
15
  minitest (~> 5.1)
@@ -32,8 +32,8 @@ GEM
32
32
  mail (2.6.3)
33
33
  mime-types (>= 1.16, < 3)
34
34
  method_source (0.8.2)
35
- mime-types (2.4.3)
36
- minitest (5.5.1)
35
+ mime-types (2.5)
36
+ minitest (5.6.1)
37
37
  multi_xml (0.5.5)
38
38
  parser (2.2.0.pre.8)
39
39
  ast (>= 1.1, < 3.0)
@@ -66,7 +66,7 @@ GEM
66
66
  ruby-progressbar (1.7.0)
67
67
  safe_yaml (1.0.4)
68
68
  slop (3.6.0)
69
- thread_safe (0.3.4)
69
+ thread_safe (0.3.5)
70
70
  tzinfo (1.2.2)
71
71
  thread_safe (~> 0.1)
72
72
  webmock (1.20.4)
data/README.md CHANGED
@@ -13,6 +13,7 @@ Features
13
13
  - Fetching transactions on individual tickets (in long and short form)
14
14
  - Fetching user details
15
15
  - Adding comments or correspondence to tickets
16
+ - Supports custom HTTP headers (default User-Agent is "Roust")
16
17
 
17
18
  Installing
18
19
  ----------
@@ -36,12 +37,18 @@ Using
36
37
  require 'roust'
37
38
 
38
39
  credentials = {
39
- :server => 'http://rt.example.org',
40
+ :server => 'http://rt.example.org/',
40
41
  :username => 'admin',
41
42
  :password => 's3cr3t'
42
43
  }
43
44
 
44
- rt = Roust.new(credentials)
45
+ # Optional headers:
46
+ headers = {
47
+ 'Host' => 'custom.example.org',
48
+ 'User-Agent' => 'Roust in dev environment'
49
+ }
50
+
51
+ rt = Roust.new(credentials, headers)
45
52
  rt.authenticated? # => true
46
53
 
47
54
  # Query RT
@@ -12,7 +12,7 @@ class Roust
12
12
  include Roust::Queue
13
13
  include Roust::User
14
14
 
15
- def initialize(credentials)
15
+ def initialize(credentials, headers = {})
16
16
  @server = credentials[:server]
17
17
  @username = credentials[:username]
18
18
  @password = credentials[:password]
@@ -21,6 +21,8 @@ class Roust
21
21
  raise ArgumentError, 'The supplied :server has REST in the URL. You only need to specify the base, e.g. http://rt.example.org/'
22
22
  end
23
23
 
24
+ headers['User-Agent'] = 'Roust' unless headers.key?('User-Agent')
25
+ self.class.headers.merge!(headers)
24
26
  authenticate!
25
27
  end
26
28
 
@@ -1,3 +1,3 @@
1
1
  class Roust
2
- VERSION = '1.8.5'
2
+ VERSION = '1.8.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roust
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.5
4
+ version: 1.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -134,36 +134,4 @@ rubygems_version: 2.2.2
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Ruby client for RT's REST API
137
- test_files:
138
- - spec/mocks/queue-13.txt
139
- - spec/mocks/queue-nil.txt
140
- - spec/mocks/ticket-1-history-long.txt
141
- - spec/mocks/ticket-1-history-short.txt
142
- - spec/mocks/ticket-1-show-unauthenticated.txt
143
- - spec/mocks/ticket-1-show.txt
144
- - spec/mocks/ticket-100-comment.txt
145
- - spec/mocks/ticket-100-show.txt
146
- - spec/mocks/ticket-100-update.txt
147
- - spec/mocks/ticket-101-comment.txt
148
- - spec/mocks/ticket-101-show.txt
149
- - spec/mocks/ticket-150-links-update.txt
150
- - spec/mocks/ticket-150-links.txt
151
- - spec/mocks/ticket-151-links-update.txt
152
- - spec/mocks/ticket-151-links.txt
153
- - spec/mocks/ticket-3-links.txt
154
- - spec/mocks/ticket-99-show.txt
155
- - spec/mocks/ticket-create.txt
156
- - spec/mocks/ticket-search-1-or-2-long.txt
157
- - spec/mocks/ticket-search-1-or-2.txt
158
- - spec/mocks/ticket-search-that-does-not-exist.txt
159
- - spec/mocks/user-dan@us.example-after-edit.txt
160
- - spec/mocks/user-dan@us.example-edit.txt
161
- - spec/mocks/user-dan@us.example.txt
162
- - spec/mocks/user-erin@us.example-create.txt
163
- - spec/mocks/user-erin@us.example.txt
164
- - spec/mocks/user-nil.txt
165
- - spec/roust/authentication_spec.rb
166
- - spec/roust/queue_spec.rb
167
- - spec/roust/ticket_spec.rb
168
- - spec/roust/user_spec.rb
169
- - spec/spec_helper.rb
137
+ test_files: []