Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Support #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ Place the file `freedesktop.org.xml` in an appropriate location, and then set th
`FREEDESKTOP_MIME_TYPES_PATH` to that path. Once that has been done the gem should install successfully. Please
note that the gem will depend upon the file remaining in that location at run time.

For Windows
===============

This was tested in Ruby installed via Ruby Installer, but should work for other methods too.

1. Download 7-Zip from https://www.7-zip.org/download.html
2. Download the package from https://packages.debian.org/sid/amd64/shared-mime-info/download
3. Unzip the file in `data.tar\.\usr\share\mime\packages\freedesktop.org.xml` somewhere, for the purpose of this tutorial assuming C:\shared-mime-info
4. In command line, export environment variable: `set FREEDESKTOP_MIME_TYPES_PATH=C:\shared-mime-info\freedesktop.org.xml`
5. Install the gem via `bundle install` or `gem install mimemagic`

Usage
=====

Expand Down
2 changes: 1 addition & 1 deletion ext/mimemagic/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
desc "Build a file pointing at the database"
task :default do
mime_database_path = locate_mime_database
target_dir = "#{ENV.fetch("RUBYARCHDIR", "../lib")}/mimemagic"
target_dir = File.join(ENV.fetch("RUBYARCHDIR", "../lib"), "mimemagic")
mkdir_p target_dir

open("#{target_dir}/path.rb", "w") do |f|
Expand Down