@@ -89,31 +89,38 @@ def self.add_extended_options(ol)
8989 end
9090 end # add_extended_options
9191
92- VERSION_REGEXP = /\# \s *define\s +CIAOX11_(\w +)_VERSION\s +(\d +)/
93-
94- def self . determine_ciaox11_version ( )
95- x11_version = {
96- :major => 0 ,
97- :minor => 0 ,
98- :micro => 0
99- }
100-
101- base = File . join ( File . dirname ( __FILE__ ) , '..' , '..' , 'ciaox11' , 'versionx11.h' )
102- File . open ( base , "r" ) do |file |
103- while ( line = file . gets )
104- if VERSION_REGEXP =~ line
105- x11_version [ $1. downcase . to_sym ] = $2. to_i
92+ class << self
93+
94+ VERSION_REGEXP = /\# \s *define\s +CIAOX11_(\w +)_VERSION\s +(\d +)/
95+
96+ def determine_ciaox11_version
97+ x11_version = {
98+ :major => 0 ,
99+ :minor => 0 ,
100+ :micro => 0
101+ }
102+
103+ base = File . join ( File . dirname ( __FILE__ ) , '..' , '..' , 'ciaox11' , 'versionx11.h' )
104+ File . open ( base , "r" ) do |file |
105+ while ( line = file . gets )
106+ if VERSION_REGEXP =~ line
107+ x11_version [ $1. downcase . to_sym ] = $2. to_i
108+ end
106109 end
107110 end
108- end
109- x11_version [ :release ] ||= x11_version [ :micro ]
110- x11_version
111- end # determine_ciaox11_version
111+ x11_version [ :release ] ||= x11_version [ :micro ]
112+ x11_version
113+ end # determine_ciaox11_version
114+ private : determine_ciaox11_version
112115
116+ def ciaox11_version
117+ @ciaox11_version ||= determine_ciaox11_version
118+ end
119+ end
113120
114121 ## Configure C++11 backend
115122 #
116- Backend . configure ( 'ccmx11' , File . dirname ( __FILE__ ) , TITLE , COPYRIGHT , IDL ::CCMX11 . determine_ciaox11_version ( ) ) do |becfg |
123+ Backend . configure ( 'ccmx11' , File . dirname ( __FILE__ ) , TITLE , COPYRIGHT , IDL ::CCMX11 . ciaox11_version ) do |becfg |
117124
118125 # load c++11 backend as base
119126 becfg . add_backend ( 'c++11' )
0 commit comments