groupdocs 1.2.7 → 1.2.8

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.
@@ -46,6 +46,7 @@ module GroupDocs
46
46
  #
47
47
  def url_encode_path
48
48
  options[:path] = URI.escape(options[:path])
49
+ options[:path].gsub! ?+, '%2B'
49
50
  end
50
51
 
51
52
  #
@@ -181,7 +181,7 @@ module GroupDocs
181
181
  end.execute!
182
182
 
183
183
  filepath = "#{path}/#{name}"
184
- Object::File.open(filepath, 'w') do |file|
184
+ Object::File.open(filepath, 'wb') do |file|
185
185
  file.write(response)
186
186
  end
187
187
 
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '1.2.7'
2
+ VERSION = '1.2.8'
3
3
  end # GroupDocs
@@ -46,8 +46,14 @@ describe GroupDocs::Api::Helpers::URL do
46
46
  describe '#url_encode_path' do
47
47
  it 'URL encodes path' do
48
48
  subject.options[:path] = '/folder/Test 123'
49
- subject.options.should_receive(:[]=).with(:path, '/folder/Test%20123')
50
49
  subject.send(:url_encode_path)
50
+ subject.options[:path].should == '/folder/Test%20123'
51
+ end
52
+
53
+ it 'replaces + with %2B' do
54
+ subject.options[:path] = '/?email=john+1@smith.com'
55
+ subject.send(:url_encode_path)
56
+ subject.options[:path].should == '/?email=john%2B1@smith.com'
51
57
  end
52
58
  end
53
59
 
@@ -138,7 +138,7 @@ describe GroupDocs::Storage::File do
138
138
 
139
139
  it 'downloads file to given path' do
140
140
  file = stub('file')
141
- Object::File.should_receive(:open).with("#{path}/resume.pdf", 'w').and_yield(file)
141
+ Object::File.should_receive(:open).with("#{path}/resume.pdf", 'wb').and_yield(file)
142
142
  file.should_receive(:write).with(File.read('spec/support/files/resume.pdf'))
143
143
  subject.download!(path)
144
144
  end
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.2.7
4
+ version: 1.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -422,7 +422,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
422
422
  version: '0'
423
423
  segments:
424
424
  - 0
425
- hash: -3018162870662796259
425
+ hash: 4279493865227612838
426
426
  required_rubygems_version: !ruby/object:Gem::Requirement
427
427
  none: false
428
428
  requirements:
@@ -431,7 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
431
431
  version: '0'
432
432
  segments:
433
433
  - 0
434
- hash: -3018162870662796259
434
+ hash: 4279493865227612838
435
435
  requirements: []
436
436
  rubyforge_project:
437
437
  rubygems_version: 1.8.24