Skip to content

Commit

Permalink
Remove rake-compiler in favor of manual step
Browse files Browse the repository at this point in the history
The manual rake definitions allow us to skip the compile process if the
.bundle file is up to date.
  • Loading branch information
mislav committed Feb 4, 2015
1 parent fedf589 commit b131aa2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .gitignore
@@ -1,3 +1,6 @@
.ruby-version
lib/*.bundle
Makefile
*.bundle
*.o
*.log
tmp/
1 change: 0 additions & 1 deletion Gemfile
@@ -1,6 +1,5 @@
source "https://rubygems.org"

gem "rake"
gem "rake-compiler"

gemspec
3 changes: 0 additions & 3 deletions Gemfile.lock
Expand Up @@ -7,13 +7,10 @@ GEM
remote: https://rubygems.org/
specs:
rake (10.4.2)
rake-compiler (0.9.5)
rake

PLATFORMS
ruby

DEPENDENCIES
rake
rake-compiler
version_sorter!
12 changes: 10 additions & 2 deletions Rakefile
@@ -1,5 +1,4 @@
require 'rake/testtask'
require 'rake/extensiontask'

task :default => :test

Expand All @@ -8,5 +7,14 @@ Rake::TestTask.new(:test) do |t|
t.test_files = FileList['test/*test.rb']
end

Rake::ExtensionTask.new('version_sorter')
file 'lib/version_sorter.bundle' => FileList['ext/version_sorter/*.{c,h,rb}'] do |task|
Dir.chdir 'ext/version_sorter' do
sh 'ruby extconf.rb'
sh 'make'
end
mv 'ext/version_sorter/version_sorter.bundle', task.name
end

desc "Compile the native extension"
task :compile => 'lib/version_sorter.bundle'
task :test => :compile

0 comments on commit b131aa2

Please sign in to comment.