rubber-generate 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rubber/codegen/genum.rb +7 -0
- data/lib/rubber/codegen/gflags.rb +3 -1
- data/lib/rubber/version.rb +1 -1
- metadata +4 -4
data/lib/rubber/codegen/genum.rb
CHANGED
@@ -8,6 +8,13 @@ class C_GEnum < C_Enum
|
|
8
8
|
def init()
|
9
9
|
($custom_maps[name] ||= {})["VALUE"] = "GENUM2RVAL(%%, #{g_type})"
|
10
10
|
($custom_maps["VALUE"] ||= {})[name] = "RVAL2GENUM(%%, #{g_type})"
|
11
|
+
|
12
|
+
gt = g_type.dup
|
13
|
+
gt.sub!("#{$1}_TYPE","#{$1}") if gt =~ /\A([A-Z]+)_TYPE/ # Strip TYPE bit
|
14
|
+
tc = gt.downcase.capitalize.gsub(/_[a-z]/){ |i| i[1..1].upcase}
|
15
|
+
|
16
|
+
($custom_maps["VALUE"] ||= {})[tc] = "RVAL2GFLAGS(%%, #{g_type})"
|
17
|
+
($custom_maps[tc] ||= {})["VALUE"] = "GFLAGS2RVAL(%%, #{g_type})"
|
11
18
|
end
|
12
19
|
def code(io)
|
13
20
|
end
|
@@ -7,11 +7,13 @@ class C_GFlags < C_Enum
|
|
7
7
|
def init()
|
8
8
|
($custom_maps[name] ||= {})["VALUE"] = "GFLAGS2RVAL(%%, #{g_type})"
|
9
9
|
($custom_maps["VALUE"] ||= {})[name] = "RVAL2GFLAGS(%%, #{g_type})"
|
10
|
+
|
10
11
|
gt = g_type.dup
|
11
12
|
gt.sub!("#{$1}_TYPE","#{$1}") if gt =~ /\A([A-Z]+)_TYPE/ # Strip TYPE bit
|
12
13
|
tc = gt.downcase.capitalize.gsub(/_[a-z]/){ |i| i[1..1].upcase}
|
13
|
-
|
14
|
+
|
14
15
|
($custom_maps["VALUE"] ||= {})[tc] = "RVAL2GFLAGS(%%, #{g_type})"
|
16
|
+
($custom_maps[tc] ||= {})["VALUE"] = "GFLAGS2RVAL(%%, #{g_type})"
|
15
17
|
end
|
16
18
|
def code(io)
|
17
19
|
end
|
data/lib/rubber/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubber-generate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 53
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 21
|
10
|
+
version: 0.0.21
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Geoff Youngs
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-08-03 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: " rubber-c-binder allows a rubyish means of generating bindings for C libraries,\n including (but not limited to) GObject based libraries.\n\n It allows C code to be written in the context of a ruby style class/method layout\n and eases type checking and conversion between Ruby & C datatypes.\n"
|