gd2-ffij 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 383f80ad5319daf9f51c299f347a70b6079c8bae
4
- data.tar.gz: 589fae25257e031c4223a91348dacd7bb8c5d939
3
+ metadata.gz: fa7d138e9bc1811d93f29940223d4ef351cb386e
4
+ data.tar.gz: d5d2045cd120680ca95fb4b0fe45f5faab48145b
5
5
  SHA512:
6
- metadata.gz: 18f27d6513e196b676cbe8b4cf55a200646e8bc1870041f0f1dc806b52314e142e2525e21f63aad4e3de2f48cb59b980874dfb18212b1fc472e67182e2617c71
7
- data.tar.gz: d0805bf758ee510aba798c7702fd5b1eba932ba992aeeb60d414a2167b71d09078b3e1aaa49b30047122c642bc29ce3eb4694cf9e61c1ad51ccab70e7a4e0317
6
+ metadata.gz: 9874c2866d83776849d4208176df0f0068505cc50b226eea321ace4ae9cfbc06ca0b7f75184e14a3ea332a7dbdf013a069bf9b8439305e061c89e694ece8acf8
7
+ data.tar.gz: 792e63569a789cf97722e116b1c65907c7ffee7fa332abe0481d2db952a7297ad5b0c57aab2b0036a1e047527c4c019fb28acac3cb76fcf7260a343dcf858555
data/COPYRIGHT CHANGED
@@ -1,6 +1,4 @@
1
1
 
2
- THIS BRANCH CONTAINS A PROPOSAL FOR A LICENSE CHANGE AND IS NOT MEANT FOR RELEASE
3
-
4
2
  Original Ruby/GD2 library placed in public domain by Robert Leslie:
5
3
 
6
4
  "I hereby relinquish my copyright claim and place the library
@@ -18,7 +16,7 @@ See https://github.com/dark-panda/gd2-ffij/issues/10 ("Consider moving back to
18
16
  BSD now that FFI is back to BSD?") for details.
19
17
 
20
18
 
21
- Subsequent code added and modified to create gd2-ffij copyright (C) 2010-2013
19
+ Subsequent code added and modified to create gd2-ffij copyright (C) 2010-2015
22
20
  J Smith <dark.panda@gmail.com> and published under the MIT license as follows:
23
21
 
24
22
  Permission is hereby granted, free of charge, to any person
data/Gemfile CHANGED
@@ -6,12 +6,17 @@ gem "rdoc", "~> 3.12"
6
6
  gem "rake", "~> 10.0"
7
7
  gem "minitest"
8
8
  gem "minitest-reporters"
9
- gem "guard-minitest"
10
- gem "simplecov"
11
9
 
12
- if RbConfig::CONFIG['host_os'] =~ /^darwin/
13
- gem "rb-fsevent"
14
- gem "growl"
10
+ platforms :rbx do
11
+ gem 'rubysl', '~> 2.0'
12
+ gem 'rubinius-developer_tools'
13
+ end
14
+
15
+
16
+ if RUBY_VERSION >= '1.9'
17
+ gem "simplecov"
18
+ gem "guard"
19
+ gem 'guard-minitest'
15
20
  end
16
21
 
17
22
  if File.exists?('Gemfile.local')
@@ -1,6 +1,4 @@
1
1
 
2
- = THIS BRANCH CONTAINS A PROPOSAL FOR A LICENSE CHANGE AND IS NOT MEANT FOR RELEASE
3
-
4
2
  = gd2-ffij - Ruby FFI Bindings for Thomas Boutell's gd 2.x Graphics Library
5
3
 
6
4
  The gd2-ffij project page can be found at
data/Rakefile CHANGED
@@ -22,5 +22,5 @@ Rake::RDocTask.new do |t|
22
22
  t.title = "gd2-ffij #{version}"
23
23
  t.main = 'README.rdoc'
24
24
  t.rdoc_dir = 'doc'
25
- t.rdoc_files.include('README.rdoc', 'COPYING', 'COPYRIGHT', 'lib/**/*.rb')
25
+ t.rdoc_files.include('README.rdoc', 'COPYRIGHT', 'lib/**/*.rb')
26
26
  end
@@ -40,13 +40,7 @@ module GD2
40
40
 
41
41
  extend FFI::Library
42
42
 
43
- begin
44
- ffi_lib(*gd_library_name)
45
- rescue LoadError, NoMethodError
46
- raise LoadError.new("Couldn't load the gd2 library.")
47
- end
48
-
49
- {
43
+ FFI_LAYOUT = {
50
44
  :gdImageCreate => [ :pointer, :int, :int ],
51
45
  :gdImageCreateTrueColor => [ :pointer, :int, :int ],
52
46
  :gdImageCreatePaletteFromTrueColor => [ :pointer, :pointer, :int, :int ],
@@ -137,9 +131,23 @@ module GD2
137
131
  :gdFontCacheShutdown => [ :void ],
138
132
  :gdFTUseFontConfig => [ :int, :int ],
139
133
  :gdFree => [ :void, :pointer ]
140
- }.each do |fun, ary|
141
- ret = ary.shift
142
- attach_function(fun, ary, ret)
134
+ }
135
+
136
+ begin
137
+ ffi_lib(gd_library_name)
138
+
139
+ FFI_LAYOUT.each do |fun, ary|
140
+ ret = ary.shift
141
+ begin
142
+ self.class_eval do
143
+ attach_function(fun, ary, ret)
144
+ end
145
+ rescue FFI::NotFoundError
146
+ # that's okay
147
+ end
148
+ end
149
+ rescue LoadError, NoMethodError
150
+ raise LoadError.new("Couldn't load the gd2 library.")
143
151
  end
144
152
  end
145
153
 
@@ -1,6 +1,6 @@
1
1
  # encoding: ASCII-8BIT
2
2
 
3
3
  module GD2
4
- VERSION = "0.1.2"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gd2-ffij
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - J Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-31 00:00:00.000000000 Z
11
+ date: 2015-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.2.0
111
+ rubygems_version: 2.4.6
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: gd2-ffij is a refactoring of the Ruby/GD2 library implemented with FFI