refine-ruby 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/refine.rb +19 -1
  3. data/lib/refine/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a47519514b8ca03a9afc1c6ea89d9b91bdcdc867
4
- data.tar.gz: 616c60139e5fd9809897c92b0fb6baf268d411ef
3
+ metadata.gz: 7df2e18859fbea519c5efa00abb703e9b9526e47
4
+ data.tar.gz: b00280d0df07118edbada916cab43acd26ef3f60
5
5
  SHA512:
6
- metadata.gz: 2c83ab32fa133f3591d85121212cb4ef628c4893445fcc40a8bc930e4c2ca3fcb3254c491904dc8fd556ca7896a9620674cf49694f9498dde21c146c33cfcfe1
7
- data.tar.gz: 06a5cf9eaacc3cb34f13d384fc5c14a16aa3181bb25a75ab7f0a1a2e3bc5bdfce62cf51b20cbd90dc9fbfb920e2789c81cbbd2ae5f0b40c825cd7192b7821a87
6
+ metadata.gz: bace87dc60db64611b32c9032e1e961c0cc165a9c7daf5ef8002ae0efb4ab3d9eeb583458aad4b184191779cf79eaf8324fca450442917724fa0564f94716a27
7
+ data.tar.gz: 1bd2b3f0d1e95108fec1bbe8954730ebbbfa48dd04780435cbdfe89b0cabe6e795b302cfb1d05e43aac3c9fe06334f9d0d795207cdf19206d59cb356ecf01f1b
@@ -4,6 +4,20 @@ require 'json'
4
4
  require "addressable/uri"
5
5
 
6
6
  class Refine
7
+ class ProjectNotFound < Exception
8
+ attr_reader :project_id, :server
9
+
10
+ def initialize(message, project_id:, server:)
11
+ super(message)
12
+ @project_id = project_id
13
+ @server = server
14
+ end
15
+
16
+ def to_s
17
+ super + " (#{@server})"
18
+ end
19
+ end
20
+
7
21
  attr_reader :project_name
8
22
  attr_reader :project_id
9
23
 
@@ -27,7 +41,11 @@ class Refine
27
41
  @project_id = opts["project_id"]
28
42
 
29
43
  metadata = self.get_project_metadata
30
- @project_name = CGI.escape(metadata["name"])
44
+ if metadata['status'] == 'error'
45
+ raise ProjectNotFound.new(metadata['message'], project_id: @project_id, server: @server)
46
+ else
47
+ @project_name = CGI.escape(metadata["name"])
48
+ end
31
49
  end
32
50
  end
33
51
 
@@ -1,3 +1,3 @@
1
1
  class Refine
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refine-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Buxton
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-08-15 00:00:00.000000000 Z
14
+ date: 2018-08-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.4.5.1
161
+ rubygems_version: 2.6.13
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Client library for interacting with Google Refine instances