gd2-ffij 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  *tmp*
6
6
  pkg/
7
7
  doc/
8
+ coverage/
8
9
  *.orig
9
10
  *.patch
10
11
  *.gem
@@ -13,3 +14,5 @@ doc/
13
14
  .config
14
15
  .yardoc
15
16
  Gemfile.lock
17
+ Gemfile.local
18
+ Guardfile.local
data/Gemfile CHANGED
@@ -1,3 +1,20 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ gem "rdoc", "~> 3.12"
6
+ gem "rake", "~> 10.0"
7
+ gem "minitest"
8
+ gem "minitest-reporters"
9
+ gem "guard-minitest"
10
+ gem "simplecov"
11
+
12
+ if RbConfig::CONFIG['host_os'] =~ /^darwin/
13
+ gem "rb-fsevent"
14
+ gem "growl"
15
+ end
16
+
17
+ if File.exists?('Gemfile.local')
18
+ instance_eval File.read('Gemfile.local')
19
+ end
20
+
data/Guardfile ADDED
@@ -0,0 +1,17 @@
1
+
2
+ guard 'minitest', :test_folders => 'test', :test_file_patterns => '*_tests.rb' do
3
+ watch(%r|^test/(.+)_tests\.rb|)
4
+
5
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) do |m|
6
+ "test/#{m[2]}_tests.rb"
7
+ end
8
+
9
+ watch(%r|^test/test_helper\.rb|) do
10
+ "test"
11
+ end
12
+ end
13
+
14
+ if File.exists?('Guardfile.local')
15
+ instance_eval File.read('Guardfile.local')
16
+ end
17
+
data/Rakefile CHANGED
@@ -1,23 +1,12 @@
1
1
  # -*- ruby -*-
2
2
 
3
3
  require 'rubygems'
4
-
5
- gem 'rdoc', '~> 3.12'
6
-
7
4
  require 'rubygems/package_task'
8
5
  require 'rake/testtask'
9
6
  require 'rdoc/task'
10
7
  require 'bundler/gem_tasks'
11
8
 
12
- if RUBY_VERSION >= '1.9'
13
- begin
14
- gem 'psych'
15
- rescue Exception => e
16
- # it's okay, fall back on the bundled psych
17
- end
18
- end
19
-
20
- $:.push 'lib'
9
+ $:.push File.expand_path(File.dirname(__FILE__), 'lib')
21
10
 
22
11
  version = GD2::VERSION
23
12
 
data/gd2-ffij.gemspec CHANGED
@@ -21,7 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.require_paths = ["lib"]
22
22
 
23
23
  s.add_dependency("ffi", [">= 1.0.0"])
24
- s.add_dependency("rdoc")
25
- s.add_dependency("rake", ["~> 0.9"])
26
24
  end
27
25
 
data/lib/gd2/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: ASCII-8BIT
2
2
 
3
3
  module GD2
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
  end
6
6
 
data/lib/gd2-ffij.rb CHANGED
@@ -36,7 +36,7 @@ module GD2
36
36
  paths = if ENV['GD2_LIBRARY_PATH']
37
37
  [ ENV['GD2_LIBRARY_PATH'] ]
38
38
  else
39
- [ '/usr/local/{lib64,lib}', '/opt/local/{lib64,lib}', '/usr/{lib64,lib}', '/usr/lib/x86_64-linux-gnu' ]
39
+ [ '/usr/local/{lib64,lib}', '/opt/local/{lib64,lib}', '/usr/{lib64,lib}', '/usr/lib/{x86_64,i386}-linux-gnu' ]
40
40
  end
41
41
 
