groupdocs 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,7 +46,10 @@ module GroupDocs
46
46
  #
47
47
  def url_encode_path
48
48
  options[:path] = URI.escape(options[:path])
49
- options[:path].gsub! '+', '%2B'
49
+ # handle special symbols correctly
50
+ options[:path].gsub!('[', '%5B')
51
+ options[:path].gsub!(']', '%5D')
52
+ options[:path].gsub!('+', '%2B')
50
53
  end
51
54
 
52
55
  #
@@ -133,7 +133,7 @@ module GroupDocs
133
133
  # @option access [String] :private_key
134
134
  # @raise [ArgumentError] if template is not GroupDocs::Signature::Template
135
135
  #
136
- def create!(options = {}, access = {})
136
+ def create!(options = {}, access = {})
137
137
  template_id = options.delete(:template_id)
138
138
  assembly_id = options.delete(:assembly_id)
139
139
  options[:templateId] = template_id if template_id
@@ -167,7 +167,8 @@ module GroupDocs
167
167
  end.execute!
168
168
 
169
169
  json[:documents].map do |document|
170
- file = Storage::File.new(:guid => document[:documentId], :name => document[:name])
170
+ id = document[:documentId] || document[:id]
171
+ file = Storage::File.new(:guid => id, :name => document[:name])
171
172
  Document.new(document.merge(:file => file))
172
173
  end
173
174
  end
@@ -2,6 +2,8 @@ module GroupDocs
2
2
  module Storage
3
3
  class Package < Api::Entity
4
4
 
5
+ include Api::Helpers::Path
6
+
5
7
  # @attr [String] name Package name
6
8
  attr_accessor :name
7
9
  # @attr [Array] objects Storage entities to be packed
@@ -27,11 +29,15 @@ module GroupDocs
27
29
  # @return [String] URL of package for downloading
28
30
  #
29
31
  def create!(access = {})
32
+ paths = @objects.map do |object|
33
+ prepare_path("#{object.path}/#{object.name}")
34
+ end
35
+
30
36
  json = Api::Request.new do |request|
31
37
  request[:access] = access
32
38
  request[:method] = :POST
33
39
  request[:path] = "/storage/{{client_id}}/packages/#{name}.zip"
34
- request[:request_body] = @objects.map(&:name)
40
+ request[:request_body] = paths
35
41
  end.execute!
36
42
 
37
43
  json[:url]
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end # GroupDocs
@@ -55,6 +55,12 @@ describe GroupDocs::Api::Helpers::URL do
55
55
  subject.send(:url_encode_path)
56
56
  subject.options[:path].should == '/?email=john%2B1@smith.com'
57
57
  end
58
+
59
+ it 'replaces square brackets' do
60
+ subject.options[:path] = '/?email=john[1]@smith.com'
61
+ subject.send(:url_encode_path)
62
+ subject.options[:path].should == '/?email=john%5B1%5D@smith.com'
63
+ end
58
64
  end
59
65
 
60
66
  describe '#sign_url' do
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: 1.4.0
4
+ version: 1.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-21 00:00:00.000000000 Z
12
+ date: 2013-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -499,7 +499,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
499
499
  version: '0'
500
500
  segments:
501
501
  - 0
502
- hash: -577560734250830649
502
+ hash: -2378545325436278469
503
503
  required_rubygems_version: !ruby/object:Gem::Requirement
504
504
  none: false
505
505
  requirements:
@@ -508,7 +508,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
508
508
  version: '0'
509
509
  segments:
510
510
  - 0
511
- hash: -577560734250830649
511
+ hash: -2378545325436278469
512
512
  requirements: []
513
513
  rubyforge_project:
514
514
  rubygems_version: 1.8.23