omnidocx 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omnidocx.rb +4 -2
- data/lib/omnidocx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02ce6fcf18a2fed5a782906ddc88086c2a17f468
|
4
|
+
data.tar.gz: 0d9bce7af42f738c9bccadfc50b1c23e5db96f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2850e26980b32160c47a1ebee5878b3160b91408263d6a07bcccb12d68ec7a9546405f839b076bd73ab6092519f87a7152ea7b381c8671b53d86a6c7ddc53c5d
|
7
|
+
data.tar.gz: 2e6eab4c57522baafdfa9a6496ac81799bbbc334e34f324f9c9b6355143b22b462c52be2137498dd180c917bdb3883d3294afe55897fc406c16f9d62b869b420
|
data/lib/omnidocx.rb
CHANGED
@@ -94,11 +94,12 @@ module Omnidocx
|
|
94
94
|
|
95
95
|
#if image path is readable
|
96
96
|
if !data.empty?
|
97
|
-
|
97
|
+
img_url_no_params = img[:path].gsub(/\?.*/,'')
|
98
|
+
extension = File.extname(img_url_no_params).split(".").last
|
98
99
|
|
99
100
|
if !media_content_type_hash.keys.include?(extension.split(".").last)
|
100
101
|
#making an entry for a new media type
|
101
|
-
media_content_type_hash["#{extension}"] = MIME::Types.type_for(
|
102
|
+
media_content_type_hash["#{extension}"] = MIME::Types.type_for(img_url_no_params)[0].to_s
|
102
103
|
end
|
103
104
|
|
104
105
|
zos.put_next_entry("word/media/image#{cnt}.#{extension}")
|
@@ -535,5 +536,6 @@ module Omnidocx
|
|
535
536
|
#moving the temporary docx file to the final_path specified by the user
|
536
537
|
FileUtils.mv(temp_file.path, final_path)
|
537
538
|
end
|
539
|
+
|
538
540
|
end
|
539
541
|
end
|
data/lib/omnidocx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnidocx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parth Nagori
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|