Merge pull request #1668 from treitmayr/master

Fix code generated for Ruby global variables
This commit is contained in:
William S Fulton 2019-12-30 23:49:04 +00:00 • committed by GitHub
commit d53a54b4f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 342 additions and 10 deletions

View file

@ -615,6 +615,24 @@ directive. For example: </p>
effect until it is explicitly disabled using <tt>%mutable</tt>.
</p>
<p>Note: When SWIG is invoked with the <tt>-globalmodule</tt> option in
effect, the C/C++ global variables will be translated into Ruby global
variables. Type-checking and the optional read-only characteristic are
available in the same way as described above. However the example would
then have to be modified and executed in the following way:
<div class="code targetlang">
<pre>$ <b>irb</b>
irb(main):001:0&gt; <b>require 'Example'</b>
true
irb(main):002:0&gt; <b>$variable1 = 2</b>
2
irb(main):003:0&gt; <b>$Variable2 = 4 * 10.3</b>
41.2
irb(main):004:0&gt; <b>$Variable2</b>
41.2</pre>
</div>
<H3><a name="Ruby_nn15">34.3.4 Constants</a></H3>