sixarm_ruby_magic_number_type 2.0.2 → 2.0.4
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +5 -4
- data/lib/sixarm_ruby_magic_number_type.rb +1 -1
- data/test/sixarm_ruby_magic_number_type_test.rb +9 -6
- data/test/sixarm_ruby_magic_number_type_test/file_test.rb +1 -4
- data/test/sixarm_ruby_magic_number_type_test/io_test.rb +1 -4
- data/test/sixarm_ruby_magic_number_type_test/string_test.rb +1 -5
- metadata +118 -27
- metadata.gz.sig +0 -0
- data/.gemtest +0 -0
- data/CONTRIBUTING.md +0 -28
- data/README.md +0 -105
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8499aa03c69751e6108a582028301af353bfa2a
|
4
|
+
data.tar.gz: 7ecbcfafd20b571f82a5422b6803c7cb33e96cb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9adb51204caef213d94a5449508809f143f2fe6337207f9b7f80391978ea1682d57edc52029a3b1a0a6a69f4a1855bd4a7c3d6919f541402dc48145e179cb4d
|
7
|
+
data.tar.gz: e5ef648ba40bd8250b7778999011c9bd92bcc275156cefa7877016826dcf77d5c4167205199e69a66b6d15a932fbda260de957cf0fc3cd121194a8a47f77095b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "rake"
|
3
|
+
require "rake/testtask"
|
4
4
|
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
6
|
-
t.libs
|
7
|
-
t.pattern =
|
6
|
+
t.libs.push("lib", "test")
|
7
|
+
t.pattern = "test/**/*.rb"
|
8
8
|
end
|
9
|
+
task :default => [:test]
|
@@ -1,9 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
|
4
|
-
require
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "coveralls"
|
4
|
+
require "simplecov"
|
5
|
+
Coveralls.wear!
|
6
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
7
|
+
SimpleCov::Formatter::HTMLFormatter,
|
8
|
+
Coveralls::SimpleCov::Formatter
|
9
|
+
]
|
5
10
|
SimpleCov.start
|
11
|
+
require "sixarm_ruby_magic_number_type"
|
6
12
|
|
7
|
-
['file','io','string'].map{|x|
|
8
|
-
require "sixarm_ruby_magic_number_type_test/#{x}_test.rb"
|
9
|
-
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_magic_number_type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SixArm
|
@@ -10,28 +10,122 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
13
|
+
MIIGCTCCA/GgAwIBAgIJAK3igyLv2hNNMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
|
14
|
+
BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJh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C9FOGkybW6DJEFSFFMlNk0IILsa/gNp8ufGuTVLWF9FUUdMNK+TMbghnifT8/1
|
45
|
+
n+ES/gQPOnvmVkLDGw==
|
32
46
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
34
|
-
dependencies:
|
47
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
48
|
+
dependencies:
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: minitest
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 5.7.0
|
56
|
+
- - "<"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '6'
|
59
|
+
type: :development
|
60
|
+
prerelease: false
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 5.7.0
|
66
|
+
- - "<"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 10.4.2
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '11'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 10.4.2
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '11'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: simplecov
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.10.0
|
96
|
+
- - "<"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '2'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 0.10.0
|
106
|
+
- - "<"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '2'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: coveralls
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 0.8.2
|
116
|
+
- - "<"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.8.2
|
126
|
+
- - "<"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '2'
|
35
129
|
description: Tool to parse the first bytes of a file and compare it to a list of known
|
36
130
|
mime types.
|
37
131
|
email: sixarm@sixarm.com
|
@@ -39,11 +133,7 @@ executables: []
|
|
39
133
|
extensions: []
|
40
134
|
extra_rdoc_files: []
|
41
135
|
files:
|
42
|
-
- ".gemtest"
|
43
|
-
- CONTRIBUTING.md
|
44
|
-
- README.md
|
45
136
|
- Rakefile
|
46
|
-
- VERSION
|
47
137
|
- lib/sixarm_ruby_magic_number_type.rb
|
48
138
|
- lib/sixarm_ruby_magic_number_type/file.rb
|
49
139
|
- lib/sixarm_ruby_magic_number_type/io.rb
|
@@ -88,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
178
|
version: '0'
|
89
179
|
requirements: []
|
90
180
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.4.
|
181
|
+
rubygems_version: 2.4.8
|
92
182
|
signing_key:
|
93
183
|
specification_version: 4
|
94
184
|
summary: SixArm.com » Ruby » Magic number type inspects bytes to decide on a mime
|
@@ -110,3 +200,4 @@ test_files:
|
|
110
200
|
- test/sixarm_ruby_magic_number_type_test/samples/sample.tiff
|
111
201
|
- test/sixarm_ruby_magic_number_type_test/samples/sample.bz2
|
112
202
|
- test/sixarm_ruby_magic_number_type_test/samples/sample.gz
|
203
|
+
has_rdoc: true
|
metadata.gz.sig
CHANGED
Binary file
|
data/.gemtest
DELETED
File without changes
|
data/CONTRIBUTING.md
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
Thank you for contributing!
|
4
|
-
|
5
|
-
If you would like to contribute a donation, an easy way is to use PayPal to sixarm@sixarm.com.
|
6
|
-
|
7
|
-
If you would like to contribute help, the next section is for you.
|
8
|
-
|
9
|
-
|
10
|
-
## Contributing to the source
|
11
|
-
|
12
|
-
We love pull requests for improvments to the source code and documentation.
|
13
|
-
|
14
|
-
There are three easy steps:
|
15
|
-
|
16
|
-
1. Fork the repo.
|
17
|
-
|
18
|
-
* Before you do any work please run our existing tests to make sure the code runs cleanly.
|
19
|
-
|
20
|
-
2. Work as you like.
|
21
|
-
|
22
|
-
* Please create tests. This helps us know that all your code runs cleanly.
|
23
|
-
|
24
|
-
3. Push to your fork and submit a pull request.
|
25
|
-
|
26
|
-
* We'll take a look as soon as we can; this is typically within a business day.
|
27
|
-
|
28
|
-
Thank you again!
|
data/README.md
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
# SixArm.com » Ruby » <br> MagicNumberType infers mime types from leading bits
|
2
|
-
|
3
|
-
* Doc: <http://sixarm.com/sixarm_ruby_magic_number_type/doc>
|
4
|
-
* Gem: <http://rubygems.org/gems/sixarm_ruby_magic_number_type>
|
5
|
-
* Repo: <http://github.com/sixarm/sixarm_ruby_magic_number_type>
|
6
|
-
* Email: Joel Parker Henderson, <joel@sixarm.com>
|
7
|
-
|
8
|
-
|
9
|
-
## Introduction
|
10
|
-
|
11
|
-
Magic numbers are the first bits of a file or data stream
|
12
|
-
which uniquely identify the type of file or data stream.
|
13
|
-
|
14
|
-
For example when the first bits are "BM",
|
15
|
-
this identifies the file as a bitmap image file.
|
16
|
-
|
17
|
-
For docs go to <http://sixarm.com/sixarm_ruby_magic_number_type/doc>
|
18
|
-
|
19
|
-
Want to help? We're happy to get pull requests.
|
20
|
-
|
21
|
-
|
22
|
-
## Install quickstart
|
23
|
-
|
24
|
-
Install:
|
25
|
-
|
26
|
-
gem install sixarm_ruby_magic_number_type
|
27
|
-
|
28
|
-
Gemfile:
|
29
|
-
|
30
|
-
gem "sixarm_ruby_magic_number_type", "~>2.0", ">=2.0.2"
|
31
|
-
|
32
|
-
Require:
|
33
|
-
|
34
|
-
require "sixarm_ruby_magic_number_type"
|
35
|
-
|
36
|
-
|
37
|
-
## Install with security (optional)
|
38
|
-
|
39
|
-
To enable high security for all our gems:
|
40
|
-
|
41
|
-
wget http://sixarm.com/sixarm.pem
|
42
|
-
gem cert --add sixarm.pem
|
43
|
-
gem sources --add http://sixarm.com
|
44
|
-
|
45
|
-
To install with high security:
|
46
|
-
|
47
|
-
gem install sixarm_ruby_magic_number_type --test --trust-policy HighSecurity
|
48
|
-
|
49
|
-
|
50
|
-
## Details
|
51
|
-
|
52
|
-
This gem infers based on widespread programming conventions for data file formats.
|
53
|
-
|
54
|
-
These magic numbers are by convention and we are using this guide:
|
55
|
-
http://www.astro.keele.ac.uk/oldusers/rno/Computing/File_magic.html
|
56
|
-
|
57
|
-
Typical uses of magic numbers:
|
58
|
-
|
59
|
-
* to quickly identify a file's data type
|
60
|
-
* to check if data matches the file's MIME type or extension
|
61
|
-
* to check if a web form file upload matches its HTTP content type
|
62
|
-
|
63
|
-
Compare:
|
64
|
-
|
65
|
-
* MIME::Types ruby library
|
66
|
-
* Unix magic() command for testing files on disk
|
67
|
-
* http://shared-mime.rubyforge.org/
|
68
|
-
|
69
|
-
|
70
|
-
## Changes
|
71
|
-
|
72
|
-
* 2015-01-05 2.0.2 Unify duplicate "MZ" to one value
|
73
|
-
* 2015-01-04 2.0.1 Updates for Ruby 2.2: signing certificate, gemspec, tilde version
|
74
|
-
* 2012-09-08 2.0.0 Upgrade with more formats, samples, classes, and hex packing
|
75
|
-
* 2012-04-20 1.2.0 Upgrade to much faster algorithm
|
76
|
-
* 2012-03-14 1.1.0 Update docs, tests
|
77
|
-
|
78
|
-
|
79
|
-
## License
|
80
|
-
|
81
|
-
You may choose any of these open source licenses:
|
82
|
-
|
83
|
-
* Apache License
|
84
|
-
* BSD License
|
85
|
-
* CreativeCommons License, Non-commercial Share Alike
|
86
|
-
* GNU General Public License Version 2 (GPL 2)
|
87
|
-
* GNU Lesser General Public License (LGPL)
|
88
|
-
* MIT License
|
89
|
-
* Perl Artistic License
|
90
|
-
* Ruby License
|
91
|
-
|
92
|
-
The software is provided "as is", without warranty of any kind,
|
93
|
-
express or implied, including but not limited to the warranties of
|
94
|
-
merchantability, fitness for a particular purpose and noninfringement.
|
95
|
-
|
96
|
-
In no event shall the authors or copyright holders be liable for any
|
97
|
-
claim, damages or other liability, whether in an action of contract,
|
98
|
-
tort or otherwise, arising from, out of or in connection with the
|
99
|
-
software or the use or other dealings in the software.
|
100
|
-
|
101
|
-
This license is for the included software that is created by SixArm;
|
102
|
-
some of the included software may have its own licenses, copyrights,
|
103
|
-
authors, etc. and these do take precedence over the SixArm license.
|
104
|
-
|
105
|
-
Copyright (c) 2005-2012 Joel Parker Henderson
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.1
|