ticket_abstractor_client 1.2.0 → 1.2.1

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: 4249d525374259adfc4e34a5eda40940e121eee4
4
- data.tar.gz: 2782077ca515847ae6564ba655395e66a0f03362
3
+ metadata.gz: 3d4b100643edb6d3a0bcd8bd883bc5cfaa3d8413
4
+ data.tar.gz: aae575bb97a42a538e67dce8244b7842b3767f70
5
5
  SHA512:
6
- metadata.gz: 5e5ab88771c8ed0a1c9ebfc808690be0b391d57d8a0dbfc1bac5edd23b2fbd7590e5b89afc6118a6d86de5f52aedbdb7b88111af2e45c7cfeb8a50739e4eb3f0
7
- data.tar.gz: 753c831d8ffa3f67e18b58f5280f012b9a703422c1bb5a8dcbdf96f8c8a95badbd4806f19da6a00791be84015053d81bd475a8498cd3c311a7ec3831adb5fffa
6
+ metadata.gz: 1d8c6a07b15be73578c46378e63a265a0d76e1f0bccd3e44618d17865c1d124068e99129aa65d65e08eec79bccb0f5c0d835860f9ec98d84740baf8ba90ce915
7
+ data.tar.gz: 401ffcf66cebe83cfcdbd23967343c8717a426e05ea8353a96294fcd8fccf239b08e35ec05263796f88c9811864c65a9babdb065e26d026e3a9ac38d194b3cc6
@@ -5,6 +5,16 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
5
5
  @jira_endpoint = endpoint
6
6
  end
7
7
 
8
+ def get_with_endpoint(url, args = {}, params = {})
9
+ params.merge! jira_endpoint: @jira_endpoint
10
+ get url, args, params
11
+ end
12
+
13
+ def post_with_endpoint(url, args = {}, params = {})
14
+ params.merge! jira_endpoint: @jira_endpoint
15
+ post url, args, params
16
+ end
17
+
8
18
  ##
9
19
  # Get jira issue by issue id
10
20
  #
@@ -16,7 +26,7 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
16
26
  # >> client.jira.get_issue 'IFS-123'
17
27
  # => { 'id' => 'IFS-123', 'description' => '...', ... }
18
28
  def get_issue(issue_key)
19
- get "ticket/jira/#{issue_key}", jira_endpoint: @jira_endpoint
29
+ get_with_endpoint "ticket/jira/#{issue_key}"
20
30
  end
21
31
 
22
32
  ##
@@ -34,15 +44,15 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
34
44
  end
35
45
 
36
46
  def get_issues_by_query(query)
37
- get "jira_v1/get_issues_by_query", query: query, jira_endpoint: @jira_endpoint
47
+ get_with_endpoint "jira_v1/get_issues_by_query", query: query
38
48
  end
39
49
 
40
50
  def get_users_by_query(query)
41
- get 'jira_v1/get_users_by_query', query: query, jira_endpoint: @jira_endpoint
51
+ get_with_endpoint 'jira_v1/get_users_by_query', query: query
42
52
  end
43
53
 
44
54
  def get_issues_statuses_by_search_query(issues_id)
45
- get 'jira/get_issues_statuses_by_search_query', issues_id: issues_id, jira_endpoint: @jira_endpoint
55
+ get_with_endpoint 'jira/get_issues_statuses_by_search_query', issues_id: issues_id
46
56
  end
47
57
 
48
58
  ##
@@ -56,26 +66,26 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
56
66
  # >> client.jira.get_issues_by_filter 24320
57
67
  # => [{ 'id' => 'ID-1', ... }, { 'id' => 'ID-2', ... }]
58
68
  def get_issues_by_filter(filter_id)
59
- get 'jira/get_issues_by_filter', filter_id: filter_id, jira_endpoint: @jira_endpoint
69
+ get_with_endpoint 'jira/get_issues_by_filter', filter_id: filter_id
60
70
  end
61
71
 
62
72
  def get_fields_by_project(project_key)
63
- get 'jira/get_fields_by_project', project_key: project_key, jira_endpoint: @jira_endpoint
73
+ get_with_endpoint 'jira/get_fields_by_project', project_key: project_key
64
74
  end
65
75
 
66
76
  def create_issue(opts = {}, *attachments)
67
- post('jira/create_issue', { opts: opts, jira_endpoint: @jira_endpoint }, attachments: attachments)
77
+ post_with_endpoint('jira/create_issue', { opts: opts }, attachments: attachments)
68
78
  end
69
79
 
70
80
  def create_tvx_issue(opts = {})
71
- post 'ticket/jira', opts.merge(jira_endpoint: @jira_endpoint)
81
+ post_with_endpoint 'ticket/jira', opts
72
82
  end
73
83
 
74
84
  def update_issue(opts = {}, *attachments)
75
- post("jira/update_issue?jira_endpoint=#{@jira_endpoint}", { opts: opts }, attachments: attachments)
85
+ post_with_endpoint('jira/update_issue', { opts: opts }, attachments: attachments)
76
86
  end
77
87
 
78
88
  def add_comment(issue_key, comment)
79
- post 'jira/add_comment', issue_key: issue_key, comment: comment, jira_endpoint: @jira_endpoint
89
+ post_with_endpoint 'jira/add_comment', issue_key: issue_key, comment: comment
80
90
  end
81
91
  end
@@ -1,3 +1,3 @@
1
1
  module TicketAbstractorClient
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
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.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rsamoilov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-17 00:00:00.000000000 Z
11
+ date: 2014-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler