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.
- checksums.yaml +4 -4
- data/lib/refine.rb +19 -1
- data/lib/refine/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7df2e18859fbea519c5efa00abb703e9b9526e47
|
4
|
+
data.tar.gz: b00280d0df07118edbada916cab43acd26ef3f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bace87dc60db64611b32c9032e1e961c0cc165a9c7daf5ef8002ae0efb4ab3d9eeb583458aad4b184191779cf79eaf8324fca450442917724fa0564f94716a27
|
7
|
+
data.tar.gz: 1bd2b3f0d1e95108fec1bbe8954730ebbbfa48dd04780435cbdfe89b0cabe6e795b302cfb1d05e43aac3c9fe06334f9d0d795207cdf19206d59cb356ecf01f1b
|
data/lib/refine.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/refine/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|