Skip to content

rubiojr/gtk-webkit-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gtk Webkit Ruby

Requires

  • rubber-generate >= 0.0.17
  • rake-compiler, rake to build
  • ruby-gnome2 (including development files)
  • webkit (including development files)

Changes

  • 0.0.4 - 16 Nov 2012
  • Use rubygems to find Ruby-GNOME2 installation (fixes #2, missing rbglib.h header file)
  • Wrap stored JS ref pointer with Data_Wrap_Struct (fixes GC bug)

Description

Gtk Webkit bindings for ruby. Partial coverage sufficient to embed a webview in a ruby-gnome2 application.

Also experimental support for allowing ruby code to be called by javascript & executing javascript from ruby.

e.g

	require 'gtk2'
	require 'webkit'
	require 'digest/md5'

	v = WebKit::WebView.new
	v.main_frame.setup_ruby
	
	v.main_frame.add_js_api('md5') do |what|
		Digest::MD5.hexdigest(what)
	end
	
	puts v.main_frame.exec_js("ruby_eval('RUBY_DESCRIPTION')")
	puts v.main_frame.exec_js("md5('foo')")
	puts Digest::MD5.hexdigest('foo')

About

Ruby-GNOME2 compatible bindings for Gtk Webkit

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 86.8%
  • Ruby 13.2%