vimaly 0.2.1 → 0.2.2

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: 956fd4a26b6f2eba08ed381f2742879e1e95067c
4
- data.tar.gz: 501b0918f52ac4a7a039163cc0a15600982cf0b7
3
+ metadata.gz: 9096c5aaa8c67a33674de730a6f59333237ab1de
4
+ data.tar.gz: 8b93b163163beb27266c42f7cf4f5f5d9229186c
5
5
  SHA512:
6
- metadata.gz: 35e629bd3feb3ff0f584e3211f01a570b06fe96d93e83f87f73eca4ea0892658f5cc7534c52f8af4a133cc8e7242fabbca23b3c7e28b908ef06f1e16401c9634
7
- data.tar.gz: a213d402482328b805eafef6c6454c6d1a3b5646df734dc2e614c931ff2c24dd97fbbf6f95ea62e620d72f403d5b81312a515547d22fd559e5b5ad67c90b2526
6
+ metadata.gz: aef40b111d7794708b3ad2fd96c6822faf1617e9ed965479a7afeccf16818f05452b36d8e2a0f8a22be9e2c717e4e961dfb146e0d52b78cfc0393bad41f8bfbb
7
+ data.tar.gz: 4606c1b59c0160dde277990657a6ca07efd05634e0fb81ef0230db556dfe48abb8b66ced8b7d6038d24b018b13cce96976e8825421720cb7bd89f40474a8d5c5
data/CHANGELOG.md CHANGED
@@ -1,12 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 0.1.0 (not yet released)
3
+ ## 0.2.2
4
4
 
5
- * initial copy from the `investapp`
5
+ * handle Bad Gateway 502 errors
6
+
7
+ ## 0.2.1
8
+
9
+ * Fix creation of duplicated tickets (due to caching)
6
10
 
7
11
  ## 0.2.0
8
12
 
9
13
  * Support the ability to retrieve all tickets for a bin, and to run a matcher through this
10
14
  * Support custom fields on ticket
11
15
  * Add an integration test (site configured)
12
-
data/lib/vimaly/client.rb CHANGED
@@ -30,8 +30,8 @@ module Vimaly
30
30
  ticket_to_json = ticket.to_json(custom_field_name_map)
31
31
  response = post("/tickets/#{next_ticket_id}", ticket_to_json)
32
32
  case response.status
33
- when 200..299
34
- true
33
+ when 200..299
34
+ true
35
35
  else
36
36
  log_warn "status: #{response.status}"
37
37
  log_warn " #{response.inspect}"
@@ -40,16 +40,16 @@ module Vimaly
40
40
  end
41
41
 
42
42
  def update_ticket(id, other_fields)
43
- ticket = Ticket.new(other_fields)
43
+ ticket = Ticket.new(other_fields)
44
44
 
45
45
  response = put("/tickets/#{id}", ticket.to_json(custom_field_name_map, true))
46
46
  case response.status
47
- when 200..299
48
- true
49
- else
50
- log_warn "status: #{response.status}"
51
- log_warn " #{response.inspect}"
52
- false
47
+ when 200..299
48
+ true
49
+ else
50
+ log_warn "status: #{response.status}"
51
+ log_warn " #{response.inspect}"
52
+ false
53
53
  end
54
54
  end
55
55
 
@@ -143,7 +143,7 @@ module Vimaly
143
143
  request.headers.update({ accept: 'application/json', content_type: 'application/json' })
144
144
  end
145
145
  unless response.success?
146
- raise("Vimaly #{api_path} call failed with response #{response.status}")
146
+ raise Vimaly::ConnectionError.new("Vimaly #{api_path} call failed with response #{response.status}")
147
147
  end
148
148
  JSON.parse(response.body)
149
149
  end
@@ -0,0 +1,3 @@
1
+ module Vimaly
2
+ class ConnectionError < RuntimeError; end
3
+ end
@@ -1,3 +1,3 @@
1
1
  module Vimaly
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/vimaly.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require_relative "vimaly/version"
2
+ require_relative "vimaly/exceptions"
2
3
  require_relative "vimaly/bin"
3
4
  require_relative "vimaly/ticket_type"
4
5
  require_relative "vimaly/ticket"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimaly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thorsten Boettger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-15 00:00:00.000000000 Z
11
+ date: 2017-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -156,6 +156,7 @@ files:
156
156
  - lib/vimaly.rb
157
157
  - lib/vimaly/bin.rb
158
158
  - lib/vimaly/client.rb
159
+ - lib/vimaly/exceptions.rb
159
160
  - lib/vimaly/ticket.rb
160
161
  - lib/vimaly/ticket_type.rb
161
162
  - lib/vimaly/version.rb
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  version: '0'
181
182
  requirements: []
182
183
  rubyforge_project:
183
- rubygems_version: 2.5.1
184
+ rubygems_version: 2.6.8
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: Wrapper for the Vimaly API