mirror of
https://github.com/samsonjs/wordexp.git
synced 2026-03-25 08:45:54 +00:00
Use rake-compiler
This commit is contained in:
parent
0795eb3f91
commit
405e52c60c
5 changed files with 13 additions and 12 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -9,5 +9,5 @@
|
|||
/tmp/
|
||||
ext/**/Makefile
|
||||
ext/**/*.o
|
||||
ext/**/*.bundle
|
||||
**/wordexp*.bundle
|
||||
*.gem
|
||||
|
|
|
|||
1
Gemfile
1
Gemfile
|
|
@ -5,6 +5,7 @@ gem 'minitest', '~> 5.11'
|
|||
gem 'minitest-ci', '~> 3.4'
|
||||
gem 'minitest-reporters', '~> 1.3'
|
||||
gem 'rake', '~> 13.0'
|
||||
gem 'rake-compiler', '~> 1.1'
|
||||
gem 'rubocop', '1.24.1'
|
||||
gem 'rubocop-minitest', '0.17.0'
|
||||
gem 'rubocop-packaging', '0.5.1'
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ GEM
|
|||
ast (~> 2.4.1)
|
||||
rainbow (3.1.1)
|
||||
rake (13.0.6)
|
||||
rake-compiler (1.1.7)
|
||||
rake
|
||||
regexp_parser (2.2.0)
|
||||
rexml (3.2.5)
|
||||
rubocop (1.24.1)
|
||||
|
|
@ -55,6 +57,7 @@ DEPENDENCIES
|
|||
minitest-ci (~> 3.4)
|
||||
minitest-reporters (~> 1.3)
|
||||
rake (~> 13.0)
|
||||
rake-compiler (~> 1.1)
|
||||
rubocop (= 1.24.1)
|
||||
rubocop-minitest (= 0.17.0)
|
||||
rubocop-packaging (= 0.5.1)
|
||||
|
|
|
|||
17
Rakefile
17
Rakefile
|
|
@ -1,19 +1,16 @@
|
|||
require 'bundler/gem_tasks'
|
||||
require 'English'
|
||||
require 'open3'
|
||||
require 'rake/extensiontask'
|
||||
require 'rake/testtask'
|
||||
require 'rubocop/rake_task'
|
||||
|
||||
task :compile do
|
||||
puts 'Compiling C extension'
|
||||
# ignore clean failure because the Makefile may not exist yet
|
||||
cmd = 'cd ext/wordexp_ext && (make clean || true) && ruby extconf.rb && make'
|
||||
out, status = Open3.capture2e(cmd)
|
||||
unless status.success?
|
||||
warn out
|
||||
raise 'Failed to compile native extension'
|
||||
end
|
||||
puts 'Done'
|
||||
task :clean do
|
||||
`cd ext/wordexp_ext && make clean && rm -f Makefile`
|
||||
end
|
||||
|
||||
Rake::ExtensionTask.new 'wordexp_ext' do |ext|
|
||||
ext.lib_dir = 'lib/wordexp'
|
||||
end
|
||||
|
||||
Rake::TestTask.new(test: :compile) do |t|
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require 'wordexp_ext/wordexp_ext'
|
||||
require 'wordexp/wordexp_ext'
|
||||
|
||||
module Wordexp
|
||||
autoload :CLI, 'wordexp/cli'
|
||||
|
|
|
|||
Loading…
Reference in a new issue