boxr 1.11.1 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/boxr/metadata.rb +7 -0
- data/lib/boxr/version.rb +1 -1
- data/spec/boxr/metadata_spec.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea6beef48a3f1750503479d50b7137a76116aebb082e97f9a113035f92a1a2b0
|
4
|
+
data.tar.gz: 3eff1d92c504b5eff76536fd56a9c56a31568f07eb45826dc89c0ff8eff4045a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f09f47c81f9ba9768c5c0686d681233250f30cd7b996f9d1cc80662538a86a710d3badc29a3f4c12c926079c13a08793f4e0dd92d52564f53deb8df5fb0e35f8
|
7
|
+
data.tar.gz: 1872bd67769b70101fcf1a56874a7b1f84fd238e5a5cda5da5179029e8f366dac09075a15f6ed0ef8e3e1b22754812c1a3bcd063f58c3b5d453abdcd88578e1f
|
data/lib/boxr/metadata.rb
CHANGED
@@ -29,6 +29,13 @@ module Boxr
|
|
29
29
|
metadata
|
30
30
|
end
|
31
31
|
|
32
|
+
def all_folder_metadata(folder)
|
33
|
+
folder_id = ensure_id(folder)
|
34
|
+
uri = "#{FOLDER_METADATA_URI}/#{folder_id}/metadata"
|
35
|
+
all_metadata, response = get(uri)
|
36
|
+
all_metadata
|
37
|
+
end
|
38
|
+
|
32
39
|
def all_metadata(file)
|
33
40
|
file_id = ensure_id(file)
|
34
41
|
uri = "#{FILE_METADATA_URI}/#{file_id}/metadata"
|
data/lib/boxr/version.rb
CHANGED
data/spec/boxr/metadata_spec.rb
CHANGED
@@ -20,6 +20,12 @@ describe 'file metadata operations' do
|
|
20
20
|
metadata = BOX_CLIENT.metadata(test_file)
|
21
21
|
expect(metadata.a).to eq("hello")
|
22
22
|
|
23
|
+
puts "get all metadata"
|
24
|
+
metadata = BOX_CLIENT.all_metadata(test_file)
|
25
|
+
metadata_entry = metadata['entries'].first
|
26
|
+
expect(metadata_entry['a']).to eq("hello")
|
27
|
+
expect(metadata_entry['b']).to eq("friend")
|
28
|
+
|
23
29
|
puts "delete metadata"
|
24
30
|
result = BOX_CLIENT.delete_metadata(test_file)
|
25
31
|
expect(result).to eq({})
|
@@ -47,6 +53,12 @@ describe 'file metadata operations' do
|
|
47
53
|
metadata = BOX_CLIENT.folder_metadata(new_folder, "enterprise", "test")
|
48
54
|
expect(metadata.a).to eq("hello")
|
49
55
|
|
56
|
+
puts "get all folder metadata"
|
57
|
+
metadata = BOX_CLIENT.all_folder_metadata(new_folder)
|
58
|
+
metadata_entry = metadata['entries'].first
|
59
|
+
expect(metadata_entry['a']).to eq("hello")
|
60
|
+
expect(metadata_entry['b']).to eq("friend")
|
61
|
+
|
50
62
|
puts "delete folder metadata"
|
51
63
|
result = BOX_CLIENT.delete_folder_metadata(new_folder, "enterprise", "test")
|
52
64
|
expect(result).to eq({})
|