native-gem 0.0.1

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.
@@ -0,0 +1,8 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .junk
6
+ .rvmrc
7
+ tmp
8
+ lib/**/*.bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in native-gem.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ native-gem
2
+ ==========
3
+
4
+ ##About
5
+
6
+ native-gem is an example gem with a native extension. It uses bundler and rake-compiler. It provides a `NativeGem` module with a `hello_world` method defined in C.
7
+
8
+ ###Install
9
+
10
+ $ gem install native-gem
11
+
12
+ ###Useage
13
+
14
+ ```ruby
15
+ require 'native-gem'
16
+ NativeGem.hello_world
17
+ # => "hello, world!"
18
+ ```
19
+
20
+ ###License
21
+
22
+ native-gem is in the public domain.
@@ -0,0 +1,9 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rake/extensiontask'
4
+
5
+ Rake::ExtensionTask.new("native_gem") do |ext|
6
+ ext.lib_dir = "lib/native-gem"
7
+
8
+ CLEAN.include "#{ext.lib_dir}/*.#{RbConfig::CONFIG['DLEXT']}"
9
+ end
@@ -0,0 +1,3 @@
1
+ require 'mkmf'
2
+
3
+ create_makefile("native-gem/native_gem")
@@ -0,0 +1,12 @@
1
+ #include <ruby.h>
2
+
3
+ static VALUE hello_world()
4
+ {
5
+ return rb_str_new2("hello, world!");
6
+ }
7
+
8
+ Init_native_gem()
9
+ {
10
+ VALUE mNativeGem = rb_define_module("NativeGem");
11
+ rb_define_singleton_method(mNativeGem, "hello_world", hello_world, 0);
12
+ }
@@ -0,0 +1,5 @@
1
+ require "native-gem/version"
2
+ require "native-gem/native_gem" # the c extension
3
+
4
+ module NativeGem
5
+ end
@@ -0,0 +1,3 @@
1
+ module NativeGem
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "native-gem/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "native-gem"
7
+ s.version = NativeGem::VERSION
8
+ s.authors = ["David Albert"]
9
+ s.email = ["davidbalbert@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{A simple gem with native extensions}
12
+ s.description = %q{A simple gem with native extensions, built using bunlder and rake-compiler}
13
+
14
+ s.rubyforge_project = "native-gem"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+ s.extensions = ["ext/native_gem/extconf.rb"]
21
+
22
+ s.add_development_dependency "rake-compiler"
23
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: native-gem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - David Albert
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-09-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake-compiler
16
+ requirement: &70118449387780 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70118449387780
25
+ description: A simple gem with native extensions, built using bunlder and rake-compiler
26
+ email:
27
+ - davidbalbert@gmail.com
28
+ executables: []
29
+ extensions:
30
+ - ext/native_gem/extconf.rb
31
+ extra_rdoc_files: []
32
+ files:
33
+ - .gitignore
34
+ - Gemfile
35
+ - README.md
36
+ - Rakefile
37
+ - ext/native_gem/extconf.rb
38
+ - ext/native_gem/native_gem.c
39
+ - lib/native-gem.rb
40
+ - lib/native-gem/version.rb
41
+ - native-gem.gemspec
42
+ homepage: ''
43
+ licenses: []
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project: native-gem
62
+ rubygems_version: 1.8.10
63
+ signing_key:
64
+ specification_version: 3
65
+ summary: A simple gem with native extensions
66
+ test_files: []