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
3dd4c8e0
Unverified
Commit
3dd4c8e0
authored
4 years ago
by
Jon Wood
Committed by
GitHub
4 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into master
parents
af947faa
574ae9e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
ext/mimemagic/Rakefile
+5
-2
No files found.
ext/mimemagic/Rakefile
View file @
3dd4c8e0
...
@@ -6,6 +6,7 @@ def locate_mime_database
...
@@ -6,6 +6,7 @@ def locate_mime_database
(
File
.
expand_path
(
ENV
[
"FREEDESKTOP_MIME_TYPES_PATH"
])
if
ENV
[
"FREEDESKTOP_MIME_TYPES_PATH"
]),
(
File
.
expand_path
(
ENV
[
"FREEDESKTOP_MIME_TYPES_PATH"
])
if
ENV
[
"FREEDESKTOP_MIME_TYPES_PATH"
]),
"/usr/local/share/mime/packages/freedesktop.org.xml"
,
"/usr/local/share/mime/packages/freedesktop.org.xml"
,
"/opt/homebrew/share/mime/packages/freedesktop.org.xml"
,
"/opt/homebrew/share/mime/packages/freedesktop.org.xml"
,
"/opt/local/share/mime/packages/freedesktop.org.xml"
,
"/usr/share/mime/packages/freedesktop.org.xml"
"/usr/share/mime/packages/freedesktop.org.xml"
].
compact
].
compact
path
=
possible_paths
.
find
{
|
candidate
|
File
.
exist?
(
candidate
)
}
path
=
possible_paths
.
find
{
|
candidate
|
File
.
exist?
(
candidate
)
}
...
@@ -23,8 +24,10 @@ end
...
@@ -23,8 +24,10 @@ end
desc
"Build a file pointing at the database"
desc
"Build a file pointing at the database"
task
:default
do
task
:default
do
mime_database_path
=
locate_mime_database
mime_database_path
=
locate_mime_database
path_rb
=
File
.
expand_path
(
"../../../lib/mimemagic/path.rb"
,
__FILE__
)
target_dir
=
"
#{
ENV
.
fetch
(
"RUBYARCHDIR"
)
}
/mimemagic"
open
(
path_rb
,
"w"
)
do
|
f
|
mkdir_p
target_dir
open
(
"
#{
target_dir
}
/path.rb"
,
"w"
)
do
|
f
|
f
.
print
(
<<~
SOURCE
f
.
print
(
<<~
SOURCE
class MimeMagic
class MimeMagic
DATABASE_PATH="
#{
mime_database_path
}
"
DATABASE_PATH="
#{
mime_database_path
}
"
...
...
This diff is collapsed.
Click to expand it.
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