file_groups 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/file_groups.rb +29 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4157d6c186ed7f863b63a155710d970c04294209ae406ff5e87c18fbf1474e06
|
4
|
+
data.tar.gz: ac36a6a0a8c7b240889b893dc65459690d1caba76e7983879428f9020e22e73d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48edb43109d595b5933c94ff3329ed8b9d13e8847c938e91d781fb03a03b8efe890c9bef6be5fa456a0c4c18f2f8f1c91794e29f80e87fb23b887f2d88db6089
|
7
|
+
data.tar.gz: 354435c5c8b8057e9f612d250b1570e06fa83a709cbab028ab97b15e97f7aa02240e5fc3c499fa03686f2fc1054f0f3f6e86fd8d6abac0bf888600aba2c57ec3
|
data/README.md
CHANGED
@@ -44,8 +44,13 @@ Retrieve a list of file extensions or media types used by spreadsheets:
|
|
44
44
|
```rb
|
45
45
|
require "file_groups"
|
46
46
|
|
47
|
-
FileGroups.spreadsheet.extensions
|
48
|
-
FileGroups.spreadsheet.media_types
|
47
|
+
FileGroups.spreadsheet.extensions # ["csv", "xls", "xlsx", "xlt", ... ]
|
48
|
+
FileGroups.spreadsheet.media_types # ["text/csv", "application/vnd.ms-excel", ... ]
|
49
|
+
```
|
50
|
+
|
51
|
+
If you only want values specific to CSVs:
|
52
|
+
```rb
|
53
|
+
FileGroups.spreadsheet.csv.media_types # ["text/csv", "text/comma-separated-values" ]
|
49
54
|
```
|
50
55
|
|
51
56
|
If you only want values specific to Microsoft Excel:
|
data/lib/file_groups.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# ********************
|
6
6
|
#
|
7
7
|
module FileGroups
|
8
|
-
VERSION = "0.
|
8
|
+
VERSION = "0.2.0"
|
9
9
|
|
10
10
|
|
11
11
|
def self.graphics_editor
|
@@ -144,7 +144,20 @@ module FileGroups
|
|
144
144
|
all ? ["text/csv", "text/comma-separated-values", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "application/vnd.ms-excel.sheet.macroenabled.12", "application/vnd.ms-excel.sheet.binary.macroenabled.12", "application/vnd.ms-excel.template.macroenabled.12", "application/vnd.ms-excel.addin.macroenabled.12", "application/vnd.apple.numbers", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template", "text/tab-separated-values"] : ["text/csv", "text/comma-separated-values", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "application/vnd.apple.numbers", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template", "text/tab-separated-values"]
|
145
145
|
end
|
146
146
|
|
147
|
-
def o.
|
147
|
+
def o.csv
|
148
|
+
tag = Object.new
|
149
|
+
|
150
|
+
def tag.extensions(all = false)
|
151
|
+
all ? ["csv"] : ["csv"]
|
152
|
+
end
|
153
|
+
|
154
|
+
def tag.media_types(all = false)
|
155
|
+
all ? ["text/csv", "text/comma-separated-values"] : ["text/csv", "text/comma-separated-values"]
|
156
|
+
end
|
157
|
+
|
158
|
+
tag
|
159
|
+
end
|
160
|
+
def o.excel
|
148
161
|
tag = Object.new
|
149
162
|
|
150
163
|
def tag.extensions(all = false)
|
@@ -198,7 +211,20 @@ module FileGroups
|
|
198
211
|
all ? ["text/csv", "text/comma-separated-values", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "application/vnd.ms-excel.sheet.macroenabled.12", "application/vnd.ms-excel.sheet.binary.macroenabled.12", "application/vnd.ms-excel.template.macroenabled.12", "application/vnd.ms-excel.addin.macroenabled.12", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "application/vnd.ms-powerpoint.addin.macroenabled.12", "application/vnd.ms-powerpoint.presentation.macroenabled.12", "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "application/vnd.ms-powerpoint.template.macroenabled.12", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "application/vnd.ms-word.template.macroenabled.12", "application/vnd.ms-word.document.macroenabled.12", "application/vnd.apple.numbers", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template", "application/vnd.oasis.opendocument.presentation", "application/vnd.oasis.opendocument.text", "application/vnd.oasis.opendocument.text-template", "application/vnd.oasis.opendocument.text-web", "application/vnd.oasis.opendocument.text-master", "application/pdf", "application/rtf", "text/rtf", "text/tab-separated-values", "text/plain"] : ["text/csv", "text/comma-separated-values", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "application/vnd.apple.numbers", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template", "application/vnd.oasis.opendocument.presentation", "application/vnd.oasis.opendocument.text", "application/vnd.oasis.opendocument.text-template", "application/pdf", "application/rtf", "text/rtf", "text/tab-separated-values", "text/plain"]
|
199
212
|
end
|
200
213
|
|
201
|
-
def o.
|
214
|
+
def o.csv
|
215
|
+
tag = Object.new
|
216
|
+
|
217
|
+
def tag.extensions(all = false)
|
218
|
+
all ? ["csv"] : ["csv"]
|
219
|
+
end
|
220
|
+
|
221
|
+
def tag.media_types(all = false)
|
222
|
+
all ? ["text/csv", "text/comma-separated-values"] : ["text/csv", "text/comma-separated-values"]
|
223
|
+
end
|
224
|
+
|
225
|
+
tag
|
226
|
+
end
|
227
|
+
def o.keynote
|
202
228
|
tag = Object.new
|
203
229
|
|
204
230
|
def tag.extensions(all = false)
|