rdkafka 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/ext/Rakefile +17 -3
- data/lib/rdkafka/ffi.rb +7 -10
- data/lib/rdkafka/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d81ac2cd0a6f14c66b39e97f71c273b154d2d8ca
|
4
|
+
data.tar.gz: e7eaa65937211de27685765bd3196affcf20bc27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4033f1e7717797c0ffc4b868c87b186a8648aecd8b1e0580adde6ce955be66151f9a61a467ab74d0487575825f0b077bb690c759ac643f150f347b5a6f74a70
|
7
|
+
data.tar.gz: 75218ad280e0d0a277958c16b61baf7f6d0ee3da35d69de78cf0c022ac03ea422f7a6e09a3e1877732c42cb9300f6109f60384ae05da374a4c95106de75cd264
|
data/.gitignore
CHANGED
data/ext/Rakefile
CHANGED
@@ -2,14 +2,28 @@ require File.expand_path('../../lib/rdkafka/version', __FILE__)
|
|
2
2
|
require "mini_portile2"
|
3
3
|
require "fileutils"
|
4
4
|
|
5
|
-
task :default do
|
5
|
+
task :default => :clean do
|
6
|
+
# Download and compile librdkafka
|
6
7
|
recipe = MiniPortile.new("librdkafka", Rdkafka::LIBRDKAFKA_VERSION)
|
7
8
|
recipe.files = ["https://github.com/edenhill/librdkafka/archive/v#{Rdkafka::LIBRDKAFKA_VERSION}.tar.gz"]
|
8
9
|
recipe.configure_options = ["--host=#{recipe.host}"]
|
9
10
|
recipe.cook
|
11
|
+
# Move dynamic library we're interested in
|
12
|
+
extension = if recipe.host.include?('darwin')
|
13
|
+
'dylib'
|
14
|
+
else
|
15
|
+
'so'
|
16
|
+
end
|
17
|
+
lib_path = File.join(File.dirname(__FILE__), "ports/#{recipe.host}/librdkafka/#{Rdkafka::LIBRDKAFKA_VERSION}/lib/librdkafka.1.#{extension}")
|
18
|
+
FileUtils.mv(lib_path, File.join(File.dirname(__FILE__), "librdkafka.#{extension}"))
|
19
|
+
# Cleanup files created miniportile we don't need in the gem
|
20
|
+
FileUtils.rm_rf File.join(File.dirname(__FILE__), "tmp")
|
21
|
+
FileUtils.rm_rf File.join(File.dirname(__FILE__), "ports")
|
10
22
|
end
|
11
23
|
|
12
24
|
task :clean do
|
13
|
-
FileUtils.
|
14
|
-
FileUtils.
|
25
|
+
FileUtils.rm_f File.join(File.dirname(__FILE__), "librdkafka.dylib")
|
26
|
+
FileUtils.rm_f File.join(File.dirname(__FILE__), "librdkafka.so")
|
27
|
+
FileUtils.rm_rf File.join(File.dirname(__FILE__), "ports")
|
28
|
+
FileUtils.rm_rf File.join(File.dirname(__FILE__), "tmp")
|
15
29
|
end
|
data/lib/rdkafka/ffi.rb
CHANGED
@@ -1,21 +1,18 @@
|
|
1
1
|
require "ffi"
|
2
|
-
require "mini_portile2"
|
3
2
|
|
4
3
|
module Rdkafka
|
5
4
|
module FFI
|
6
5
|
extend ::FFI::Library
|
7
6
|
|
8
|
-
def self.
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
"../../ext/ports/#{mini_portile.host}/librdkafka/#{Rdkafka::LIBRDKAFKA_VERSION}/lib/librdkafka.#{extension}"
|
7
|
+
def self.lib_extension
|
8
|
+
if Gem::Platform.local.os.include?("darwin")
|
9
|
+
'dylib'
|
10
|
+
else
|
11
|
+
'so'
|
12
|
+
end
|
16
13
|
end
|
17
14
|
|
18
|
-
ffi_lib File.join(File.dirname(__FILE__),
|
15
|
+
ffi_lib File.join(File.dirname(__FILE__), "../../ext/librdkafka.#{lib_extension}")
|
19
16
|
|
20
17
|
# Polling
|
21
18
|
|
data/lib/rdkafka/version.rb
CHANGED