keymaker 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -0
- data/keymaker.gemspec +5 -3
- data/lib/keymaker/configuration.rb +9 -0
- data/lib/keymaker/service.rb +1 -1
- data/lib/keymaker.rb +1 -1
- data/spec/keymaker/configuration_spec.rb +18 -0
- data/spec/keymaker/service_spec.rb +20 -0
- data/spec/{lib/keymaker_integration_spec.rb → keymaker_spec.rb} +0 -0
- metadata +9 -5
data/README.md
CHANGED
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.
|
18
|
-
s.date = '2012-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/
|
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
|
data/lib/keymaker/service.rb
CHANGED
@@ -15,7 +15,7 @@ module Keymaker
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def connection
|
18
|
-
@connection ||= Faraday.new(url: config.
|
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
@@ -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
|
File without changes
|
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.
|
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-
|
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/
|
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:
|
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/
|
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
|