groupdocs 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -198,7 +198,7 @@ module GroupDocs
198
198
  json = Api::Request.new do |request|
199
199
  request[:access] = access
200
200
  request[:method] = :GET
201
- request[:path] = "/doc/{{client_id}}/files/#{file.id}/metadata"
201
+ request[:path] = "/doc/{{client_id}}/files/#{file.guid}/metadata"
202
202
  end.execute!
203
203
 
204
204
  Document::MetaData.new do |metadata|
@@ -122,23 +122,24 @@ module GroupDocs
122
122
  #
123
123
  # Moves folder contents to given path.
124
124
  #
125
- # @param [String] path Destination to move contents to
125
+ # @param [String] destination_path Destination to move contents to
126
126
  # @param [Hash] access Access credentials
127
127
  # @option access [String] :client_id
128
128
  # @option access [String] :private_key
129
129
  # @return [String] Moved to folder path
130
130
  #
131
- def move!(path, access = {})
132
- Api::Helpers::Path.verify_starts_with_root(path)
131
+ def move!(destination_path, access = {})
132
+ Api::Helpers::Path.verify_starts_with_root(destination_path)
133
+ destination_path = "#{destination_path}/#{name}"
133
134
 
134
135
  Api::Request.new do |request|
135
136
  request[:access] = access
136
137
  request[:method] = :PUT
137
- request[:headers] = { :'Groupdocs-Move' => name }
138
- request[:path] = "/storage/{{client_id}}/folders#{path}"
138
+ request[:headers] = { :'Groupdocs-Move' => path }
139
+ request[:path] = "/storage/{{client_id}}/folders#{destination_path}"
139
140
  end.execute!
140
141
 
141
- path
142
+ destination_path
142
143
  end
143
144
 
144
145
  #
@@ -155,25 +156,26 @@ module GroupDocs
155
156
  end
156
157
 
157
158
  #
158
- # Copies folder contents to a destination path.
159
+ # Copies folder contents to given path.
159
160
  #
160
- # @param [String] path Path of directory to copy to starting from root ('/')
161
+ # @param [String] destination_path Destination to copy contents to
161
162
  # @param [Hash] access Access credentials
162
163
  # @option access [String] :client_id
163
164
  # @option access [String] :private_key
164
165
  # @return [String] Copied to folder path
165
166
  #
166
- def copy!(path, access = {})
167
- Api::Helpers::Path.verify_starts_with_root(path)
167
+ def copy!(destination_path, access = {})
168
+ Api::Helpers::Path.verify_starts_with_root(destination_path)
169
+ destination_path = "#{destination_path}/#{name}"
168
170
 
169
171
  Api::Request.new do |request|
170
172
  request[:access] = access
171
173
  request[:method] = :PUT
172
- request[:headers] = { :'Groupdocs-Copy' => name }
173
- request[:path] = "/storage/{{client_id}}/folders#{path}"
174
+ request[:headers] = { :'Groupdocs-Copy' => path }
175
+ request[:path] = "/storage/{{client_id}}/folders#{destination_path}"
174
176
  end.execute!
175
177
 
176
- path
178
+ destination_path
177
179
  end
178
180
 
179
181
  #
@@ -241,7 +243,7 @@ module GroupDocs
241
243
  Api::Request.new do |request|
242
244
  request[:access] = access
243
245
  request[:method] = :DELETE
244
- request[:path] = "/storage/{{client_id}}/folders/#{name}"
246
+ request[:path] = "/storage/{{client_id}}/folders/#{path}/#{name}"
245
247
  end.execute!
246
248
  end
247
249
 
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '0.3.9'
2
+ VERSION = '0.3.10'
3
3
  end # GroupDocs
@@ -114,9 +114,9 @@ describe GroupDocs::Storage::Folder do
114
114
  end
115
115
 
116
116
  it 'returns moved to folder path' do
117
- moved = subject.move!('/Test2')
117
+ moved = subject.move!('/Test2/Test1')
118
118
  moved.should be_a(String)
119
- moved.should == '/Test2'
119
+ moved.should == '/Test2/Test1/'
120
120
  end
121
121
  end
122
122
 
@@ -163,9 +163,9 @@ describe GroupDocs::Storage::Folder do
163
163
  end
164
164
 
165
165
  it 'returns moved to folder path' do
166
- moved = subject.copy!('/Test2')
166
+ moved = subject.copy!('/Test2/Test1')
167
167
  moved.should be_a(String)
168
- moved.should == '/Test2'
168
+ moved.should == '/Test2/Test1/'
169
169
  end
170
170
  end
171
171
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-18 00:00:00.000000000 Z
12
+ date: 2012-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &4299240 !ruby/object:Gem::Requirement
16
+ requirement: &8878460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.6'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *4299240
24
+ version_requirements: *8878460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &4314240 !ruby/object:Gem::Requirement
27
+ requirement: &8893240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.7'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *4314240
35
+ version_requirements: *8893240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby-hmac
38
- requirement: &4312700 !ruby/object:Gem::Requirement
38
+ requirement: &8891260 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *4312700
46
+ version_requirements: *8891260
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &4310660 !ruby/object:Gem::Requirement
49
+ requirement: &8889960 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '2.9'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *4310660
57
+ version_requirements: *8889960
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &4309820 !ruby/object:Gem::Requirement
60
+ requirement: &8888980 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0.9'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *4309820
68
+ version_requirements: *8888980
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &4308540 !ruby/object:Gem::Requirement
71
+ requirement: &8887740 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0.6'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *4308540
79
+ version_requirements: *8887740
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &4320860 !ruby/object:Gem::Requirement
82
+ requirement: &8900300 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0.8'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *4320860
90
+ version_requirements: *8900300
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &4319120 !ruby/object:Gem::Requirement
93
+ requirement: &8898240 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '1.8'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *4319120
101
+ version_requirements: *8898240
102
102
  description: Ruby SDK for GroupDocs REST API
103
103
  email: p0deje@gmail.com
104
104
  executables: []
@@ -256,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
256
256
  version: '0'
257
257
  segments:
258
258
  - 0
259
- hash: -1332657655199071037
259
+ hash: 2679573412652795749
260
260
  required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  none: false
262
262
  requirements:
@@ -265,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  segments:
267
267
  - 0
268
- hash: -1332657655199071037
268
+ hash: 2679573412652795749
269
269
  requirements: []
270
270
  rubyforge_project:
271
271
  rubygems_version: 1.8.10