infraruby-java 3.7.0 → 3.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1145b725c04975f59fa283a7f37993e695d3ec61
4
- data.tar.gz: 8b9ce0a3c394a37f6db4d6db243ecaf193c5792b
3
+ metadata.gz: d00e7de703aae51d7d474b145c2f703c933efc4f
4
+ data.tar.gz: c389f046d3fdbda9139c73b98180c50a0acb69ce
5
5
  SHA512:
6
- metadata.gz: d81ddeb5111c92d0e9f7a7f6504bea68a5713cdb83fe21f19a5ea4f91b22902e98ff698678cef8a0250c7084a81654c39bfe23257544b7c18cc7205bcf37190a
7
- data.tar.gz: 09effa1171e1cee38cd648667323b5497af50160b48a89ae62cb7c466dd296525f0f5d0ab0762a81a705d1b95968049bcc8e6d9b7eb8666c9d473d131aa5cb7a
6
+ metadata.gz: c25fed5902e1ab4cece7e6c4fc9d2f262a351bc7831c311d11687f6c583fd839ceddc222e46697f4472e498dff753e003fbe3210c8f01b3f96581609c66ed305
7
+ data.tar.gz: 1d9c2782e59fea5010dad56119371ff996c4ce93f7deb6ea9f86b61674d8fa072d04633a7d9202439414eef90a1f774e7c83fc8917f11faa90ecab9e7d33ec0e
data/README.md CHANGED
@@ -9,10 +9,9 @@ Example
9
9
 
10
10
  require "infraruby-java"
11
11
 
12
- a = 1.i32
13
- b = 2.i32
14
- c = a + b
15
- puts c
12
+ c1 = Int32[1]
13
+ c2 = Int32[2]
14
+ puts c1 + c2
16
15
 
17
16
 
18
17
  Support
@@ -1195,6 +1195,13 @@ public class PrimitiveService implements BasicLibraryService {
1195
1195
  return RubyString.newString(runtime, PrimitiveService.__int32_chr(runtime, value));
1196
1196
  }
1197
1197
  @JRubyMethod
1198
+ public Int32 succ() {
1199
+ Ruby runtime = getRuntime();
1200
+ if (value == 0x7FFFFFFF)
1201
+ throw runtime.newLightweightStopIterationError("StopIteration");
1202
+ return new Int32(PrimitiveService.Int32Class, value + 1);
1203
+ }
1204
+ @JRubyMethod
1198
1205
  public Int32 rol(IRubyObject o) {
1199
1206
  Ruby runtime = getRuntime();
1200
1207
  int v = PrimitiveService.__object_i32(runtime, o);
@@ -1532,6 +1539,13 @@ public class PrimitiveService implements BasicLibraryService {
1532
1539
  return RubyString.newString(runtime, PrimitiveService.__int64_to_hex(runtime, value));
1533
1540
  }
1534
1541
  @JRubyMethod
1542
+ public Int64 succ() {
1543
+ Ruby runtime = getRuntime();
1544
+ if (value == 0x7FFFFFFFFFFFFFFFL)
1545
+ throw runtime.newLightweightStopIterationError("StopIteration");
1546
+ return new Int64(PrimitiveService.Int64Class, value + 1);
1547
+ }
1548
+ @JRubyMethod
1535
1549
  public Int64 rol(IRubyObject o) {
1536
1550
  Ruby runtime = getRuntime();
1537
1551
  int v = PrimitiveService.__object_i32(runtime, o);
@@ -2048,6 +2048,16 @@ r_Int32_chr(VALUE self)
2048
2048
  return __int32_chr(value);
2049
2049
  }
2050
2050
  static VALUE
2051
+ r_Int32_succ(VALUE self)
2052
+ {
2053
+ Int32 *p;
2054
+ Data_Get_Struct(self, Int32, p);
2055
+ int32_t value = p->value;
2056
+ if (value == 0x7FFFFFFF)
2057
+ rb_raise(rb_eStopIteration, "StopIteration");
2058
+ return __allocate_Int32(value + 1);
2059
+ }
2060
+ static VALUE
2051
2061
  r_Int32_rol(VALUE self, VALUE o)
2052
2062
  {
2053
2063
  Int32 *p;
@@ -2452,7 +2462,7 @@ r_Int64_bang_to_int32(VALUE self)
2452
2462
  Int64 *p;
2453
2463
  Data_Get_Struct(self, Int64, p);
2454
2464
  int64_t value = p->value;
2455
- if (value < -0x80000000L || value > 0x7FFFFFFFL)
2465
+ if (value < -0x0000000080000000L || value > 0x000000007FFFFFFFL)
2456
2466
  rb_raise(rb_eRangeError, "int64 too big to convert to int32");
2457
2467
  return __allocate_Int32((int32_t) value);
2458
2468
  }
@@ -2478,6 +2488,16 @@ r_Int64_to_hex(VALUE self)
2478
2488
  return __int64_to_hex(value);
2479
2489
  }
2480
2490
  static VALUE
2491
+ r_Int64_succ(VALUE self)
2492
+ {
2493
+ Int64 *p;
2494
+ Data_Get_Struct(self, Int64, p);
2495
+ int64_t value = p->value;
2496
+ if (value == 0x7FFFFFFFFFFFFFFFL)
2497
+ rb_raise(rb_eStopIteration, "StopIteration");
2498
+ return __allocate_Int64(value + 1);
2499
+ }
2500
+ static VALUE
2481
2501
  r_Int64_rol(VALUE self, VALUE o)
2482
2502
  {
2483
2503
  Int64 *p;
@@ -3813,6 +3833,7 @@ Init_primitive()
3813
3833
  rb_define_method(r_Int32, "new_fixnum", r_Int32_to_fixnum, 0);
3814
3834
  rb_define_method(r_Int32, "to_hex", r_Int32_to_hex, 0);
3815
3835
  rb_define_method(r_Int32, "chr", r_Int32_chr, 0);
3836
+ rb_define_method(r_Int32, "succ", r_Int32_succ, 0);
3816
3837
  rb_define_method(r_Int32, "rol", r_Int32_rol, 1);
3817
3838
  rb_define_method(r_Int32, "ror", r_Int32_ror, 1);
3818
3839
  rb_define_method(r_Int32, "count", r_Int32_count, 0);
@@ -3866,6 +3887,7 @@ Init_primitive()
3866
3887
  rb_define_method(r_Int64, "to_fixnum", r_Int64_to_fixnum, 0);
3867
3888
  rb_define_method(r_Int64, "new_fixnum", r_Int64_to_fixnum, 0);
3868
3889
  rb_define_method(r_Int64, "to_hex", r_Int64_to_hex, 0);
3890
+ rb_define_method(r_Int64, "succ", r_Int64_succ, 0);
3869
3891
  rb_define_method(r_Int64, "rol", r_Int64_rol, 1);
3870
3892
  rb_define_method(r_Int64, "ror", r_Int64_ror, 1);
3871
3893
  rb_define_method(r_Int64, "count", r_Int64_count, 0);
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = "ruby"
3
3
  s.name = "infraruby-java"
4
- s.version = "3.7.0"
4
+ s.version = "3.7.1"
5
5
  s.licenses = ["MIT"]
6
6
  s.author = "InfraRuby Vision"
7
7
  s.email = "rubygems@infraruby.com"
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infraruby-java
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraRuby Vision
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: infraruby-base