diff --git a/.gitignore b/.gitignore index b1e6cb7..daba77c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,12 @@ *.gem Gemfile.lock .bundle + +# doc .yardoc +doc/ + vendor + +# don't include generated files lib/mimemagic/path.rb diff --git a/.yardopts b/.yardopts index eab0636..acd858d 100644 --- a/.yardopts +++ b/.yardopts @@ -1,2 +1,6 @@ +--markup-provider=redcarpet +--markup=markdown --no-private -- README.md \ No newline at end of file +- README.md +- LICENSE +- CHANGELOG.md diff --git a/Gemfile b/Gemfile index 560c229..4ec9622 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ source 'https://rubygems.org/' gemspec +gem 'yard' +gem 'redcarpet' +gem 'github-markup' diff --git a/README.md b/README.md index d25a8f7..f5ef301 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,6 @@ Tests ```console $ bundle install -$ cd ext/mimemagic/ -$ bundle exec rake -$ popd $ bundle exec rake test ``` @@ -65,4 +62,4 @@ Authors LICENSE ======= -MIT +{file:LICENSE MIT} diff --git a/Rakefile b/Rakefile index fce08a3..8be77d3 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/ext/mimemagic/Rakefile b/ext/mimemagic/Rakefile index 42ecdf8..5e66637 100644 --- a/ext/mimemagic/Rakefile +++ b/ext/mimemagic/Rakefile @@ -23,11 +23,13 @@ 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{ + path_rb = File.expand_path("../../../lib/mimemagic/path.rb", __FILE__) + open(path_rb, "w") do |f| + f.print(<<~SOURCE class MimeMagic DATABASE_PATH="#{mime_database_path}" end - }) + SOURCE + ) end end