vghello 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,3 @@
1
+ require 'mkmf'
2
+
3
+ create_makefile('vghello/vghello')
@@ -0,0 +1,16 @@
1
+
2
+ #include <ruby.h> // ruby.h provides declarations for ruby’s C API, which is where the rb_... methods come from
3
+
4
+ /* our new native method; it just returns the string "hi_there" */
5
+ static VALUE vghello_hi(VALUE self) {
6
+ return rb_str_new2("hi_there!");
7
+ }
8
+
9
+ /* ruby calls this to load the extension */
10
+ void Init_vghello(void) {
11
+ /* assume we haven't yet defined Vghello*/
12
+ VALUE klass = rb_define_class("Vghello", rb_cObject);
13
+
14
+ /* the vghello_hi function can be called from ruby as "Vghello.hi" */
15
+ rb_define_singleton_method(klass, "hi", vghello_hi, 0);
16
+ }
data/lib/vghello.rb ADDED
@@ -0,0 +1,7 @@
1
+ class Vghello
2
+ require 'vghello/vghello' # load the extension with the rest of the gem.
3
+
4
+ def self.hello
5
+ puts "Hello world!"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vghello
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - vim guru
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-04-28 00:00:00 +00:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: A simple hello world gem
23
+ email: vg@aaa.com
24
+ executables: []
25
+
26
+ extensions:
27
+ - ext/vghello/extconf.rb
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - lib/vghello.rb
32
+ - ext/vghello/vghello.c
33
+ - ext/vghello/extconf.rb
34
+ has_rdoc: true
35
+ homepage: http://rubygems.org/gems/vghello
36
+ licenses: []
37
+
38
+ post_install_message:
39
+ rdoc_options: []
40
+
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ hash: 3
49
+ segments:
50
+ - 0
51
+ version: "0"
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ requirements: []
62
+
63
+ rubyforge_project:
64
+ rubygems_version: 1.3.7
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: hello summary!
68
+ test_files: []
69
+