dragonfly-scp_data_store 0.0.2 → 0.0.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54a0456bd124d12f32d6766d024c7d602f6377b5
|
4
|
+
data.tar.gz: a2ff78268dd6222ef774c879590154b91c70009e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3244e60c9a2bea1a6c95c03de95b8b87b56b7f20ec61449e2bbe7ed748b5daf60fa2ee8ca594560cb1ac8c89a6525bd5242aa924921243b0862095c076a62d41
|
7
|
+
data.tar.gz: 6ca87d2eae8247bd686fbc5427dec2ef983f99886326254e57b88408c77c7e413bf71b9e2ea807674a7aff7fbe7276ce52d044c97e0e306dc6bade97f3208511
|
@@ -6,6 +6,8 @@ require 'net/scp'
|
|
6
6
|
|
7
7
|
module Dragonfly
|
8
8
|
module ScpDataStore
|
9
|
+
class DataNotFound < RuntimeError; end
|
10
|
+
|
9
11
|
class DataStore
|
10
12
|
include ::Dragonfly::Configurable
|
11
13
|
|
@@ -43,7 +45,7 @@ module Dragonfly
|
|
43
45
|
end
|
44
46
|
|
45
47
|
def destroy(uid)
|
46
|
-
|
48
|
+
true
|
47
49
|
end
|
48
50
|
|
49
51
|
private
|
@@ -12,7 +12,7 @@ describe Dragonfly::ScpDataStore::DataStore do
|
|
12
12
|
folder: "images",
|
13
13
|
base_url: "localhost:3000/images",
|
14
14
|
)
|
15
|
-
end
|
15
|
+
end
|
16
16
|
|
17
17
|
it { data_store.host.should eq("localhost") }
|
18
18
|
it { data_store.username.should eq("root") }
|
@@ -44,4 +44,42 @@ describe Dragonfly::ScpDataStore::DataStore do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
47
|
+
|
48
|
+
describe "#retrieve" do
|
49
|
+
let(:data_store) do
|
50
|
+
Dragonfly::ScpDataStore::DataStore.new(
|
51
|
+
host: "localhost",
|
52
|
+
username: "root",
|
53
|
+
password: "password",
|
54
|
+
folder: "../fixtures/images",
|
55
|
+
base_url: "http://localhost:3000/images",
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
context :failure do
|
60
|
+
it "returns an uid unique uid" do
|
61
|
+
expect {
|
62
|
+
data_store.retrieve('missing.jpg')
|
63
|
+
}.to raise_error(Dragonfly::ScpDataStore::DataNotFound)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
describe "#destroy" do
|
70
|
+
let(:data_store) do
|
71
|
+
Dragonfly::ScpDataStore::DataStore.new(
|
72
|
+
host: "localhost",
|
73
|
+
username: "root",
|
74
|
+
password: "password",
|
75
|
+
folder: "../fixtures/images",
|
76
|
+
base_url: "localhost:3000/images",
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
it "returns true" do
|
81
|
+
data_store.destroy('any_uid').should be_true
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
47
85
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragonfly-scp_data_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matheus Bras
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dragonfly
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.0.
|
152
|
+
rubygems_version: 2.0.6
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: A dragonfly datastore adapter
|