Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added Gemfile #1

Merged
merged 8 commits into from

2 participants

Ícaro Vinícius Torres Silva Maurício Szabo
Ícaro Vinícius Torres Silva

In order to run specs for the first time, I added a Gemfile file to the project, simplifyng my way.
There is a questionable sdl rubygem (rubysdl). Please, modify this gem, so we can avoid the follow error:

private method `load' called for SDL::Surface:Class

Gemfile
@@ -0,0 +1,5 @@
+source 'http://rubygems.org'
+
+gem "rubysdl"
+gem "rspec"
+gem "simplecov"
Maurício Szabo Owner

Good, but RSpec and SimpleCov should be namespaced for "test".

Furthermore, all "require sdl" should be converted to bundler, and spec_helper must change too.

With Gemfile like this:

source 'http://rubygems.org'

gem "rubysdl"

group :test do
  gem "rspec"
  gem "simplecov"
end

I tried to convert all "require sdl" to bundler:

require 'bundler'
Bundler.require(:default)

And changed spec_helper:

require 'bundler'
Bundler.require(:default, :test)

But it didn't work, I got the follow error:

NameError: uninitialized constant Screen::SDL

Is "rubysdl" the correct gem I have to use?

thx

It works if I keep require 'sdl' in the ar_sdl.rb file:

require 'bundler'
Bundler.require(:default)
require 'sdl'

Is it appropriate ?

Ps.: I pushed it working to my repo...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
README
@@ -1,2 +1,5 @@
It's an asteroids-like ship game, to use as a base
to "coding arena".
+
+=== Dependencies
+* Dev SDL Library (libsdl-ttf2.0-dev - Debian/Ubuntu)
Maurício Szabo Owner

Another dependencies:

SDL
SDL-TTF (the one you put above)
SDL-Image (the one it's missing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Maurício Szabo mauricioszabo merged commit 6cfdab3 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
1  .gitignore
View
@@ -2,3 +2,4 @@
*.log
images2
coverage
+*~
8 Gemfile
View
@@ -0,0 +1,8 @@
+source 'http://rubygems.org'
+
+gem "rubysdl", :require => 'sdl'
+
+group :test do
+ gem "rspec"
+ gem "simplecov"
+end
6 README → README.rdoc
View
@@ -1,2 +1,8 @@
+= Ship Arena
It's an asteroids-like ship game, to use as a base
to "coding arena".
+
+== Dependencies
+* SDL
+* SDL-TTF
+* SDL-Image
5 lib/ar_sdl.rb
View
@@ -1,5 +1,6 @@
-require "rubygems"
-require "sdl"
+require 'bundler'
+Bundler.require(:default)
+
require_relative "scene"
require_relative "screen"
require_relative "code"
4 spec/helper.rb
View
@@ -1,4 +1,6 @@
-require 'simplecov'
+require 'bundler'
+Bundler.require(:default, :test)
+
SimpleCov.start do
add_filter "spec"
end
Something went wrong with that request. Please try again.