Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mimemagic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
mimemagic
Commits
8c3953c4
Commit
8c3953c4
authored
Mar 21, 2015
by
Daniel Mendler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop 1.8.7
parent
52c286c6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
.travis.yml
+0
-2
test/mimemagic_test.rb
+5
-5
No files found.
.travis.yml
View file @
8c3953c4
language
:
ruby
language
:
ruby
rvm
:
rvm
:
-
1.8.7
-
1.9.3
-
1.9.3
-
2.0.0
-
2.0.0
-
2.1.0
-
2.1.0
-
ruby-head
-
ruby-head
-
jruby-18mode
-
jruby-19mode
-
jruby-19mode
-
rbx
-
rbx
matrix
:
matrix
:
...
...
test/mimemagic_test.rb
View file @
8c3953c4
...
@@ -67,9 +67,9 @@ describe 'MimeMagic' do
...
@@ -67,9 +67,9 @@ describe 'MimeMagic' do
it
'should have add'
do
it
'should have add'
do
MimeMagic
.
add
(
'application/mimemagic-test'
,
MimeMagic
.
add
(
'application/mimemagic-test'
,
:extensions
=>
%w(ext1 ext2)
,
extensions:
%w(ext1 ext2)
,
:parents
=>
'application/xml'
,
parents:
'application/xml'
,
:comment
=>
'Comment'
)
comment:
'Comment'
)
MimeMagic
.
by_extension
(
'ext1'
).
should
.
equal
'application/mimemagic-test'
MimeMagic
.
by_extension
(
'ext1'
).
should
.
equal
'application/mimemagic-test'
MimeMagic
.
by_extension
(
'ext2'
).
should
.
equal
'application/mimemagic-test'
MimeMagic
.
by_extension
(
'ext2'
).
should
.
equal
'application/mimemagic-test'
MimeMagic
.
by_extension
(
'ext2'
).
comment
.
should
.
equal
'Comment'
MimeMagic
.
by_extension
(
'ext2'
).
comment
.
should
.
equal
'Comment'
...
@@ -79,7 +79,7 @@ describe 'MimeMagic' do
...
@@ -79,7 +79,7 @@ describe 'MimeMagic' do
it
'should process magic'
do
it
'should process magic'
do
MimeMagic
.
add
(
'application/mimemagic-test'
,
MimeMagic
.
add
(
'application/mimemagic-test'
,
:magic
=>
[[
0
,
'MAGICTEST'
],
# MAGICTEST at position 0
magic:
[[
0
,
'MAGICTEST'
],
# MAGICTEST at position 0
[
1
,
'MAGICTEST'
],
# MAGICTEST at position 1
[
1
,
'MAGICTEST'
],
# MAGICTEST at position 1
[
9
..
12
,
'MAGICTEST'
],
# MAGICTEST starting at position 9 to 12
[
9
..
12
,
'MAGICTEST'
],
# MAGICTEST starting at position 9 to 12
[
2
,
'MAGICTEST'
,
[[
0
,
'X'
],
[
0
,
'Y'
]]]])
# MAGICTEST at position 2 and (X at 0 or Y at 0)
[
2
,
'MAGICTEST'
,
[[
0
,
'X'
],
[
0
,
'Y'
]]]])
# MAGICTEST at position 2 and (X at 0 or Y at 0)
...
@@ -108,7 +108,7 @@ describe 'MimeMagic' do
...
@@ -108,7 +108,7 @@ describe 'MimeMagic' do
end
end
it
'should handle different file objects'
do
it
'should handle different file objects'
do
MimeMagic
.
add
(
'application/mimemagic-test'
,
:magic
=>
[[
0
,
'MAGICTEST'
]])
MimeMagic
.
add
(
'application/mimemagic-test'
,
magic:
[[
0
,
'MAGICTEST'
]])
class
ReadableObj
class
ReadableObj
def
read
def
read
'MAGICTEST'
'MAGICTEST'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment