Rakefile in gps_pvt-0.1.6 vs Rakefile in gps_pvt-0.1.7

- old
+ new

@@ -67,15 +67,18 @@ sh "mkdir -p #{out_dir}" wrapper = File::join(out_dir, "#{mod_name}_wrap.cxx") sh [:make, :clean, wrapper, "BUILD_DIR=#{out_dir}", "SWIGFLAGS='-c++ -ruby -prefix \"GPS_PVT::\"#{" -D__MINGW__" if ENV["MSYSTEM"]}'"].join(' ') - lines = open(wrapper, 'r').read.lines.collect{|line| - line.sub(/rb_require\(\"([^\"]+)\"\)/){ # from camel to underscore downcase style - "rb_require(\"#{$1.sub('GPS_PVT', 'gps_pvt')}\")" + open(wrapper, 'r+'){|io| + lines = io.read.lines.collect{|line| + line.sub(/rb_require\(\"([^\"]+)\"\)/){ # from camel to underscore downcase style + "rb_require(\"#{$1.sub('GPS_PVT', 'gps_pvt')}\")" + } } + io.rewind + io.write(lines.join) } - open(wrapper, 'w').write(lines.join) } } end file "ext/ninja-scan-light/tool" do |t| \ No newline at end of file