Compare commits

...

13 Commits

Author SHA1 Message Date
Jon Wood af5a9b1c5b Update the changelog 2021-03-26 17:37:17 +00:00
Jon Wood 0907a5e7a1 Allow the Rakefile to be used in isolation for test runs 2021-03-26 17:10:05 +00:00
Jon Wood fe1e3d563c Release 0.4.2 2021-03-26 16:59:41 +00:00
Jon Wood 286ac30820
Merge pull request #138 from coldnebo/master
fixes gem development environment
2021-03-26 16:51:49 +00:00
Jon Wood 3dd4c8e095
Merge branch 'master' into master 2021-03-26 16:50:57 +00:00
Jon Wood 574ae9e402 Add support for MacPorts
Closes #124
2021-03-26 16:49:11 +00:00
Jon Wood 9128261e0e
Merge pull request #136 from haines/write-path.rb-to-ruby-arch-dir
Write path.rb to Ruby arch dir so that it can be cached by Bundler
2021-03-26 16:45:42 +00:00
Larry Kyrala af947faab9 fixes gem development environment
- load and namespace the ext/mimemagic/Rakefile into the main Rakefile
- update test task to include ext as a prereq
- add the generated path.rb to clobber

and two fixes to ext/mimemagic/Rakefile

- more robust file load (gem dev vs gem install consistency)
- use squiggly HEREDOC to indent generated file properly

update the readme to match
add LICENSE and CHANGELOG to doc

add yardoc settings for doc writers
2021-03-26 11:45:43 -04:00
Andrew Haines a886e96fc9
Write path.rb to Ruby arch dir so that it can be cached by Bundler 2021-03-26 11:05:35 +00:00
Jon Wood ffcff44bc1
Merge pull request #130 from kachick/still-pureruby-or-not
Update gemspec to follow using nokogiri
2021-03-26 10:37:18 +00:00
Jon Wood 49effbd463
Merge pull request #129 from kachick/correct-how-to-test
Correct how to run test
2021-03-26 10:36:40 +00:00
Kenichi Kamiya 8d8c50a5d9 Update gemspec to follow using nokogiri
Follow d75f3ee5dd
2021-03-26 14:50:45 +09:00
Kenichi Kamiya d12f3cc16e Correct how to run test 2021-03-26 14:31:23 +09:00
9 changed files with 59 additions and 12 deletions

9
.gitignore vendored
View File

@ -2,5 +2,12 @@
*.gem
Gemfile.lock
.bundle
# doc
.yardoc
vendor
doc/
vendor
# don't include generated files
lib/mimemagic/path.rb

View File

@ -1,2 +1,6 @@
--markup-provider=redcarpet
--markup=markdown
--no-private
- README.md
- README.md
- LICENSE
- CHANGELOG.md

View File

@ -21,6 +21,17 @@ None
### Fixed
None
## 0.4.3
* Improve the development/test experience (@coldnebo, @kachick)
* Ensure the gem works in environments with gem caching (@haines)
* Add support for MacPorts installed dependencies (@brlanier)
* Allow using a dummy XML file in cases where the gem is just a transient
dependency. (@Scharrels)
## 0.4.2
@ -41,6 +52,17 @@ to avoid conflicting with other dependencies in people's applications.
Yanked release.
## 0.3.10
* Improve the development/test experience (@coldnebo, @kachick)
* Ensure the gem works in environments with gem caching (@haines)
* Add support for MacPorts installed dependencies (@brlanier)
* Allow using a dummy XML file in cases where the gem is just a transient
dependency. (@Scharrels)
## 0.3.9 (2021-03-25)
* Resolve issues parsing the version of freedesktop.org.xml shipped with

View File

@ -1,3 +1,6 @@
source 'https://rubygems.org/'
gemspec
gem 'yard'
gem 'redcarpet'
gem 'github-markup'

View File

@ -46,10 +46,10 @@ http://www.rubydoc.info/github/mimemagicrb/mimemagic
Tests
=====
```
bundle install
```console
$ bundle install
rake test
$ bundle exec rake test
```
Authors
@ -62,4 +62,4 @@ Authors
LICENSE
=======
MIT
{file:LICENSE MIT}

View File

@ -1,9 +1,15 @@
require 'rake/testtask'
require 'rake/clean'
namespace :ext do
load 'ext/mimemagic/Rakefile'
end
CLOBBER.include("lib/mimemagic/path.rb")
task :default => %w(test)
desc 'Run tests with minitest'
Rake::TestTask.new do |t|
Rake::TestTask.new("test" => "ext:default") do |t|
t.libs << 'test'
t.pattern = 'test/*_test.rb'
end

View File

@ -6,6 +6,7 @@ def locate_mime_database
(File.expand_path(ENV["FREEDESKTOP_MIME_TYPES_PATH"]) if ENV["FREEDESKTOP_MIME_TYPES_PATH"]),
"/usr/local/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"
].compact
path = possible_paths.find { |candidate| File.exist?(candidate) }
@ -23,11 +24,15 @@ end
desc "Build a file pointing at the database"
task :default do
mime_database_path = locate_mime_database
open("../../lib/mimemagic/path.rb", "w") do |f|
f.print(%Q{
target_dir = "#{ENV.fetch("RUBYARCHDIR", "../lib")}/mimemagic"
mkdir_p target_dir
open("#{target_dir}/path.rb", "w") do |f|
f.print(<<~SOURCE
class MimeMagic
DATABASE_PATH="#{mime_database_path}"
end
})
SOURCE
)
end
end

View File

@ -1,5 +1,5 @@
class MimeMagic
# MimeMagic version string
# @api public
VERSION = '0.4.2'
VERSION = '0.4.3'
end

View File

@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.extensions = %w(ext/mimemagic/Rakefile)
s.summary = 'Fast mime detection by extension or content'
s.description = 'Fast mime detection by extension or content in pure ruby (Uses freedesktop.org.xml shared-mime-info database)'
s.description = 'Fast mime detection by extension or content (Uses freedesktop.org.xml shared-mime-info database)'
s.homepage = 'https://github.com/mimemagicrb/mimemagic'
s.license = 'MIT'