keymaker 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -78,6 +78,7 @@ Coming soon
78
78
  - Avdi Grimm
79
79
  - Micah Cooper
80
80
  - Stephen Caudill
81
+ - Travis Anderson
81
82
 
82
83
  ## Copyright
83
84
  Copyright (c) 2012 [Rogelio J. Samour](mailto:rogelio@therubymug.com)
data/keymaker.gemspec CHANGED
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
14
14
  ## If your rubyforge_project name is different, then edit it and comment out
15
15
  ## the sub! line in the Rakefile
16
16
  s.name = 'keymaker'
17
- s.version = '0.0.1'
18
- s.date = '2012-06-06'
17
+ s.version = '0.0.2'
18
+ s.date = '2012-06-07'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
21
21
  ## as you like.
@@ -82,7 +82,9 @@ Gem::Specification.new do |s|
82
82
  lib/keymaker/serialization.rb
83
83
  lib/keymaker/service.rb
84
84
  lib/keymaker/update_node_properties_request.rb
85
- spec/lib/keymaker_integration_spec.rb
85
+ spec/keymaker/configuration_spec.rb
86
+ spec/keymaker/service_spec.rb
87
+ spec/keymaker_spec.rb
86
88
  spec/spec_helper.rb
87
89
  spec/support/keymaker.rb
88
90
  ]
@@ -33,6 +33,15 @@ module Keymaker
33
33
  url_opts[:scheme] = protocol
34
34
  url_opts[:host] = server
35
35
  url_opts[:port] = port
36
+ end
37
+ end
38
+
39
+ def connection_service_root_url
40
+ Addressable::URI.new(connection_url_opts)
41
+ end
42
+
43
+ def connection_url_opts
44
+ url_opts.tap do |url_opts|
36
45
  url_opts[:user] = username if username
37
46
  url_opts[:password] = password if password
38
47
  end
@@ -15,7 +15,7 @@ module Keymaker
15
15
  end
16
16
 
17
17
  def connection
18
- @connection ||= Faraday.new(url: config.service_root) do |conn|
18
+ @connection ||= Faraday.new(url: config.connection_service_root_url) do |conn|
19
19
  conn.request :json
20
20
  conn.use FaradayMiddleware::ParseJson, content_type: /\bjson$/
21
21
  conn.adapter :net_http
data/lib/keymaker.rb CHANGED
@@ -24,7 +24,7 @@ require 'keymaker/node'
24
24
 
25
25
  module Keymaker
26
26
 
27
- VERSION = "0.0.1"
27
+ VERSION = "0.0.2"
28
28
 
29
29
  def self.service
30
30
  @service ||= Keymaker::Service.new(Keymaker::Configuration.new)
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Keymaker::Configuration do
4
+
5
+ context "with credentials provided" do
6
+ let(:options) { { username: "jconnor", password: "easymoney" } }
7
+ let(:config) do
8
+ Keymaker::Configuration.new(options)
9
+ end
10
+
11
+ describe "#node_uri" do
12
+ it "should not contain credentials" do
13
+ config.node_uri(42).should_not include("jconnor:easymoney@")
14
+ end
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe Keymaker::Service do
4
+
5
+ context "with credentials provided" do
6
+ let(:options) { { username: "jconnor", password: "easymoney" } }
7
+ let(:config) do
8
+ Keymaker::Configuration.new(options)
9
+ end
10
+ let(:service) { Keymaker::Service.new(config) }
11
+
12
+ describe "#connection" do
13
+ it "includes the username and password" do
14
+ Faraday.should_receive(:new).with(url: config.connection_service_root_url)
15
+ service.connection
16
+ end
17
+ end
18
+ end
19
+
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keymaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-06 00:00:00.000000000 Z
13
+ date: 2012-06-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -158,7 +158,9 @@ files:
158
158
  - lib/keymaker/serialization.rb
159
159
  - lib/keymaker/service.rb
160
160
  - lib/keymaker/update_node_properties_request.rb
161
- - spec/lib/keymaker_integration_spec.rb
161
+ - spec/keymaker/configuration_spec.rb
162
+ - spec/keymaker/service_spec.rb
163
+ - spec/keymaker_spec.rb
162
164
  - spec/spec_helper.rb
163
165
  - spec/support/keymaker.rb
164
166
  homepage: https://github.com/therubymug/keymaker
@@ -175,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
175
177
  version: '0'
176
178
  segments:
177
179
  - 0
178
- hash: -3417876533899238016
180
+ hash: 3389385073700397945
179
181
  required_rubygems_version: !ruby/object:Gem::Requirement
180
182
  none: false
181
183
  requirements:
@@ -189,6 +191,8 @@ signing_key:
189
191
  specification_version: 2
190
192
  summary: A multi-layer REST API wrapper for neo4j.
191
193
  test_files:
192
- - spec/lib/keymaker_integration_spec.rb
194
+ - spec/keymaker/configuration_spec.rb
195
+ - spec/keymaker/service_spec.rb
196
+ - spec/keymaker_spec.rb
193
197
  - spec/spec_helper.rb
194
198
  - spec/support/keymaker.rb