Module: CapybaraWebkitBuilder
- Extended by:
- CapybaraWebkitBuilder
- Included in:
- CapybaraWebkitBuilder
- Defined in:
- lib/capybara_webkit_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
- #build_all ⇒ Object
- #clean ⇒ Object
- #make_bin ⇒ Object
- #makefile ⇒ Object
- #os_spec ⇒ Object
- #path_to_binary ⇒ Object
- #qmake ⇒ Object
- #qmake_bin ⇒ Object
- #spec ⇒ Object
Instance Method Details
#build ⇒ Object
49 50 51 52 53 54 |
# File 'lib/capybara_webkit_builder.rb', line 49 def build system(make_bin) or return false FileUtils.mkdir("bin") unless File.directory?("bin") FileUtils.cp(path_to_binary, "bin", :preserve => true) end |
#build_all ⇒ Object
62 63 64 65 66 67 |
# File 'lib/capybara_webkit_builder.rb', line 62 def build_all makefile && qmake && build && clean end |
#clean ⇒ Object
56 57 58 59 60 |
# File 'lib/capybara_webkit_builder.rb', line 56 def clean File.open("Makefile", "w") do |file| file.print "all:\n\t@echo ok\ninstall:\n\t@echo ok" end end |
#make_bin ⇒ Object
7 8 9 |
# File 'lib/capybara_webkit_builder.rb', line 7 def make_bin ENV['MAKE'] || 'make' end |
#makefile ⇒ Object
32 33 34 |
# File 'lib/capybara_webkit_builder.rb', line 32 def makefile system("#{qmake_bin} -spec #{spec}") end |
#os_spec ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/capybara_webkit_builder.rb', line 19 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 |
#path_to_binary ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/capybara_webkit_builder.rb', line 40 def path_to_binary case RUBY_PLATFORM when /mingw32/ "src/debug/webkit_server.exe" else "src/webkit_server" end end |
#qmake ⇒ Object
36 37 38 |
# File 'lib/capybara_webkit_builder.rb', line 36 def qmake system("#{make_bin} qmake") end |
#qmake_bin ⇒ Object
11 12 13 |
# File 'lib/capybara_webkit_builder.rb', line 11 def qmake_bin ENV['QMAKE'] || 'qmake' end |
#spec ⇒ Object
15 16 17 |
# File 'lib/capybara_webkit_builder.rb', line 15 def spec ENV['SPEC'] || os_spec end |