slipcover 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/slipcover/server.rb +12 -2
- data/lib/slipcover/version.rb +1 -1
- data/spec/server_spec.rb +30 -0
- data/spec/support/slipcover.yml +2 -2
- 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: a8235e0960e7f322d83876b91dc94d0d34883831
|
4
|
+
data.tar.gz: f16b709e7881cfc0458a74f1c0968bd9d2cd8ab2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fba538515310312341f92cff1438f8d54dfb18d8df22ff71e05942ee377bf06e6f7c32c45ec4a91dda88f7bc4fd6f176a78865ac72395d62802531b558b0ff5
|
7
|
+
data.tar.gz: 0b431d90fd29e1db6ddb9a094e7d9024efda0cee6558643474718727dfa8b85ecf1972aa57e6d14034eca413095100c87d60fe22911de3766e41820efd0251d6
|
data/README.md
CHANGED
@@ -29,8 +29,10 @@ Put a `slipcover.yml` in your config directory. Here is a sample:
|
|
29
29
|
|
30
30
|
production:
|
31
31
|
host: socialcoders.couchservice.com
|
32
|
-
username:
|
33
|
-
password:
|
32
|
+
username: COUCH_USERNAME
|
33
|
+
password: COUCH_PASSWORD
|
34
|
+
|
35
|
+
COUCH_USERNAME/PASSWORD are the keys for the username and password in your env.
|
34
36
|
|
35
37
|
#### Create a database:
|
36
38
|
|
data/lib/slipcover/server.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'yaml'
|
1
2
|
module Slipcover
|
2
3
|
class Server < Struct.new(:path, :key)
|
3
4
|
def server_configs
|
@@ -13,8 +14,8 @@ module Slipcover
|
|
13
14
|
end
|
14
15
|
|
15
16
|
def user_info
|
16
|
-
info =
|
17
|
-
info << ":#{
|
17
|
+
info = "" + username
|
18
|
+
info << ":#{password}" unless info.empty?
|
18
19
|
info << "@" unless info.empty?
|
19
20
|
info
|
20
21
|
end
|
@@ -26,5 +27,14 @@ module Slipcover
|
|
26
27
|
def port
|
27
28
|
config['port'] ? ":#{config['port']}" : ''
|
28
29
|
end
|
30
|
+
|
31
|
+
# We're interpolating this because Ruby freezes double hash reference strings
|
32
|
+
def username
|
33
|
+
config['couch_username_key'] ? "#{ENV[config['couch_username_key']]}" : ""
|
34
|
+
end
|
35
|
+
|
36
|
+
def password
|
37
|
+
config['couch_password_key'] ? "#{ENV[config['couch_password_key']]}" : ""
|
38
|
+
end
|
29
39
|
end
|
30
40
|
end
|
data/lib/slipcover/version.rb
CHANGED
data/spec/server_spec.rb
CHANGED
@@ -4,6 +4,13 @@ describe Slipcover::Server do
|
|
4
4
|
let(:server) { Slipcover::Server.new(config_path, env) }
|
5
5
|
let(:config_path) { File.dirname(__FILE__) + "/support/slipcover.yml" }
|
6
6
|
let(:env) { 'development' }
|
7
|
+
let(:username) { 'username' }
|
8
|
+
let(:password) { 'password' }
|
9
|
+
|
10
|
+
before do
|
11
|
+
ENV['COUCH_USERNAME'] = username
|
12
|
+
ENV['COUCH_PASSWORD'] = password
|
13
|
+
end
|
7
14
|
|
8
15
|
context "when the host is a local address" do
|
9
16
|
describe "#url" do
|
@@ -21,4 +28,27 @@ describe Slipcover::Server do
|
|
21
28
|
end
|
22
29
|
end
|
23
30
|
end
|
31
|
+
|
32
|
+
context "configured credientials" do
|
33
|
+
let(:env) { 'production' }
|
34
|
+
let(:username) { 'Astronaut' }
|
35
|
+
let(:password) { 'paddle-boarding' }
|
36
|
+
|
37
|
+
before do
|
38
|
+
ENV['COUCH_USERNAME'] = username
|
39
|
+
ENV['COUCH_PASSWORD'] = password
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "username" do
|
43
|
+
it "gets it from the env" do
|
44
|
+
server.username.should == username
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "password" do
|
49
|
+
it "gets it from the env" do
|
50
|
+
server.password.should == password
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
24
54
|
end
|
data/spec/support/slipcover.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slipcover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kane Baccigalupi
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-05-
|
14
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.2.2
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Lite wrapper for CouchDB
|