1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Prepare extension in C

This commit is contained in:
Takashi Kokubun 2015-11-26 01:07:06 +09:00
parent 514c01bcb1
commit 0c2ac19906
6 changed files with 23 additions and 2 deletions

4
.gitignore vendored
View file

@ -10,3 +10,7 @@
.sass-cache
/hamlit1
.ruby-version
*.bundle
*.so
*.o
*.a

View file

@ -1,5 +1,6 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rake/extensiontask'
Dir['benchmark/*.rake'].each { |b| import(b) }
@ -70,5 +71,9 @@ namespace :test do
end
end
task default: %w[hamlit:test]
task test: %w[test:all]
Rake::ExtensionTask.new(:hamlit) do |ext|
ext.lib_dir = 'lib/hamlit'
end
task default: %w[compile hamlit:test]
task test: %w[compile test:all]

3
ext/hamlit/extconf.rb Normal file
View file

@ -0,0 +1,3 @@
require 'mkmf'
create_makefile('hamlit/hamlit')

6
ext/hamlit/hamlit.c Normal file
View file

@ -0,0 +1,6 @@
#include <ruby.h>
void
Init_hamlit(void)
{
}

View file

@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|hamlit1|sample)/}) }
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.extensions = ['ext/hamlit/extconf.rb']
spec.require_paths = ['lib']
spec.add_dependency 'escape_utils'
@ -31,6 +32,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest-reporters', '~> 1.1'
spec.add_development_dependency 'rails', '>= 4.0.0'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rake-compiler'
spec.add_development_dependency 'redcarpet'
spec.add_development_dependency 'sass'
spec.add_development_dependency 'slim'

View file

@ -1,3 +1,4 @@
require 'hamlit/hamlit'
require 'hamlit/object_ref'
require 'temple/utils'