growviral-keystore 0.0.5 → 0.0.6

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: 7b99c09aab3e417bc28613e87b23538dc866bbef
4
- data.tar.gz: 16518df608440e3984ac945297977dcb9a70c96c
3
+ metadata.gz: 1b7f2c80c08f7de11508489e93a4136088d7453d
4
+ data.tar.gz: 6f1437985f5049051c63c8616576c7777738123a
5
5
  SHA512:
6
- metadata.gz: c511ad0f47ef8f563f12f805f99941e3f42e19d439d5a633a8e87a7cbcec67da998b620fdceb43588aaa1eb2660508ccdb12e8fec6dbff1ade82841b531ec237
7
- data.tar.gz: c7c8b68dd7c66a2f5eb536949f85d48fd971aa93512e0be895eec12bf5e85ac1d83c4d711c0d0b07b7b9fae351e9b76791ffdf2f73d80210077cef9a1dbc1875
6
+ metadata.gz: b91c9cf5e114edc8ed8905e890b9e7d6c8ed69d5ffaeee38840dd612f57f7fa3e50f53907880593476cc1ce71abba342af5f25df803999f6d880bd92abbf184c
7
+ data.tar.gz: 4fde4fdfcd1b86e1f90fe8613153a4f9856e038b3f8905aa07700ddfe87a4a7c97982730632e54d577fa010cce5531041a98ee9c0befe600956173877ca91924
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # The GrowViral Keystore Gem
1
+ e The GrowViral Keystore Gem
2
2
  [![Build Status](https://magnum.travis-ci.com/growviral/keystore_gem.svg?token=5DZ6DA56Z8u55VnUypyT)](https://magnum.travis-ci.com/growviral/keystore_gem)
3
3
 
4
4
  A simple wrapper for the GrowViral Keystore.
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'growviral/keystore/version'
4
+ require 'keystore/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "growviral-keystore"
@@ -9,6 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Jeremy Walker"]
10
10
  spec.email = ["jez.walker@gmail.com"]
11
11
  spec.summary = %q{A wrapper for the GrowViral keystore functionality.}
12
+ spec.description = ""
12
13
  spec.homepage = ""
13
14
  spec.license = "MIT"
14
15
 
@@ -2,18 +2,21 @@ require "net/http"
2
2
  require "uri"
3
3
  require 'json'
4
4
 
5
- require "growviral/keystore/version"
6
- require "growviral/client"
7
- require "growviral/configuration"
5
+ require "keystore/version"
6
+ require "keystore/client"
7
+ require "keystore/configuration"
8
8
 
9
- require "growviral/application"
10
- require "growviral/application_fetcher"
9
+ require "keystore/application"
10
+ require "keystore/application_fetcher"
11
11
 
12
- require "growviral/account"
13
- require "growviral/account_fetcher"
14
- require "growviral/account_creator"
12
+ require "keystore/account"
13
+ require "keystore/account_fetcher"
14
+ require "keystore/account_creator"
15
15
 
16
16
  module GrowViral
17
17
  module Keystore
18
18
  end
19
+
20
+ class HandleNotUidError < RuntimeError
21
+ end
19
22
  end
File without changes
File without changes
@@ -5,10 +5,12 @@ module GrowViral
5
5
  new(*args).fetch
6
6
  end
7
7
 
8
- attr_reader :application_id, :handle, :config
9
- def initialize(application_id, handle, deps)
8
+ attr_reader :application_id, :uid, :config
9
+ def initialize(application_id, uid, deps)
10
+ raise HandleNotUidError unless uid.is_a? Numeric
11
+
10
12
  @application_id = application_id
11
- @handle = handle
13
+ @uid = uid
12
14
  @config = deps[:config]
13
15
  end
14
16
 
@@ -18,7 +20,7 @@ module GrowViral
18
20
  end
19
21
 
20
22
  def uri
21
- @uri ||= URI.parse("#{config.host}/applications/#{application_id}/accounts/#{handle}")
23
+ @uri ||= URI.parse("#{config.host}/applications/#{application_id}/accounts/#{uid}")
22
24
  end
23
25
  end
24
26
  end
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  module GrowViral
2
2
  module Keystore
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -1,6 +1,11 @@
1
1
  require_relative 'test_helper'
2
2
 
3
3
  class AccountFetcherTest < Minitest::Test
4
+ def test_raises_for_a_handle
5
+ client = GrowViral::Keystore::Client.new(:development)
6
+ assert_raises(GrowViral::HandleNotUidError) { client.fetch_account(213, "string") }
7
+ end
8
+
4
9
  def test_response_is_correct
5
10
  application_id = 43
6
11
  uid = 1231212
@@ -16,11 +21,11 @@ class AccountFetcherTest < Minitest::Test
16
21
  "secret" => secret
17
22
  }
18
23
 
19
- uri = URI.parse("http://localhost:3000/applications/#{application_id}/accounts/#{handle}")
24
+ uri = URI.parse("http://localhost:3000/applications/#{application_id}/accounts/#{uid}")
20
25
  Net::HTTP.expects(:get_response).with(uri).returns(mock(body: output.to_json))
21
26
 
22
27
  client = GrowViral::Keystore::Client.new(:development)
23
- account = client.fetch_account(application_id, handle)
28
+ account = client.fetch_account(application_id, uid)
24
29
 
25
30
  assert_equal application_id, account.application_id
26
31
  assert_equal uid, account.uid
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: growviral-keystore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-19 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description:
69
+ description: ''
70
70
  email:
71
71
  - jez.walker@gmail.com
72
72
  executables: []
@@ -80,15 +80,15 @@ files:
80
80
  - README.md
81
81
  - Rakefile
82
82
  - growviral-keystore.gemspec
83
- - lib/growviral/account.rb
84
- - lib/growviral/account_creator.rb
85
- - lib/growviral/account_fetcher.rb
86
- - lib/growviral/application.rb
87
- - lib/growviral/application_fetcher.rb
88
- - lib/growviral/client.rb
89
- - lib/growviral/configuration.rb
90
83
  - lib/growviral/keystore.rb
91
- - lib/growviral/keystore/version.rb
84
+ - lib/keystore/account.rb
85
+ - lib/keystore/account_creator.rb
86
+ - lib/keystore/account_fetcher.rb
87
+ - lib/keystore/application.rb
88
+ - lib/keystore/application_fetcher.rb
89
+ - lib/keystore/client.rb
90
+ - lib/keystore/configuration.rb
91
+ - lib/keystore/version.rb
92
92
  - test/account_creator_test.rb
93
93
  - test/account_fetcher_test.rb
94
94
  - test/account_test.rb