Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding setup rake task to compile the c extension

  • Loading branch information...
commit 36cf309e5182a2f9d6ebdf602812f5d20504a8ba 1 parent dd462a1
@ryanb authored
View
9 README
@@ -2,13 +2,12 @@ RMov
Ruby wrapper for the QuickTime C API.
-This is still in very early development. If you want to try it out, you'll need to run a few commands.
+This is still in very early development. To try it out, run the setup
+task to build the ruby c extensions.
- cd ext
- ruby extconf.rb
- make
+ rake setup
-That will generate an "rmov.bundle". You can "require" just like any Ruby file.
+You can then require 'rmov' in the lib directory.
require 'rmov'
movie = Quicktime::Movie.new('foo.mov')
View
1  Rakefile
@@ -1,4 +1,5 @@
require 'rubygems'
require 'rake'
+require 'rake/gempackagetask'
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
View
2  ext/extconf.rb
@@ -1,4 +1,4 @@
require 'mkmf'
$LDFLAGS = '-framework Quicktime'
-create_makefile('rmov')
+create_makefile('rmov_ext')
View
2  ext/rmov.c → ext/rmov_ext.c
@@ -51,7 +51,7 @@ static VALUE movie_duration(VALUE obj)
return rb_float_new((double)GetMovieDuration(*MOVIE(obj))/GetMovieTimeScale(*MOVIE(obj)));
}
-void Init_rmov()
+void Init_rmov_ext()
{
EnterMovies(); // Enables the QuickTime framework
mQuicktime = rb_define_module("Quicktime");
View
1  lib/rmov.rb
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../ext/rmov_ext'
View
2  spec/spec_helper.rb
@@ -1,6 +1,6 @@
require 'rubygems'
require 'spec'
-require File.dirname(__FILE__) + '/../ext/rmov'
+require File.dirname(__FILE__) + '/../lib/rmov'
Spec::Runner.configure do |config|
config.mock_with :mocha
View
7 tasks/setup.rake
@@ -0,0 +1,7 @@
+desc "Builds the rmov_ext extension"
+task :setup do
+ Dir.chdir('ext') do
+ ruby 'extconf.rb'
+ system 'make'
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.