ticket_abstractor_client 1.12.0 → 1.13.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 865c293ed14100dac305dad9f7e5e89dc946a225
4
- data.tar.gz: f258b712c6292b6c98258da14d01cd94481931b7
3
+ metadata.gz: 2d0dbd0ba83af9e4ed48a13a8a824cb7cf14d816
4
+ data.tar.gz: 63f0f970905787372ebd2939198cb17adac1f39c
5
5
  SHA512:
6
- metadata.gz: 2a8e7a4ef192d1d4954eb6e45ac2c855fb4345fd1835e88ef6ea0ee9bfdf3f337549bc7f9f25701b4ed42a39531ed12740fc3a3bf7eab5c49648144de83f56a5
7
- data.tar.gz: 6f096c71a99832916d87b440c937d4f8d2f94fcbeee9d0fe0de1c381d32f54de2575f085ba7574e181c39ba1fe834dab1f703d638707c3b1d8f3ab4921fcdc7b
6
+ metadata.gz: f55806671a930c5031bfe12b766e5cbfdb1566f5379a4839b9b3d8d4c2bdeb5fbc00aab66add0505cc9c06430e8dfb2296c9277284f57930bc312b90186b3813
7
+ data.tar.gz: 856c2c09de70bc4eec5fbebf703c014ded56a74627539af15da406720c00662c785f5e0bceae08bd0e032e98e153ccb4ae995a51046b27597f40603999b89fea
@@ -1,6 +1,6 @@
1
1
  class TicketAbstractorClient::Client
2
2
  def initialize(base_url, security_token = nil)
3
- @base_url = resolve_host(base_url)
3
+ @base_url = base_url
4
4
  @security_token = security_token
5
5
  end
6
6
 
@@ -8,7 +8,11 @@ class TicketAbstractorClient::Client
8
8
  params.merge! args: args.to_json, security_token: @security_token
9
9
  response = RestClient.get("#{@base_url}/#{url}", params: params)
10
10
 
11
- JSON.parse response
11
+ if response.headers[:file_request]
12
+ response
13
+ else
14
+ JSON.parse response
15
+ end
12
16
  end
13
17
 
14
18
  def post(url, args = {}, params = {})
@@ -17,10 +21,4 @@ class TicketAbstractorClient::Client
17
21
 
18
22
  JSON.parse response
19
23
  end
20
-
21
- private
22
-
23
- def resolve_host(host)
24
- EM::Synchrony.sync(EM::DNS::Resolver.resolve(host)).first
25
- end
26
24
  end
@@ -108,6 +108,13 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
108
108
  get_with_endpoint 'jira/get_all_fields'
109
109
  end
110
110
 
111
+ def download_attachment(attachment_id, attachment_name)
112
+ get_with_endpoint(
113
+ 'jira/download_attachment',
114
+ { attachment_id: attachment_id, attachment_name: attachment_name }
115
+ )
116
+ end
117
+
111
118
  def create_issue(opts = {}, *attachments)
112
119
  post_with_endpoint 'jira/create_issue', { opts: opts }, attachments: attachments
113
120
  end
@@ -1,3 +1,3 @@
1
1
  module TicketAbstractorClient
2
- VERSION = '1.12.0'
2
+ VERSION = '1.13.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticket_abstractor_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rsamoilov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-25 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler