hola_oleiman 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/hola/extconf.rb +3 -0
- data/ext/hola/hola.c +15 -0
- data/lib/hola/translator.rb +1 -1
- data/lib/hola.rb +10 -2
- metadata +7 -4
data/ext/hola/extconf.rb
ADDED
data/ext/hola/hola.c
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#include <ruby.h>
|
2
|
+
|
3
|
+
static VALUE hola_bonjour(VALUE self) {
|
4
|
+
return rb_str_new2("bonjour!");
|
5
|
+
}
|
6
|
+
|
7
|
+
/* ruby calls this to load the extension */
|
8
|
+
void Init_hola(void) {
|
9
|
+
/* assume Hola is not yet defined */
|
10
|
+
VALUE klass = rb_define_class("Hola", rb_cObject);
|
11
|
+
|
12
|
+
/* the hola_bonjour function can be called
|
13
|
+
from ruby as "Hola.bonjour" */
|
14
|
+
rb_define_singleton_method(klass, "bonjour", hola_bonjour, 0);
|
15
|
+
}
|
data/lib/hola/translator.rb
CHANGED
data/lib/hola.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
+
# The main Hola driver
|
2
|
+
class Hola
|
3
|
+
# Simple hello world class
|
1
4
|
|
5
|
+
# Example:
|
6
|
+
# >> Hola.hi(:spanish)
|
7
|
+
# => "Hola, Mundo!"
|
8
|
+
|
9
|
+
# Arguments:
|
10
|
+
# lang: (String)
|
2
11
|
|
3
|
-
class Hola
|
4
12
|
def self.hi(lang = "english")
|
5
13
|
translator = Translator.new(lang)
|
6
|
-
|
14
|
+
translator.hi
|
7
15
|
end
|
8
16
|
end
|
9
17
|
require 'hola/translator'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hola_oleiman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,11 +15,14 @@ description: A simple hello world gem
|
|
15
15
|
email: mumblemumble777@gmail.com
|
16
16
|
executables:
|
17
17
|
- hola
|
18
|
-
extensions:
|
18
|
+
extensions:
|
19
|
+
- ext/hola/extconf.rb
|
19
20
|
extra_rdoc_files: []
|
20
21
|
files:
|
21
|
-
- lib/hola.rb
|
22
22
|
- lib/hola/translator.rb
|
23
|
+
- lib/hola.rb
|
24
|
+
- ext/hola/hola.c
|
25
|
+
- ext/hola/extconf.rb
|
23
26
|
- bin/hola
|
24
27
|
homepage: http://rubygems.org/gems/hola_oleiman
|
25
28
|
licenses: []
|
@@ -41,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
44
|
version: '0'
|
42
45
|
requirements: []
|
43
46
|
rubyforge_project:
|
44
|
-
rubygems_version: 1.8.
|
47
|
+
rubygems_version: 1.8.23
|
45
48
|
signing_key:
|
46
49
|
specification_version: 3
|
47
50
|
summary: Hola!
|