Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit 5c0adcca839b8594b788cd9b108de18c1468ce6e @ferrous26 ferrous26 committed Dec 9, 2012
Showing with 162 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +9 −0 .yardopts
  3. +3 −0 Gemfile
  4. +4 −0 History.markdown
  5. +42 −0 README.markdown
  6. +33 −0 Rakefile
  7. +22 −0 ext/screen_recorder/extconf.rb
  8. +4 −0 ext/screen_recorder/screen_recorder.c
  9. +4 −0 lib/screen_recorder/version.rb
  10. +33 −0 screen_recorder.gemspec
8 .gitignore
@@ -0,0 +1,8 @@
+*.o
+*.plist
+*.bundle
+tmp/
+.yardoc/
+doc/
+pkg/
+
9 .yardopts
@@ -0,0 +1,9 @@
+--no-cache
+--no-output
+--verbose
+--markup markdown
+--markup-provider kramdown
+--readme README.markdown
+--hide-void-return
+lib/**/*.rb
+ext/**/*{.m,.c}
3 Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+gemspec
+
4 History.markdown
@@ -0,0 +1,4 @@
+# 0.0.1 - Initial Release
+
+ * CRuby and MacRuby compatible
+
42 README.markdown
@@ -0,0 +1,42 @@
+# Screen Recorder
+
+A port of `screen_recorder.rb` from from [AXElements](http://github.com/Marketcircle/AXElements),
+but cleaned up and rewritten in C to be more portable across languages and
+runtimes.
+
+[Documentation](http://rdoc.info/gems/screen_recorder/frames)
+
+
+## Examples
+
+TODO... :(
+
+
+## Copyright
+
+Copyright (c) 2012, Mark Rada
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Mark Rada nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mark Rada BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 Rakefile
@@ -0,0 +1,33 @@
+task :default => :test
+
+require 'rake/clean'
+CLEAN.include '*.plist', '*.gch'
+
+desc 'Startup an IRb console with screen_recorder loaded'
+task :console => [:compile] do
+ sh 'irb -Ilib -rscreen_recorder'
+end
+
+require 'rake/testtask'
+Rake::TestTask.new do |t|
+ t.libs << '.'
+ t.pattern = 'test/*_test.rb'
+end
+task :test => :compile
+
+
+# Gem stuff
+
+require 'rubygems/package_task'
+SPEC = Gem::Specification.load('screen_recorder.gemspec')
+
+Gem::PackageTask.new(SPEC) { }
+
+desc 'Build and install gem (not including deps)'
+task :install => :gem do
+ require 'rubygems/installer'
+ Gem::Installer.new("pkg/#{SPEC.file_name}").install
+end
+
+require 'rake/extensiontask'
+Rake::ExtensionTask.new('screen_recorder', SPEC)
22 ext/screen_recorder/extconf.rb
@@ -0,0 +1,22 @@
+require 'mkmf'
+
+$CFLAGS << ' -std=c99 -Wall -Werror -pedantic -ObjC'
+$LIBS << ' -framework AVFoundation -framework Cocoa'
+
+if RUBY_ENGINE == 'macruby'
+ $CFLAGS << ' -fobjc-gc'
+else
+ unless RbConfig::CONFIG["CC"].match /clang/
+ clang = `which clang`.chomp
+ if clang.empty?
+ $stdout.puts "Clang not installed. Cannot build C extension"
+ raise "Clang not installed. Cannot build C extension"
+ else
+ RbConfig::MAKEFILE_CONFIG["CC"] = clang
+ RbConfig::MAKEFILE_CONFIG["CXX"] = clang
+ end
+ end
+ $CFLAGS << ' -DNOT_MACRUBY'
+end
+
+create_makefile 'screen_recorder/screen_recorder'
4 ext/screen_recorder/screen_recorder.c
@@ -0,0 +1,4 @@
+void
+Init_screen_recorder()
+{
+}
4 lib/screen_recorder/version.rb
@@ -0,0 +1,4 @@
+class ScreenRecorder
+ # @return [String]
+ VERSION = '0.1.0'
+end
33 screen_recorder.gemspec
@@ -0,0 +1,33 @@
+require './lib/screen_recorder/version'
+
+Gem::Specification.new do |s|
+ s.name = 'screen_recorder'
+ s.version = ScreenRecorder::VERSION
+
+ s.summary = 'A class that allows recording your screen in OS X'
+ s.description = <<-EOS
+screen_recorder is a wrapper around some of the OS X AVFoundation framework.
+
+Originally extracted from the AXElements project.
+ EOS
+
+ s.authors = ['Mark Rada']
+ s.email = 'markrada26@gmail.com'
+ s.homepage = 'http://github.com/ferrous26/screen_recorder'
+ s.licenses = ['BSD 3-clause']
+ s.has_rdoc = 'yard'
+
+ s.extensions = ['ext/screen_recorder/extconf.rb']
+ s.files = Dir.glob('lib/**/*.rb') +
+ Dir.glob('ext/**/*.{c,h,rb}') +
+ [
+ 'Rakefile',
+ 'README.markdown',
+ 'History.markdown',
+ '.yardopts'
+ ]
+
+ s.add_development_dependency 'yard', '~> 0.8.3'
+ s.add_development_dependency 'kramdown', '~> 0.14.1'
+ s.add_development_dependency 'rake-compiler', '~> 0.8.1'
+end

0 comments on commit 5c0adcc

Please sign in to comment.
Something went wrong with that request. Please try again.