filertype 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/filertype.rb +34 -0
- metadata +43 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 683ba2dd247d4a8f8595a19380104c58cb35b817
|
|
4
|
+
data.tar.gz: cc6fd9c658804ae0c383d07b8133471d3f79ec33
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 927183607517b48ad73782167522d0e94541cbc12ed296f07f4ea40081905f2dddf7ab521ea333b41538a12daf3a14f905fc1a69f4909c40ee0c8317b648cca7
|
|
7
|
+
data.tar.gz: c6a4b1dd9c79b46c7386e73e9e95eed4317faab8afd4b1fe78efd8d889180a22af07ae3c1ea441195b8f619094c8a795e78e5669a0c3eff7a26bb4c1a099b9a5
|
data/lib/filertype.rb
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module FileExt
|
|
2
|
+
@ext = {
|
|
3
|
+
"txt" => "Text File",
|
|
4
|
+
"pdf" => "Portable Document Format",
|
|
5
|
+
"exe" => "Executable File",
|
|
6
|
+
"jpeg" => "Image File",
|
|
7
|
+
"jpg" => "Image File",
|
|
8
|
+
"png" => "Image File",
|
|
9
|
+
"tiff" => "Image File",
|
|
10
|
+
"gif" => "Graphic Image File",
|
|
11
|
+
"dwg" => "Drawing File",
|
|
12
|
+
"svg" => "Scalable Vector Graphics",
|
|
13
|
+
"avi" => "Video File",
|
|
14
|
+
"mp4" => "Video File",
|
|
15
|
+
"m4p" => "Video File",
|
|
16
|
+
"mpg" => "Video File",
|
|
17
|
+
"3gp" => "Video File",
|
|
18
|
+
"mp3" => "Audio File"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
def self.filecheck(filename)
|
|
22
|
+
@filename = filename
|
|
23
|
+
@filename = @filename.split('.', -1)
|
|
24
|
+
@fileext = @filename.reverse[0]
|
|
25
|
+
@type = @ext[@fileext]
|
|
26
|
+
if @type != nil
|
|
27
|
+
return @type
|
|
28
|
+
end
|
|
29
|
+
return @fileext.capitalize
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
|
metadata
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: filertype
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Rahul Raghava
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-11-29 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: A simple gem that rturns the type of file by the file name
|
|
14
|
+
email: x17108799@student.ncirl.ie
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/filertype.rb
|
|
20
|
+
homepage: http://rubygems.org/gems/FileRType
|
|
21
|
+
licenses: []
|
|
22
|
+
metadata: {}
|
|
23
|
+
post_install_message:
|
|
24
|
+
rdoc_options: []
|
|
25
|
+
require_paths:
|
|
26
|
+
- lib
|
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
28
|
+
requirements:
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '0'
|
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '0'
|
|
37
|
+
requirements: []
|
|
38
|
+
rubyforge_project:
|
|
39
|
+
rubygems_version: 2.6.8
|
|
40
|
+
signing_key:
|
|
41
|
+
specification_version: 4
|
|
42
|
+
summary: This gem returns Type of file
|
|
43
|
+
test_files: []
|