~ubuntu-branches/ubuntu/utopic/ruby-gir-ffi/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/gir_ffi/builder_helper.rb

  • Committer: Package Import Robot
  • Author(s): TANIGUCHI Takaki
  • Date: 2014-06-22 16:13:36 UTC
  • mfrom: (10.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140622161336-zo88bzrlqw71cpyy
Tags: 0.7.4-1
* Imported Upstream version 0.7.4
* Bump Standards-Version to 3.9.5 (with no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
module GirFFI
2
2
  module BuilderHelper
3
 
    def const_defined_for parent, name
4
 
      if RUBY_VERSION < "1.9"
5
 
        parent.const_defined? name
6
 
      else
7
 
        parent.const_defined? name, false
8
 
      end
9
 
    end
10
 
 
11
3
    def optionally_define_constant parent, name
12
 
      if const_defined_for parent, name
 
4
      if parent.const_defined? name, false
13
5
        parent.const_get name
14
6
      else
15
7
        parent.const_set name, yield