Skip to content

Commit a297443

Browse files
author
Laurynas Butkus
committed
Remove alternative converter support
1 parent b073aa7 commit a297443

File tree

3 files changed

+1
-43
lines changed

3 files changed

+1
-43
lines changed

examples/alternative_converter.rb

Lines changed: 0 additions & 20 deletions
This file was deleted.

lib/convert_api/task.rb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ def run
1515

1616
from_format = @from_format || detect_format(params)
1717
read_timeout = @conversion_timeout + config.conversion_timeout_delta if @conversion_timeout
18-
converter = detect_converter(params)
19-
converter_path = converter ? "/converter/#{converter}" : ''
2018

2119
response = ConvertApi.client.post(
22-
"convert/#{from_format}/to/#{@to_format}#{converter_path}",
20+
"convert/#{from_format}/to/#{@to_format}",
2321
params,
2422
read_timeout: read_timeout,
2523
)
@@ -70,14 +68,6 @@ def detect_format(params)
7068
FormatDetector.new(resource, @to_format).run
7169
end
7270

73-
def detect_converter(params)
74-
params.each do |key, value|
75-
return value if key.to_s.downcase == 'converter'
76-
end
77-
78-
nil
79-
end
80-
8171
def config
8272
ConvertApi.config
8373
end

spec/convert_api/task_spec.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@
1616
expect(subject).to be_instance_of(ConvertApi::Result)
1717
end
1818

19-
context 'with converter' do
20-
let(:params) { { File: file, Converter: 'openoffice' } }
21-
22-
it 'adds converter to the path' do
23-
expect(ConvertApi.client).to(
24-
receive(:post).with('convert/txt/to/pdf/converter/openoffice', instance_of(Hash), instance_of(Hash)).and_return(result)
25-
)
26-
27-
expect(subject).to be_instance_of(ConvertApi::Result)
28-
end
29-
end
30-
3119
context 'when file is instance of ResultFile' do
3220
let(:file) { ConvertApi::ResultFile.new('Url' => 'testurl') }
3321
let(:expected_params) { hash_including(File: 'testurl') }

0 commit comments

Comments
 (0)