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
This commit is contained in:
parent
ffcff44bc1
commit
af947faab9
|
|
@ -2,6 +2,12 @@
|
|||
*.gem
|
||||
Gemfile.lock
|
||||
.bundle
|
||||
|
||||
# doc
|
||||
.yardoc
|
||||
doc/
|
||||
|
||||
vendor
|
||||
|
||||
# don't include generated files
|
||||
lib/mimemagic/path.rb
|
||||
|
|
|
|||
|
|
@ -1,2 +1,6 @@
|
|||
--markup-provider=redcarpet
|
||||
--markup=markdown
|
||||
--no-private
|
||||
- README.md
|
||||
- README.md
|
||||
- LICENSE
|
||||
- CHANGELOG.md
|
||||
|
|
|
|||
3
Gemfile
3
Gemfile
|
|
@ -1,3 +1,6 @@
|
|||
source 'https://rubygems.org/'
|
||||
gemspec
|
||||
|
||||
gem 'yard'
|
||||
gem 'redcarpet'
|
||||
gem 'github-markup'
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
8
Rakefile
8
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue