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
a45a137a
Unverified
Commit
a45a137a
authored
Jul 29, 2020
by
Daniel Mendler
Committed by
GitHub
Jul 29, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #87 from aliismayilov/frozen-string-literals
Ensure that frozen string literals used throughout the code
parents
01f92d86
295ded4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
.travis.yml
+16
-15
lib/mimemagic.rb
+3
-1
test/mimemagic_test.rb
+1
-1
No files found.
.travis.yml
View file @
a45a137a
language
:
ruby
rvm
:
-
1.9.3
-
2.0.0
-
2.1
-
2.2
-
2.3
-
2.4
-
2.5
-
ruby-head
-
jruby-19mode
-
rbx-3
jobs
:
include
:
-
rvm
:
1.9.3
-
rvm
:
2.0.0
-
rvm
:
2.1
-
rvm
:
2.2
-
rvm
:
2.3
-
rvm
:
2.4
env
:
RUBYOPT="--enable-frozen-string-literal"
-
rvm
:
2.5
env
:
RUBYOPT="--enable-frozen-string-literal"
-
rvm
:
ruby-head
env
:
RUBYOPT="--enable-frozen-string-literal"
before_install
:
# 1. The pre-installed Bundler version on Travis is very old; causes 1.9.3 build issues
# 2. Bundler 2.0 is not supported by the whole matrix
-
gem install bundler -v'< 2'
matrix
:
allow_failures
:
-
rvm
:
ruby-head
-
rvm
:
rbx-3
script
:
-
bundle exec rake
lib/mimemagic.rb
View file @
a45a137a
# frozen_string_literal: true
require
'mimemagic/tables'
require
'mimemagic/version'
...
...
@@ -113,7 +115,7 @@ class MimeMagic
io
.
binmode
if
io
.
respond_to?
(
:binmode
)
io
.
set_encoding
(
Encoding
::
BINARY
)
if
io
.
respond_to?
(
:set_encoding
)
buffer
=
""
.
force_encoding
(
Encoding
::
BINARY
)
buffer
=
""
.
encode
(
Encoding
::
BINARY
)
MAGIC
.
send
(
method
)
{
|
type
,
matches
|
magic_match_io
(
io
,
matches
,
buffer
)
}
end
...
...
test/mimemagic_test.rb
View file @
a45a137a
...
...
@@ -44,7 +44,7 @@ class TestMimeMagic < Minitest::Test
end
def
test_have_extensions
assert_equal
%w(htm
html
)
,
MimeMagic
.
new
(
'text/html'
).
extensions
assert_equal
%w(htm
l htm
)
,
MimeMagic
.
new
(
'text/html'
).
extensions
end
def
test_have_comment
...
...
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