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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -2
  3. data/lib/file_groups.rb +29 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7736ced745bc02a40533530a415008238004da1975051b18941c725f5f8cdb3a
4
- data.tar.gz: 0dc8cd72992f5f190a772cc76d9252d86c281ef9594f4bf8cd768cbc35aaa1f3
3
+ metadata.gz: 4157d6c186ed7f863b63a155710d970c04294209ae406ff5e87c18fbf1474e06
4
+ data.tar.gz: ac36a6a0a8c7b240889b893dc65459690d1caba76e7983879428f9020e22e73d
5
5
  SHA512:
6
- metadata.gz: 74edcc53a0765abc954f987294b446a06ac798bdeda7399d5537f4bf8f576e1563e8a2544b8b5a7fc5a6cc6f3f7bd553ac14250b9eef2058f772c302fe4f9094
7
- data.tar.gz: 713d96fabcd199fb005bde0451171969938bf73abf14fd10be645a3f36f3613279bd6bb65fd742c3631e2fce57a914db624888fbb0c9c96da57eadc901196c44
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 # ["csv", "xls", "xlsx", "xlt", ... ]
48
- FileGroups.spreadsheet.media_types # ["text/csv", "application/vnd.ms-excel", ... ]
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.1.1"
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.excel
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.keynote
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_groups
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skye Shaw