crabgrass_media 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/media/mime_type.rb +66 -66
- data/lib/media/transmogrifiers/graphicsmagick.rb +1 -1
- data/lib/media/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: 32c8374ff2bfd5dbcaf4e232940db945f6322cc7
|
4
|
+
data.tar.gz: dd153e901047a774ce8731e75ea9636b19093b50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edf264874d62ea4c41a611beb74abdcb0288613d5d9a42c378dc7a1b011e2696f867a05e26586538f37afea40f468a6d72d0f50373479de9b137803470132146
|
7
|
+
data.tar.gz: a34b5208f51a1331d3a67ddaeb702af04925459e6217715ee5d6fb19f0f019f67013cbabed4bcd002bd12e592e4056ed2dae3d5e7fe92ea42fd46513ae66878b
|
data/lib/media/mime_type.rb
CHANGED
@@ -83,64 +83,64 @@ module Media
|
|
83
83
|
# mime_type => [file_extension, icon, asset_class, description]
|
84
84
|
'default' => [nil,'default',:asset,'Unknown'],
|
85
85
|
|
86
|
-
'text/' => [:txt,:html
|
87
|
-
'text/plain' => [:txt,:html
|
88
|
-
'text/html' => [:html,:html
|
89
|
-
'application/rtf' => [:rtf,:rtf
|
90
|
-
'text/rtf' => [:rtf,:rtf
|
86
|
+
'text/' => [:txt,:html,'asset/text', 'Text'],
|
87
|
+
'text/plain' => [:txt,:html,'asset/text', 'Text'],
|
88
|
+
'text/html' => [:html,:html,'asset/text', 'Webpage'],
|
89
|
+
'application/rtf' => [:rtf,:rtf,'asset/text', 'Rich Text'],
|
90
|
+
'text/rtf' => [:rtf,:rtf,'asset/text', 'Rich Text'],
|
91
91
|
'text/sgml' => [:sgml,:xml,nil,'XML'],
|
92
92
|
'text/xml' => [:xml,:xml,nil,'XML'],
|
93
|
-
'text/csv' => [:csv,:spreadsheet
|
94
|
-
'text/comma-separated-values' => [:csv,:spreadsheet
|
93
|
+
'text/csv' => [:csv,:spreadsheet,'asset/doc', 'Comma Separated Values'],
|
94
|
+
'text/comma-separated-values' => [:csv,:spreadsheet,'asset/doc', 'Comma Separated Values'],
|
95
95
|
|
96
|
-
'application/pdf' => [:pdf,:pdf
|
97
|
-
'application/bzpdf' => [:pdf,:pdf
|
98
|
-
'application/gzpdf' => [:pdf,:pdf
|
99
|
-
'application/postscript' => [:ps,:pdf
|
96
|
+
'application/pdf' => [:pdf,:pdf,'asset/image', 'Portable Document Format'],
|
97
|
+
'application/bzpdf' => [:pdf,:pdf,'asset/image', 'Portable Document Format'],
|
98
|
+
'application/gzpdf' => [:pdf,:pdf,'asset/image', 'Portable Document Format'],
|
99
|
+
'application/postscript' => [:ps,:pdf,'asset/image','Postscript'],
|
100
100
|
|
101
|
-
'text/spreadsheet' => [:txt,:spreadsheet
|
102
|
-
'application/gnumeric' => [:gnumeric,:spreadsheet
|
103
|
-
'application/kspread' => [:kspread,:spreadsheet
|
101
|
+
'text/spreadsheet' => [:txt,:spreadsheet,'asset/doc','Spreadsheet'],
|
102
|
+
'application/gnumeric' => [:gnumeric,:spreadsheet,'asset/doc','Gnumeric'],
|
103
|
+
'application/kspread' => [:kspread,:spreadsheet,'asset/doc','KSpread'],
|
104
104
|
|
105
105
|
'application/scribus' => [:scribus,:doc,nil,'Scribus'],
|
106
|
-
'application/abiword' => [:abw,:doc
|
107
|
-
'application/kword' => [:kwd,:doc
|
108
|
-
|
109
|
-
|
110
|
-
'application/msword' => [:doc,:msword
|
111
|
-
'application/mswrite' => [:doc,:msword
|
112
|
-
'application/powerpoint' => [:ppt,:mspowerpoint
|
113
|
-
'application/excel' => [:xls,:msexcel
|
114
|
-
'application/access' => [nil, :msaccess,
|
115
|
-
'application/vnd.ms-msword' => [:doc,:msword
|
116
|
-
'application/vnd.ms-mswrite' => [:doc,:msword
|
117
|
-
'application/vnd.ms-powerpoint' => [:ppt,:mspowerpoint
|
118
|
-
'application/vnd.ms-excel' => [:xls,:msexcel
|
119
|
-
'application/vnd.ms-access' => [nil, :msaccess,
|
120
|
-
'application/msword-template' => [:dot,:msword
|
121
|
-
'application/excel-template' => [:xlt,:msexcel
|
122
|
-
'application/powerpoint-template' => [:pot,:mspowerpoint
|
106
|
+
'application/abiword' => [:abw,:doc,'asset/doc','Abiword'],
|
107
|
+
'application/kword' => [:kwd,:doc,'asset/doc','KWord'],
|
108
|
+
|
109
|
+
|
110
|
+
'application/msword' => [:doc,:msword,'asset/text','MS Word'],
|
111
|
+
'application/mswrite' => [:doc,:msword,'asset/text','MS Write'],
|
112
|
+
'application/powerpoint' => [:ppt,:mspowerpoint,'asset/doc','MS Powerpoint'],
|
113
|
+
'application/excel' => [:xls,:msexcel,'asset/spreadsheet','MS Excel'],
|
114
|
+
'application/access' => [nil, :msaccess, 'asset/doc','MS Access'],
|
115
|
+
'application/vnd.ms-msword' => [:doc,:msword,'asset/text','MS Word'],
|
116
|
+
'application/vnd.ms-mswrite' => [:doc,:msword,'asset/text','MS Write'],
|
117
|
+
'application/vnd.ms-powerpoint' => [:ppt,:mspowerpoint,'asset/doc','MS Powerpoint'],
|
118
|
+
'application/vnd.ms-excel' => [:xls,:msexcel,'asset/spreadsheet','MS Excel'],
|
119
|
+
'application/vnd.ms-access' => [nil, :msaccess, 'asset/doc','MS Access'],
|
120
|
+
'application/msword-template' => [:dot,:msword,'asset/text','MS Word Template'],
|
121
|
+
'application/excel-template' => [:xlt,:msexcel,'asset/spreadsheet','MS Excel Template'],
|
122
|
+
'application/powerpoint-template' => [:pot,:mspowerpoint,'asset/doc','MS Powerpoint Template'],
|
123
123
|
|
124
124
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation' =>
|
125
|
-
[:pptx, :mspowerpoint
|
125
|
+
[:pptx, :mspowerpoint,'asset/doc','MS Powerpoint'],
|
126
126
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation' =>
|
127
|
-
[:pptm, :mspowerpoint
|
127
|
+
[:pptm, :mspowerpoint,'asset/doc','MS Powerpoint'],
|
128
128
|
'application/vnd.openxmlformats-officedocument.presentationml.template' =>
|
129
|
-
[:potx,:mspowerpoint
|
129
|
+
[:potx,:mspowerpoint,'asset/doc','MS Powerpoint Template'],
|
130
130
|
|
131
131
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' =>
|
132
|
-
[:docm,:msword
|
132
|
+
[:docm,:msword,'asset/text','MS Word'],
|
133
133
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' =>
|
134
|
-
[:docx,:msword
|
134
|
+
[:docx,:msword,'asset/text','MS Word'],
|
135
135
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.template' =>
|
136
|
-
[:dotx,:msword
|
136
|
+
[:dotx,:msword,'asset/text','MS Word Template'],
|
137
137
|
|
138
138
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' =>
|
139
|
-
[:xlsm,:msexcel
|
139
|
+
[:xlsm,:msexcel,'asset/spreadsheet','MS Excel'],
|
140
140
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' =>
|
141
|
-
[:xlsx,:msexcel
|
141
|
+
[:xlsx,:msexcel,'asset/spreadsheet','MS Excel'],
|
142
142
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.template' =>
|
143
|
-
[:xltx,:msexcel
|
143
|
+
[:xltx,:msexcel,'asset/spreadsheet','MS Excel Template'],
|
144
144
|
|
145
145
|
'application/executable' => [nil,:binary,nil,'Program'],
|
146
146
|
'application/ms-dos-executable' => [nil,:binary,nil,'Program'],
|
@@ -150,34 +150,34 @@ module Media
|
|
150
150
|
'application/ruby' => [:rb,:ruby,nil,'Script'],
|
151
151
|
|
152
152
|
'application/vnd.oasis.opendocument.spreadsheet' =>
|
153
|
-
[:ods,:oo_spreadsheet
|
153
|
+
[:ods,:oo_spreadsheet,'asset/spreadsheet', 'OpenDocument Spreadsheet'],
|
154
154
|
'application/vnd.oasis.opendocument.formula' =>
|
155
|
-
[nil,:oo_spreadsheet
|
155
|
+
[nil,:oo_spreadsheet,'asset/spreadsheet', 'OpenDocument Formula'],
|
156
156
|
'application/vnd.oasis.opendocument.chart' =>
|
157
|
-
[nil,:oo_spreadsheet
|
157
|
+
[nil,:oo_spreadsheet,'asset/spreadsheet', 'OpenDocument Chart'],
|
158
158
|
'application/vnd.oasis.opendocument.image' =>
|
159
|
-
[nil,:oo_graphics,
|
159
|
+
[nil,:oo_graphics, 'asset/doc', 'OpenDocument Image'],
|
160
160
|
'application/vnd.oasis.opendocument.graphics' =>
|
161
|
-
[:odg,:oo_graphics,
|
161
|
+
[:odg,:oo_graphics, 'asset/doc', 'OpenDocument Graphics'],
|
162
162
|
'application/vnd.oasis.opendocument.presentation' =>
|
163
|
-
[:odp,:oo_presentation
|
163
|
+
[:odp,:oo_presentation,'asset/doc', 'OpenDocument Presentation'],
|
164
164
|
'application/vnd.oasis.opendocument.database' =>
|
165
|
-
[:odf,:oo_database
|
165
|
+
[:odf,:oo_database,'asset/doc', 'OpenDocument Database'],
|
166
166
|
'application/vnd.oasis.opendocument.text-web' =>
|
167
|
-
[:html,:oo_html
|
167
|
+
[:html,:oo_html,'asset/doc', 'OpenDocument Webpage'],
|
168
168
|
'application/vnd.oasis.opendocument.text' =>
|
169
|
-
[:odt,:oo_document
|
169
|
+
[:odt,:oo_document,'asset/doc', 'OpenDocument Text'],
|
170
170
|
'application/vnd.oasis.opendocument.text-master' =>
|
171
|
-
[:odm,:oo_document
|
171
|
+
[:odm,:oo_document,'asset/doc', 'OpenDocument Master'],
|
172
172
|
|
173
173
|
'application/vnd.oasis.opendocument.presentation-template' =>
|
174
|
-
[:otp,:oo_presentation
|
174
|
+
[:otp,:oo_presentation,'asset/doc', 'OpenDocument Presentation'],
|
175
175
|
'application/vnd.oasis.opendocument.graphics-template' =>
|
176
|
-
[:otg,:oo_graphics
|
176
|
+
[:otg,:oo_graphics,'asset/doc', 'OpenDocument Graphics'],
|
177
177
|
'application/vnd.oasis.opendocument.spreadsheet-template' =>
|
178
|
-
[:ots,:oo_spreadsheet
|
178
|
+
[:ots,:oo_spreadsheet,'asset/spreadsheet', 'OpenDocument Spreadsheet'],
|
179
179
|
'application/vnd.oasis.opendocument.text-template' =>
|
180
|
-
[:ott,:oo_document
|
180
|
+
[:ott,:oo_document,'asset/doc', 'OpenDocument Text'],
|
181
181
|
|
182
182
|
'packages/' => [nil,:archive,nil,'Archive'],
|
183
183
|
'multipart/zip' => [:zip,:archive,nil,'Archive'],
|
@@ -194,20 +194,20 @@ module Media
|
|
194
194
|
|
195
195
|
'video/' => [nil,:video,nil,'Video'],
|
196
196
|
|
197
|
-
'audio/' => [nil,:audio
|
197
|
+
'audio/' => [nil,:audio,'asset/audio','Audio'],
|
198
198
|
|
199
|
-
'image/' => [nil,:image
|
200
|
-
'image/jpeg' => [:jpg,:image
|
201
|
-
'image/jpg' => [:jpg,:image
|
202
|
-
'image/png' => [:png,:image
|
203
|
-
'image/gif' => [:png,:image
|
199
|
+
'image/' => [nil,:image,'asset/image','Image'],
|
200
|
+
'image/jpeg' => [:jpg,:image,'asset/image', 'JPEG Image'],
|
201
|
+
'image/jpg' => [:jpg,:image,'asset/image', 'JPEG Image'],
|
202
|
+
'image/png' => [:png,:image,'asset/png', 'PNG Image'],
|
203
|
+
'image/gif' => [:png,:image,'asset/gif', 'GIF Image'],
|
204
204
|
|
205
|
-
'image/svg+xml' => [:svg,:vector
|
206
|
-
'image/svg+xml-compressed' => [:svg,:vector
|
207
|
-
'application/illustrator' => [:ai,:vector
|
208
|
-
'image/bzeps' => [:bzeps,:vector
|
209
|
-
'image/eps' => [:eps,:vector
|
210
|
-
'image/gzeps' => [:gzeps,:vector
|
205
|
+
'image/svg+xml' => [:svg,:vector,'asset/svg','Vector Graphic'],
|
206
|
+
'image/svg+xml-compressed' => [:svg,:vector,'asset/svg','Vector Graphic'],
|
207
|
+
'application/illustrator' => [:ai,:vector,'asset/image','Vector Graphic'],
|
208
|
+
'image/bzeps' => [:bzeps,:vector,'asset/image','Vector Graphic'],
|
209
|
+
'image/eps' => [:eps,:vector,'asset/image','Vector Graphic'],
|
210
|
+
'image/gzeps' => [:gzeps,:vector,'asset/image','Vector Graphic'],
|
211
211
|
|
212
212
|
'application/pgp-encrypted' => [nil,:lock,nil,'Crypt'],
|
213
213
|
'application/pgp-signature' => [nil,:lock,nil,'Crypt'],
|
@@ -46,7 +46,7 @@ module Media
|
|
46
46
|
# try converting first page only
|
47
47
|
status = convert(input_file.to_s + '[0]', &block)
|
48
48
|
# retry with full file if result was empty
|
49
|
-
if File.
|
49
|
+
if File.size(output_file.to_s) == 0
|
50
50
|
# reset filenames to the state before run
|
51
51
|
set_temporary_outfile
|
52
52
|
status = convert(&block)
|
data/lib/media/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crabgrass_media
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Azul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|