rsdl 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ Makefile
2
+ mkmf.log
3
+ pkg/
4
+ rsdl.c
@@ -0,0 +1,29 @@
1
+
2
+ CC = <%= config['CC'] %>
3
+
4
+ arch = <%= config['arch'] %>
5
+ CFLAGS = <%= config['CFLAGS'] %>
6
+ LIBS = <%= config['LIBS'] %>
7
+ LDFLAGS = <%= config['LDFLAGS'] %>
8
+ LIBPATH = <%= config['LIBPATH'] %>
9
+ LIBRUBYARG = <%= config['LIBRUBYARG'] %>
10
+ EXEEXT = <%= config['EXEEXT'] %>
11
+
12
+ PROGRAM = <%= config['RSDL'] %>$(EXEEXT)
13
+
14
+ OBJS = rsdl.o
15
+
16
+ .c.o:
17
+ $(CC) $(CFLAGS) -c $<
18
+
19
+ all: $(PROGRAM)
20
+
21
+ clean:
22
+ <%= config['RMALL'] %> $(PROGRAM) $(OBJS)
23
+
24
+ install:
25
+ <%= config['INSTALL'] %> $(PROGRAM) <%= config['bindir'] %>
26
+
27
+ $(PROGRAM): $(OBJS)
28
+ $(CC) $(OBJS) $(LIBPATH) $(LDFLAGS) $(LIBRUBYARG) $(LIBS) -o $@
29
+
@@ -0,0 +1,37 @@
1
+ = rsdl
2
+
3
+ rsdl - SDL initialized ruby interpreter
4
+
5
+ == Requirements
6
+ - ruby 1.8 or later
7
+ - libsdl
8
+
9
+ == Installation
10
+
11
+ gem install rsdl
12
+
13
+ or
14
+
15
+ ruby extconf.rb
16
+ make
17
+ sudo make install
18
+
19
+ == Usage
20
+
21
+ Run your script with rsdl instead of ruby.
22
+
23
+ rsdl myscript.rb
24
+
25
+ == License
26
+
27
+ Ruby's License
28
+
29
+ == Copyright Information
30
+
31
+ Originally written by:
32
+ Copyright (C) 2009 Ryuichi Sakamoto
33
+ mail: kumaryu __at__ kumaryu.net
34
+
35
+ Modified and packaged by:
36
+ Copyright (C) 2009 Akinori MUSHA
37
+ mail: knu __at__ idaemons.org
@@ -0,0 +1,59 @@
1
+ require 'rubygems'
2
+
3
+ require 'rake'
4
+
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gem|
8
+ gem.name = "rsdl"
9
+ gem.summary = %Q{SDL initialized ruby interpreter}
10
+ gem.description = <<-EOD
11
+ RSDL is an SDL initialized ruby interpreter which makes SDL
12
+ applications possible to run on such platforms as Mac OS X where SDL
13
+ needs to be initialized before a ruby interpreter is invoked.
14
+ EOD
15
+ gem.email = "knu@idaemons.org"
16
+ gem.homepage = "http://github.com/knu/rsdl"
17
+ gem.authors = ["Ryuichi Sakamoto", "Akinori MUSHA"]
18
+ gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
19
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
20
+ gem.extensions << "extconf.rb"
21
+ end
22
+ Jeweler::GemcutterTasks.new
23
+ rescue LoadError
24
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
25
+ end
26
+
27
+ require 'rake/testtask'
28
+ Rake::TestTask.new(:test) do |test|
29
+ test.libs << 'lib' << 'test'
30
+ test.pattern = 'test/**/test_*.rb'
31
+ test.verbose = true
32
+ end
33
+
34
+ begin
35
+ require 'rcov/rcovtask'
36
+ Rcov::RcovTask.new do |test|
37
+ test.libs << 'test'
38
+ test.pattern = 'test/**/test_*.rb'
39
+ test.verbose = true
40
+ end
41
+ rescue LoadError
42
+ task :rcov do
43
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
44
+ end
45
+ end
46
+
47
+ task :test => :check_dependencies
48
+
49
+ task :default => :test
50
+
51
+ require 'rake/rdoctask'
52
+ Rake::RDocTask.new do |rdoc|
53
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
54
+
55
+ rdoc.rdoc_dir = 'rdoc'
56
+ rdoc.title = "rsdl #{version}"
57
+ rdoc.rdoc_files.include('README*')
58
+ rdoc.rdoc_files.include('lib/**/*.rb')
59
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.2
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ exec File.join(File.dirname(__FILE__), "..", "rsdl"), *ARGV
4
+
5
+ # This file is a dummy place-holder to satisfy RubyGems.
6
+ #
7
+ # This file is never used because the wrapper script generated in the
8
+ # generate_bin stage will be overwritten in the build_extensions
9
+ # stage.
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ # vim:encoding=utf-8
3
+
4
+ require 'mkmf'
5
+ require 'erb'
6
+
7
+ dir_config('sdl') #--with-sdl-dir, --with-sdl-include, or --with-sdl-lib
8
+ sdlconfig = with_config('sdl-config', 'sdl-config')
9
+
10
+ config = {}
11
+ config['arch'] = Config::CONFIG['arch']
12
+ config['INSTALL'] = Config::CONFIG['INSTALL']
13
+ config['RMALL'] = Config::CONFIG['RMALL'] || 'rm -fr'
14
+ config['CC'] = Config::CONFIG['CC']
15
+ config['CFLAGS'] = Config::CONFIG['CFLAGS']
16
+ config['CFLAGS'] += " -I\"#{$hdrdir}\"" if $hdrdir
17
+ config['CFLAGS'] += " -I\"#{$arch_hdrdir}\"" if $arch_hdrdir
18
+ config['CFLAGS'] += ' ' + `"#{sdlconfig}" --cflags` if sdlconfig and not sdlconfig.empty?
19
+ config['LDFLAGS'] = Config::CONFIG['LDFLAGS']
20
+ config['LIBS'] = Config::CONFIG['LIBS']
21
+ config['LIBS'] += ' ' + `"#{sdlconfig}" --libs` if sdlconfig and not sdlconfig.empty?
22
+ config['LIBPATH'] = RbConfig::expand(libpathflag)
23
+ config['LIBRUBYARG'] = Config::CONFIG['LIBRUBYARG']
24
+ config['EXEEXT'] = Config::CONFIG['EXEEXT']
25
+ config['bindir'] = Config::CONFIG['bindir']
26
+ config['RSDL'] = Config::CONFIG['RUBY_INSTALL_NAME'].sub(/ruby/, 'rsdl')
27
+
28
+ headers = []
29
+ headers << '#define HAVE_RUBY_SYSINIT 1' if have_func('ruby_sysinit')
30
+ headers << '#define HAVE_RUBY_RUN_NODE 1' if have_func('ruby_run_node')
31
+ config['COMMON_HEADERS'] = ([(COMMON_HEADERS || '')]+headers).join("\n")
32
+
33
+ %w[Makefile rsdl.c].each { |file|
34
+ file_in = ERB.new(File.read(file + '.in'), nil, '%')
35
+ message "creating %s\n" % file
36
+ open(file, 'w') do |f|
37
+ f.print file_in.result
38
+ end
39
+ }
40
+
@@ -0,0 +1,37 @@
1
+
2
+ #include <ruby.h>
3
+ <%= config['COMMON_HEADERS'] %>
4
+ #include <SDL.h>
5
+ #include "SDL_main.h"
6
+ #ifdef HAVE_LOCALE_H
7
+ #include <locale.h>
8
+ #endif
9
+
10
+ #ifdef RUBY_GLOBAL_SETUP
11
+ RUBY_GLOBAL_SETUP
12
+ #endif
13
+
14
+ int main(int argc, char **argv)
15
+ {
16
+ #ifdef HAVE_LOCALE_H
17
+ setlocale(LC_CTYPE, "");
18
+ #endif
19
+
20
+ #ifdef HAVE_RUBY_SYSINIT
21
+ ruby_sysinit(&argc, &argv);
22
+ #endif
23
+ {
24
+ #ifdef RUBY_INIT_STACK
25
+ RUBY_INIT_STACK;
26
+ #endif
27
+ ruby_init();
28
+ #ifdef HAVE_RUBY_RUN_NODE
29
+ return ruby_run_node(ruby_options(argc, argv));
30
+ #else
31
+ ruby_options(argc, argv);
32
+ ruby_run(); //no return
33
+ return 0;
34
+ #endif
35
+ }
36
+ }
37
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ #require 'rsdl'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestRsdl < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rsdl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Ryuichi Sakamoto
8
+ - Akinori MUSHA
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-10-29 00:00:00 +09:00
14
+ default_executable: rsdl
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: thoughtbot-shoulda
18
+ type: :development
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ version:
26
+ description: |
27
+ RSDL is an SDL initialized ruby interpreter which makes SDL
28
+ applications possible to run on such platforms as Mac OS X where SDL
29
+ needs to be initialized before a ruby interpreter is invoked.
30
+
31
+ email: knu@idaemons.org
32
+ executables:
33
+ - rsdl
34
+ extensions:
35
+ - extconf.rb
36
+ extra_rdoc_files:
37
+ - README.rdoc
38
+ files:
39
+ - .gitignore
40
+ - Makefile.in
41
+ - README.rdoc
42
+ - Rakefile
43
+ - VERSION
44
+ - bin/rsdl
45
+ - extconf.rb
46
+ - rsdl.c.in
47
+ - test/helper.rb
48
+ - test/test_rsdl.rb
49
+ has_rdoc: true
50
+ homepage: http://github.com/knu/rsdl
51
+ licenses: []
52
+
53
+ post_install_message:
54
+ rdoc_options:
55
+ - --charset=UTF-8
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ requirements: []
71
+
72
+ rubyforge_project:
73
+ rubygems_version: 1.3.5
74
+ signing_key:
75
+ specification_version: 3
76
+ summary: SDL initialized ruby interpreter
77
+ test_files:
78
+ - test/helper.rb
79
+ - test/test_rsdl.rb