42
42
  lib = if [
@@ -55,7 +55,12 @@ module GD2
55
55
  end
56
56
 
57
57
  extend FFI::Library
58
- ffi_lib(*gd_library_name)
58
+
59
+ begin
60
+ ffi_lib(*gd_library_name)
61
+ rescue LoadError, NoMethodError
62
+ raise LoadError.new("Couldn't load the gd2 library.")
63
+ end
59
64
 
60
65
  {
61
66
  :gdImageCreate => [ :pointer, :int, :int ],
data/test/canvas_tests.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require './test/test_helper'
4
4
 
5
- class CanvasTest < Test::Unit::TestCase
5
+ class CanvasTest < MiniTest::Unit::TestCase
6
6
  include TestHelper
7
7
 
8
8
  def test_line
data/test/image_tests.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require './test/test_helper'
4
4
 
5
- class ImageTest < Test::Unit::TestCase
5
+ class ImageTest < MiniTest::Unit::TestCase
6
6
  include TestHelper
7
7
 
8
8
  def test_image_new_and_release
data/test/test_helper.rb CHANGED
@@ -1,11 +1,26 @@
1
1
  # encoding: ASCII-8BIT
2
2
 
3
- require 'test/unit'
3
+ if RUBY_VERSION >= '1.9'
4
+ require 'simplecov'
5
+
6
+ SimpleCov.command_name('Unit Tests')
7
+ SimpleCov.start do
8
+ add_filter '/test/'
9
+ end
10
+ end
11
+
4
12
  require 'tmpdir'
5
13
 
6
14
  require 'rubygems'
7
15
  require 'gd2-ffij'
16
+ require 'minitest/autorun'
8
17
 
18
+ if RUBY_VERSION >= '1.9'
19
+ require 'minitest/reporters'
20
+ end
21
+
22
+ puts "Ruby version #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} - #{RbConfig::CONFIG['RUBY_INSTALL_NAME']}"
23
+ puts "ffi version #{Gem.loaded_specs['ffi'].version}" if Gem.loaded_specs['ffi']
9
24
  puts "GD2 version: #{GD2::VERSION}"
10
25
 
11
26
  module TestHelper
@@ -20,3 +35,8 @@ module TestHelper
20
35
  GD2::Image.load(File.read(File.join(PATH_TO_IMAGES, file_name)))
21
36
  end
22
37
  end
38
+
39
+ if RUBY_VERSION >= '1.9'
40
+ MiniTest::Reporters.use!(MiniTest::Reporters::SpecReporter.new)
41
+ end
42
+
metadata CHANGED
@@ -1,26 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gd2-ffij
3
3
  version: !ruby/object:Gem::Version
4
- version: !binary |-
5
- MC4wLjY=
6
4
  prerelease:
5
+ version: !binary |-
6
+ MC4wLjc=
7
7
  platform: ruby
8
8
  authors:
9
9
  - J Smith
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-14 00:00:00.000000000 Z
13
+ date: 2013-02-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi
17
+ type: :runtime
17
18
  requirement: !ruby/object:Gem::Requirement
18
19
  none: false
19
20
  requirements:
20
21
  - - ! '>='
21
22
  - !ruby/object:Gem::Version
22
23
  version: 1.0.0
23
- type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  none: false
@@ -28,38 +28,6 @@ dependencies:
28
28
  - - ! '>='
29
29
  - !ruby/object:Gem::Version
30
30
  version: 1.0.0
31
- - !ruby/object:Gem::Dependency
32
- name: rdoc
33
- requirement: !ruby/object:Gem::Requirement
34
- none: false
35
- requirements:
36
- - - ! '>='
37
- - !ruby/object:Gem::Version
38
- version: '0'
39
- type: :runtime
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: rake
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '0.9'
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ~>
61
- - !ruby/object:Gem::Version
62
- version: '0.9'
63
31
  description: gd2-ffij is a refactoring of the Ruby/GD2 library implemented with FFI
64
32
  email: dark.panda@gmail.com
65
33
  executables: []
@@ -71,6 +39,7 @@ files:
71
39
  - COPYING
72
40
  - COPYRIGHT
73
41
  - Gemfile
42
+ - Guardfile
74
43
  - README.rdoc
75
44
  - Rakefile
76
45
  - gd2-ffij.gemspec