toss-ruby 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/toss-ruby/toss/toss.cpp +21 -0
  3. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 015c51f338d42c5654c542a2a37d47ffd5f48c10
4
- data.tar.gz: 02af081e99071edf6c1a6d9479afbacb627ee792
3
+ metadata.gz: 3fea97bcdd75d56ae0819aa02d3cd81cbc9cbbf0
4
+ data.tar.gz: bd8c427fc75851a746ba9c009c57e3aba7ff5c5f
5
5
  SHA512:
6
- metadata.gz: 9ce373f85caad1e3796fdbde51e787a10acd091f508eae866521d558984d67fa9e2564f285fffc6c0d85f18ac3b4980e68915b069b7e78b855a47dac67bc5438
7
- data.tar.gz: 5a4f758f6dfbf28a84385491672472a0d451ac125b7d2f91cb412e4967fbe400fa7e228b9ab28d8e90a3f5b43c3cd8da1367459f463c624769039adbdbcec658
6
+ metadata.gz: 7d96f9d8899936b52a5fd4454891b1875cf9f19a5b497d1a2106cbe1235936b0dc162c48e6cc6ad5d3f34c81a960b22250967071695f4e56d3a8b561bb2016e4
7
+ data.tar.gz: 9e997a6832f12f0f0bdb02b50a307b0a862773883c6bfc014d64ec8d86ab0309680a61df05cd6cc0062b961821aca092c9618fb8877682482d82bb67e7552dcf
@@ -22,6 +22,16 @@ gen_parse_file(VALUE self, VALUE file)
22
22
  return Qnil;
23
23
  }
24
24
 
25
+ static VALUE
26
+ gen_parse_string(VALUE self, VALUE string)
27
+ {
28
+ toss::Generator* s;
29
+
30
+ Data_Get_Struct(self, toss::Generator, s);
31
+ s->parseString(StringValueCStr(string));
32
+ return Qnil;
33
+ }
34
+
25
35
  static VALUE
26
36
  gen_generate(VALUE self)
27
37
  {
@@ -32,6 +42,15 @@ gen_generate(VALUE self)
32
42
  return Qnil;
33
43
  }
34
44
 
45
+ static VALUE
46
+ gen_generate_string(VALUE self)
47
+ {
48
+ toss::Generator* s;
49
+
50
+ Data_Get_Struct(self, toss::Generator, s);
51
+ return rb_str_new2(s->generateString().c_str());
52
+ }
53
+
35
54
  void
36
55
  Init_toss()
37
56
  {
@@ -39,5 +58,7 @@ Init_toss()
39
58
  cGenerator = rb_define_class_under(mToss, "Generator", rb_cObject);
40
59
  rb_define_alloc_func(cGenerator, gen_new);
41
60
  rb_define_method(cGenerator, "parse_file", (VALUE(*)(...))gen_parse_file, 1);
61
+ rb_define_method(cGenerator, "parse_string", (VALUE(*)(...))gen_parse_string, 1);
42
62
  rb_define_method(cGenerator, "generate", (VALUE(*)(...))gen_generate, 0);
63
+ rb_define_method(cGenerator, "generate_string", (VALUE(*)(...))gen_generate_string, 0);
43
64
  }
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toss-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nax
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-21 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '10.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '10.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake-compiler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.9'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '0.9'
41
41
  description: Toss-ruby is a ruby binding of the toss library.
42
42
  email: max.bacoux@gmail.com
43
43
  executables: []