RubyInline 3.12.1 → 3.12.2

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.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ === 3.12.2 / 2013-04-18
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Added #prefix code to MD5 calculation to force rebuilds on non-signature changes.
6
+ * Separated out #prefix code from #src.
7
+
1
8
  === 3.12.1 / 2013-02-14
2
9
 
3
10
  * 2 bug fixes:
data/README.txt CHANGED
@@ -41,7 +41,7 @@ See hoe for more details.
41
41
  * Pretends to be secure.
42
42
  * Only requires standard ruby libraries, nothing extra to download.
43
43
 
44
- == SYNOPSYS:
44
+ == SYNOPSIS:
45
45
 
46
46
  require "inline"
47
47
  class MyTest
@@ -57,7 +57,7 @@ See hoe for more details.
57
57
  t = MyTest.new()
58
58
  factorial_5 = t.factorial(5)
59
59
 
60
- == SYNOPSYS (C++):
60
+ == SYNOPSIS (C++):
61
61
 
62
62
  require 'inline'
63
63
  class MyTest
@@ -65,7 +65,7 @@ class CompilationError < RuntimeError; end
65
65
  # the current namespace.
66
66
 
67
67
  module Inline
68
- VERSION = '3.12.1'
68
+ VERSION = "3.12.2"
69
69
 
70
70
  WINDOZE = /mswin|mingw/ =~ RUBY_PLATFORM
71
71
  RUBINIUS = defined? RUBY_ENGINE
@@ -317,6 +317,10 @@ module Inline
317
317
 
318
318
  ext << @inc
319
319
  ext << nil
320
+ unless @pre.empty? then
321
+ ext << @pre.join("\n\n")
322
+ ext << nil
323
+ end
320
324
  ext << @src.join("\n\n")
321
325
  ext << nil
322
326
  ext << nil
@@ -368,6 +372,7 @@ module Inline
368
372
  unless defined? @module_name then
369
373
  module_name = @mod.name.gsub('::','__')
370
374
  md5 = Digest::MD5.new
375
+ @pre.each { |m| md5 << m.to_s }
371
376
  @sig.keys.sort_by { |x| x.to_s }.each { |m| md5 << m.to_s }
372
377
  @module_name = "Inline_#{module_name}_#{md5}"
373
378
  end
@@ -383,7 +388,7 @@ module Inline
383
388
 
384
389
  attr_reader :rb_file, :mod
385
390
  attr_writer :mod
386
- attr_accessor :src, :sig, :flags, :libs, :init_extra
391
+ attr_accessor :src, :pre, :sig, :flags, :libs, :init_extra
387
392
 
388
393
  ##
389
394
  # Sets the name of the C struct for generating accessors. Used with
@@ -404,6 +409,7 @@ module Inline
404
409
  @rb_file = File.expand_path real_caller
405
410
 
406
411
  @mod = mod
412
+ @pre = []
407
413
  @src = []
408
414
  @inc = []
409
415
  @sig = {}
@@ -763,7 +769,7 @@ VALUE #{method}_equals(VALUE value) {
763
769
  # Adds any amount of text/code to the source
764
770
 
765
771
  def prefix(code)
766
- @src << code
772
+ @pre << code
767
773
  end
768
774
 
769
775
  ##
@@ -748,11 +748,15 @@ puts(s); return rb_str_new2(s)}"
748
748
 
749
749
  @builder.c "VALUE my_method() { return Qnil; }"
750
750
 
751
+ @builder.prefix "static int x;"
752
+
751
753
  windoze = "\n __declspec(dllexport)" if Inline::WINDOZE
752
754
 
753
755
  expected = <<-EXT
754
756
  #include "ruby.h"
755
757
 
758
+ static int x;
759
+
756
760
  # line N "#{$test_inline_path}"
757
761
  static VALUE allocate(VALUE self) {
758
762
  return (Qnil); }
@@ -765,7 +769,7 @@ static VALUE my_method(VALUE self) {
765
769
  #ifdef __cplusplus
766
770
  extern \"C\" {
767
771
  #endif#{windoze}
768
- void Init_Inline_TestInline__TestC_eba5e5454322e22fe2310198ef14e43f() {
772
+ void Init_Inline_TestInline__TestC_3ab8c09639e499394bb1f0a0194a839f() {
769
773
  VALUE c = rb_cObject;
770
774
  c = rb_const_get(c, rb_intern("TestInline"));
771
775
  c = rb_const_get(c, rb_intern("TestC"));
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RubyInline
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 12
9
- - 1
10
- version: 3.12.1
9
+ - 2
10
+ version: 3.12.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2013-02-15 00:00:00 Z
39
+ date: 2013-04-18 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ZenTest
@@ -61,11 +61,11 @@ dependencies:
61
61
  requirements:
62
62
  - - ~>
63
63
  - !ruby/object:Gem::Version
64
- hash: 23
64
+ hash: 21
65
65
  segments:
66
66
  - 4
67
- - 6
68
- version: "4.6"
67
+ - 7
68
+ version: "4.7"
69
69
  type: :development
70
70
  version_requirements: *id002
71
71
  - !ruby/object:Gem::Dependency
@@ -76,11 +76,11 @@ dependencies:
76
76
  requirements:
77
77
  - - ~>
78
78
  - !ruby/object:Gem::Version
79
- hash: 19
79
+ hash: 27
80
80
  segments:
81
- - 3
82
- - 10
83
- version: "3.10"
81
+ - 4
82
+ - 0
83
+ version: "4.0"
84
84
  type: :development
85
85
  version_requirements: *id003
86
86
  - !ruby/object:Gem::Dependency
@@ -91,11 +91,11 @@ dependencies:
91
91
  requirements:
92
92
  - - ~>
93
93
  - !ruby/object:Gem::Version
94
- hash: 13
94
+ hash: 11
95
95
  segments:
96
96
  - 3
97
- - 5
98
- version: "3.5"
97
+ - 6
98
+ version: "3.6"
99
99
  type: :development
100
100
  version_requirements: *id004
101
101
  description: |-
metadata.gz.sig CHANGED
Binary file