# File lib/capybara_webkit_builder.rb, line 72 def build sh(make_bin) or return false FileUtils.mkdir("bin") unless File.directory?("bin") FileUtils.cp(path_to_binary, "bin", :preserve => true) end
# File lib/capybara_webkit_builder.rb, line 85 def build_all makefile && qmake && build && clean end
# File lib/capybara_webkit_builder.rb, line 79 def clean File.open("Makefile", "w") do |file| file.print "all:\n\t@echo ok\ninstall:\n\t@echo ok" end end
# File lib/capybara_webkit_builder.rb, line 22 def default_qmake_binary case RbConfig::CONFIG['host_os'] when /freebsd/ "qmake-qt4" else "qmake" end end
# File lib/capybara_webkit_builder.rb, line 10 def make_bin ENV['MAKE'] || 'make' end
# File lib/capybara_webkit_builder.rb, line 55 def makefile sh("#{qmake_bin} -spec #{spec}") end
# File lib/capybara_webkit_builder.rb, line 31 def os_spec case RbConfig::CONFIG['host_os'] when /linux/ "linux-g++" when /freebsd/ "freebsd-g++" when /mingw32/ "win32-g++" else "macx-g++" end end
# File lib/capybara_webkit_builder.rb, line 63 def path_to_binary case RUBY_PLATFORM when /mingw32/ "src/debug/webkit_server.exe" else "src/webkit_server" end end
# File lib/capybara_webkit_builder.rb, line 59 def qmake sh("#{make_bin} qmake") end
# File lib/capybara_webkit_builder.rb, line 14 def qmake_bin ENV['QMAKE'] || default_qmake_binary end
# File lib/capybara_webkit_builder.rb, line 44 def sh(command) system(command) success = $?.exitstatus == SUCCESS_STATUS if $?.exitstatus == COMMAND_NOT_FOUND_STATUS puts "Command '#{command}' not available" elsif !success puts "Command '#{command}' failed" end success end
Generated with the Darkfish Rdoc Generator 2.