nifty-email 0.0.4 → 0.0.5

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: aec947947c09cb254e26814c2b1496564a1bf3af
4
- data.tar.gz: 5b5d281625118af3c8efb5e90d4cb29b053a3f76
3
+ metadata.gz: 39588305aa311a21238a6ec36b77c7c4adf1aa30
4
+ data.tar.gz: c2e621511aa880dd8f5e19b1d41bbf6850f8e662
5
5
  SHA512:
6
- metadata.gz: f5ee3c832ae7945d7428be4f0381500b1d7963b9b8190ddac9e23f42dffc39989d1bf47a24b5f0ea002418799d7049dddd423e531aa1a2cf09d66d3aefda257c
7
- data.tar.gz: 2e20a1a2fd300eabbb69f35154c559fd7264dbc6b23452df19b6f4e5c81a59bab4fdd2ce33f6fba028ad14d24e37e06ffe344b872a572dc7d23575b7df73975f
6
+ metadata.gz: c0bf53d147b5b08ac90b8d1fe3f0613b645612b26e740c2e011754bab95e2c2ed28da11fb72405de791d4f1d2198fb58426f9abeacedaeada70d9a943ad5eef2
7
+ data.tar.gz: 0f213501dfe87ec26265b25ec5755a22082e846ddc07aa2f8de324cd4968142760394b6d68651d3e8c2865c0cd5a77bc159ed158b09dad124c0011923d8f0a6e
@@ -1,6 +1,8 @@
1
1
  require 'json'
2
2
 
3
3
  class NiftyEmail
4
+ class NiftyEmailError < StandardError; end
5
+
4
6
  def self.token=(token)
5
7
  @token = token
6
8
  end
@@ -14,7 +16,12 @@ class NiftyEmail
14
16
  connection.authorization('Token', token: @token)
15
17
 
16
18
  response = connection.get("#{slug_or_id}.json", placeholders)
17
- NiftyEmail::Email.new(JSON.parse(response.body))
19
+
20
+ if response.status == 200
21
+ NiftyEmail::Email.new(JSON.parse(response.body))
22
+ else
23
+ raise NiftyEmailError, response.body
24
+ end
18
25
  end
19
26
 
20
27
  class Email
@@ -1,5 +1,5 @@
1
1
  module Nifty
2
2
  module Email
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nifty-email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Albertson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-11 00:00:00.000000000 Z
11
+ date: 2014-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler