snappy_ext 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/ext/snappy/extconf.rb +36 -0
  2. data/ext/snappy/snappy_ext.cc +131 -0
  3. data/ext/snappy/vendor/snappy-1.0.0/AUTHORS +1 -0
  4. data/ext/snappy/vendor/snappy-1.0.0/COPYING +28 -0
  5. data/ext/snappy/vendor/snappy-1.0.0/ChangeLog +3 -0
  6. data/ext/snappy/vendor/snappy-1.0.0/INSTALL +230 -0
  7. data/ext/snappy/vendor/snappy-1.0.0/Makefile.am +24 -0
  8. data/ext/snappy/vendor/snappy-1.0.0/Makefile.in +926 -0
  9. data/ext/snappy/vendor/snappy-1.0.0/NEWS +3 -0
  10. data/ext/snappy/vendor/snappy-1.0.0/README +132 -0
  11. data/ext/snappy/vendor/snappy-1.0.0/aclocal.m4 +9076 -0
  12. data/ext/snappy/vendor/snappy-1.0.0/autogen.sh +8 -0
  13. data/ext/snappy/vendor/snappy-1.0.0/compile +99 -0
  14. data/ext/snappy/vendor/snappy-1.0.0/config.guess +1466 -0
  15. data/ext/snappy/vendor/snappy-1.0.0/config.h.in +107 -0
  16. data/ext/snappy/vendor/snappy-1.0.0/config.sub +1579 -0
  17. data/ext/snappy/vendor/snappy-1.0.0/configure +17962 -0
  18. data/ext/snappy/vendor/snappy-1.0.0/configure.ac +99 -0
  19. data/ext/snappy/vendor/snappy-1.0.0/depcomp +530 -0
  20. data/ext/snappy/vendor/snappy-1.0.0/install-sh +323 -0
  21. data/ext/snappy/vendor/snappy-1.0.0/ltmain.sh +8413 -0
  22. data/ext/snappy/vendor/snappy-1.0.0/m4/gtest.m4 +74 -0
  23. data/ext/snappy/vendor/snappy-1.0.0/missing +360 -0
  24. data/ext/snappy/vendor/snappy-1.0.0/mkinstalldirs +158 -0
  25. data/ext/snappy/vendor/snappy-1.0.0/snappy-internal.h +136 -0
  26. data/ext/snappy/vendor/snappy-1.0.0/snappy-sinksource.cc +46 -0
  27. data/ext/snappy/vendor/snappy-1.0.0/snappy-sinksource.h +110 -0
  28. data/ext/snappy/vendor/snappy-1.0.0/snappy-stubs-internal.cc +28 -0
  29. data/ext/snappy/vendor/snappy-1.0.0/snappy-stubs-internal.h +457 -0
  30. data/ext/snappy/vendor/snappy-1.0.0/snappy-stubs-public.h +59 -0
  31. data/ext/snappy/vendor/snappy-1.0.0/snappy-stubs-public.h.in +59 -0
  32. data/ext/snappy/vendor/snappy-1.0.0/snappy-test.cc +523 -0
  33. data/ext/snappy/vendor/snappy-1.0.0/snappy-test.h +458 -0
  34. data/ext/snappy/vendor/snappy-1.0.0/snappy.cc +1001 -0
  35. data/ext/snappy/vendor/snappy-1.0.0/snappy.h +141 -0
  36. data/ext/snappy/vendor/snappy-1.0.0/snappy_unittest.cc +1073 -0
  37. data/ext/snappy/version.h +4 -0
  38. data/snappy_ext.gemspec +58 -0
  39. metadata +99 -0
@@ -0,0 +1,4 @@
1
+ #ifndef SNAPPY_VERSION
2
+ #define SNAPPY_VERSION "1.0.0"
3
+ #endif
4
+ #define GEM_VERSION "0.1.2"
@@ -0,0 +1,58 @@
1
+ # Determine our own version
2
+ VERSION_HEADER = File.join(File.dirname(__FILE__), 'ext', 'snappy', 'version.h')
3
+ MY_GEM_VERSION = File.read(VERSION_HEADER) =~ /GEM_VERSION "(.*)"/ && $1
4
+ SNAPPY_VERSION = File.read(VERSION_HEADER) =~ /SNAPPY_VERSION "(.*)"/ && $1
5
+
6
+ VENDOR_DIR = File.join(File.dirname(__FILE__), 'ext', 'snappy', 'vendor')
7
+ Dir.mkdir(VENDOR_DIR) unless File.exists?(VENDOR_DIR)
8
+
9
+ # Determine Snappy's version and path
10
+ SNAPPY_DIR = File.join(VENDOR_DIR, "snappy-#{SNAPPY_VERSION}")
11
+
12
+ # Download and unpack Snappy if needed
13
+ unless File.exists?(SNAPPY_DIR)
14
+ old_pwd = Dir.pwd
15
+ archive = "#{File.basename SNAPPY_DIR}.tar.gz"
16
+
17
+ begin
18
+ Dir.chdir(File.dirname(SNAPPY_DIR))
19
+ puts "Downloading and unpacking #{File.basename SNAPPY_DIR}..."
20
+ system "curl", "http://snappy.googlecode.com/files/snappy-#{SNAPPY_VERSION}.tar.gz", "-o", archive
21
+ system "tar", "xzf", archive
22
+
23
+ ensure
24
+ File.unlink(archive) if File.exists?(archive)
25
+ Dir.chdir(old_pwd)
26
+ end
27
+ end
28
+
29
+ Gem::Specification.new do |s|
30
+ s.name = 'snappy_ext'
31
+
32
+ s.version = MY_GEM_VERSION
33
+ s.platform = Gem::Platform::RUBY
34
+ s.summary = 'C extension for the Snappy compression algorithm.'
35
+ s.description = "C extension to to bring the Snappy compression library to Ruby. Google's C++ implementation (version #{SNAPPY_VERSION}) is statically linked into this extension, resulting in no runtime dependencies."
36
+
37
+ s.require_paths = ['ext']
38
+
39
+ %w(
40
+ snappy_ext.gemspec
41
+ ext/snappy/*.cc
42
+ ext/snappy/*.h
43
+ ext/snappy/*.rb
44
+ ext/snappy/vendor/snappy-*/*
45
+ ext/snappy/vendor/snappy-*/m4/*
46
+ ).each { |spec|
47
+ s.files += Dir[spec].select { |fn| File.file?(fn) }
48
+ }
49
+
50
+ s.has_rdoc = false
51
+ s.extensions << 'ext/snappy/extconf.rb'
52
+
53
+ s.author = 'Will Glynn'
54
+ s.email = 'will@willglynn.com'
55
+ s.homepage = 'http://github.com/delta407/snappy-ruby'
56
+
57
+ # s.add_dependency 'snappy', "=#{MY_GEM_VERSION}"
58
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: snappy_ext
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 2
9
+ version: 0.1.2
10
+ platform: ruby
11
+ authors:
12
+ - Will Glynn
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-03-24 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: C extension to to bring the Snappy compression library to Ruby. Google's C++ implementation (version 1.0.0) is statically linked into this extension, resulting in no runtime dependencies.
22
+ email: will@willglynn.com
23
+ executables: []
24
+
25
+ extensions:
26
+ - ext/snappy/extconf.rb
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - snappy_ext.gemspec
31
+ - ext/snappy/snappy_ext.cc
32
+ - ext/snappy/version.h
33
+ - ext/snappy/extconf.rb
34
+ - ext/snappy/vendor/snappy-1.0.0/aclocal.m4
35
+ - ext/snappy/vendor/snappy-1.0.0/AUTHORS
36
+ - ext/snappy/vendor/snappy-1.0.0/autogen.sh
37
+ - ext/snappy/vendor/snappy-1.0.0/ChangeLog
38
+ - ext/snappy/vendor/snappy-1.0.0/compile
39
+ - ext/snappy/vendor/snappy-1.0.0/config.guess
40
+ - ext/snappy/vendor/snappy-1.0.0/config.h.in
41
+ - ext/snappy/vendor/snappy-1.0.0/config.sub
42
+ - ext/snappy/vendor/snappy-1.0.0/configure
43
+ - ext/snappy/vendor/snappy-1.0.0/configure.ac
44
+ - ext/snappy/vendor/snappy-1.0.0/COPYING
45
+ - ext/snappy/vendor/snappy-1.0.0/depcomp
46
+ - ext/snappy/vendor/snappy-1.0.0/INSTALL
47
+ - ext/snappy/vendor/snappy-1.0.0/install-sh
48
+ - ext/snappy/vendor/snappy-1.0.0/ltmain.sh
49
+ - ext/snappy/vendor/snappy-1.0.0/Makefile.am
50
+ - ext/snappy/vendor/snappy-1.0.0/Makefile.in
51
+ - ext/snappy/vendor/snappy-1.0.0/missing
52
+ - ext/snappy/vendor/snappy-1.0.0/mkinstalldirs
53
+ - ext/snappy/vendor/snappy-1.0.0/NEWS
54
+ - ext/snappy/vendor/snappy-1.0.0/README
55
+ - ext/snappy/vendor/snappy-1.0.0/snappy-internal.h
56
+ - ext/snappy/vendor/snappy-1.0.0/snappy-sinksource.cc
57
+ - ext/snappy/vendor/snappy-1.0.0/snappy-sinksource.h
58
+ - ext/snappy/vendor/snappy-1.0.0/snappy-stubs-internal.cc
59
+ - ext/snappy/vendor/snappy-1.0.0/snappy-stubs-internal.h
60
+ - ext/snappy/vendor/snappy-1.0.0/snappy-stubs-public.h
61
+ - ext/snappy/vendor/snappy-1.0.0/snappy-stubs-public.h.in
62
+ - ext/snappy/vendor/snappy-1.0.0/snappy-test.cc
63
+ - ext/snappy/vendor/snappy-1.0.0/snappy-test.h
64
+ - ext/snappy/vendor/snappy-1.0.0/snappy.cc
65
+ - ext/snappy/vendor/snappy-1.0.0/snappy.h
66
+ - ext/snappy/vendor/snappy-1.0.0/snappy_unittest.cc
67
+ - ext/snappy/vendor/snappy-1.0.0/m4/gtest.m4
68
+ has_rdoc: true
69
+ homepage: http://github.com/delta407/snappy-ruby
70
+ licenses: []
71
+
72
+ post_install_message:
73
+ rdoc_options: []
74
+
75
+ require_paths:
76
+ - ext
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ segments:
89
+ - 0
90
+ version: "0"
91
+ requirements: []
92
+
93
+ rubyforge_project:
94
+ rubygems_version: 1.3.6
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: C extension for the Snappy compression algorithm.
98
+ test_files: []
99
+