hermann 0.11-x86-darwin-12 → 0.15-x86-darwin-12

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,31 +1,25 @@
1
+ require 'rubygems'
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+ require 'rake/extensiontask'
1
5
 
2
- require 'rake/clean'
3
6
 
4
- EXT_CONF = "ext/extconf.rb"
5
- MAKEFILE = 'ext/Makefile'
6
- MODULE = 'ext/hermann_lib.so'
7
- SRC = Dir.glob('ext/*.c')
8
- SRC << MAKEFILE
9
-
10
- CLEAN.include [ 'ext/*.o', 'ext/depend', 'ext/hermann_lib.bundle', MODULE ]
11
- CLOBBER.include [ 'config.save', 'ext/mkmf.log', 'ext/hermann_lib.bundle', MAKEFILE ]
7
+ Rake::ExtensionTask.new do |t|
8
+ t.name = 'hermann_lib'
9
+ t.ext_dir = 'ext/hermann'
10
+ t.gem_spec = Gem::Specification.load('hermann.gemspec')
11
+ end
12
12
 
13
- file MAKEFILE => EXT_CONF do |t|
14
- Dir::chdir(File::dirname(EXT_CONF)) do
15
- unless sh "ruby #{File::basename(EXT_CONF)}"
16
- $stderr.puts "Failed to run extconf"
17
- break
18
- end
19
- end
13
+ RSpec::Core::RakeTask.new(:spec) do |r|
14
+ r.rspec_opts = '--tag ~type:integration'
20
15
  end
21
16
 
22
- file MODULE => SRC do |t|
23
- Dir::chdir(File::dirname(EXT_CONF)) do
24
- unless sh "make"
25
- $stderr.puts "make failed"
26
- end
17
+ namespace :spec do
18
+ RSpec::Core::RakeTask.new(:integration) do |r|
19
+ r.rspec_opts = '--tag type:integration'
27
20
  end
28
21
  end
29
22
 
30
- desc "Build the native library"
31
- task :build => MODULE
23
+ task :build => [:compile]
24
+ task :default => [:clean, :build, :spec]
25
+
data/ext/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 1.8.7-p375
@@ -12,15 +12,17 @@ puts "Include Dir: #{INCLUDEDIR}"
12
12
 
13
13
  HEADER_DIRS = [INCLUDEDIR]
14
14
 
15
- LIB_DIRS = [LIBDIR]
15
+ LIB_DIRS = [LIBDIR, './librdkafka']
16
16
 
17
17
  dir_config('rdkafka', HEADER_DIRS, LIB_DIRS)
18
18
 
19
- unless find_header('librdkafka/rdkafka.h')
19
+ ROOTDIR = File.expand_path(File.dirname(__FILE__) + '/../../')
20
+ RDK = File.join(ROOTDIR, 'librdkafka/target')
21
+ unless find_header('librdkafka/rdkafka.h', File.join(RDK, 'include'))
20
22
  abort "librdkafka not installed"
21
23
  end
22
24
 
23
- unless find_library('rdkafka', 'rd_kafka_conf_new')
25
+ unless find_library('rdkafka', 'rd_kafka_conf_new', File.join(RDK, 'lib'))
24
26
  abort "librdkafka not installed"
25
27
  end
26
28