1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/lib/capybara_webkit_builder.rb

41 lines
816 B
Ruby
Raw Normal View History

require "fileutils"
module CapybaraWebkitBuilder
extend self
2011-07-25 09:43:05 -04:00
def make_bin
make_binaries = ['gmake', 'make']
make_binaries.detect { |make| system("which #{make}") }
end
def makefile
qmake_binaries = ['qmake', 'qmake-qt4']
qmake = qmake_binaries.detect { |qmake| system("which #{qmake}") }
case RUBY_PLATFORM
when /linux/
system("#{qmake} -spec linux-g++")
2011-07-25 09:43:05 -04:00
when /freebsd/
system("#{qmake} -spec freebsd-g++")
else
system("#{qmake} -spec macx-g++")
end
end
def qmake
2011-07-25 09:43:05 -04:00
system("#{make_bin} qmake")
end
def build
2011-07-25 09:43:05 -04:00
system(make_bin) or return false
FileUtils.mkdir("bin") unless File.directory?("bin")
2011-05-11 09:04:31 -04:00
FileUtils.cp("src/webkit_server", "bin", :preserve => true)
end
def build_all
makefile &&
qmake &&
build
end
end