glib2 1.1.2 → 1.1.3

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.
@@ -13,7 +13,7 @@ require 'rake/extensiontask'
13
13
  class GNOME2Package
14
14
  include Rake::DSL
15
15
 
16
- attr_accessor :name, :summary, :description, :author, :email, :homepage, :post_install_message
16
+ attr_accessor :name, :summary, :description, :author, :email, :homepage, :required_ruby_version, :post_install_message
17
17
  def initialize
18
18
  initialize_variables
19
19
  initialize_configurations
@@ -97,6 +97,7 @@ class GNOME2Package
97
97
  "{ext,sample,test,test-unit}/**/*"]
98
98
  files.existing!
99
99
  s.files = files
100
+ s.required_ruby_version = @required_ruby_version || ">= 1.8.5"
100
101
  s.post_install_message = @post_install_message
101
102
  @dependency_configuration.apply(s)
102
103
  end
@@ -158,7 +159,6 @@ class GNOME2Package
158
159
  def initialize(package)
159
160
  @package = package
160
161
  @platform = Gem::Platform::RUBY
161
- @ruby = ">=1.8.5"
162
162
  @gem_configuration = GemConfiguration.new(@package)
163
163
  end
164
164
 
@@ -168,7 +168,6 @@ class GNOME2Package
168
168
 
169
169
  def apply(spec)
170
170
  spec.platform = @platform
171
- spec.required_ruby_version = @ruby
172
171
  @gem_configuration.apply(spec)
173
172
  end
174
173
 
@@ -351,7 +351,11 @@ class TestGLibUnicode < Test::Unit::TestCase
351
351
 
352
352
  def utf8_to_utf32(string)
353
353
  if string.respond_to?(:encode)
354
- string.encode("UTF-32LE")
354
+ if little_endian?
355
+ string.encode("UTF-32LE")
356
+ else
357
+ string.encode("UTF-32BE")
358
+ end
355
359
  else
356
360
  require_uconv
357
361
  Uconv.u8tou4(string)
@@ -360,7 +364,11 @@ class TestGLibUnicode < Test::Unit::TestCase
360
364
 
361
365
  def utf8_to_utf16(string)
362
366
  if string.respond_to?(:encode)
363
- string.encode("UTF-16LE")
367
+ if little_endian?
368
+ string.encode("UTF-16LE")
369
+ else
370
+ string.encode("UTF-16BE")
371
+ end
364
372
  else
365
373
  require_uconv
366
374
  Uconv.u8tou16(string)
@@ -379,4 +387,8 @@ class TestGLibUnicode < Test::Unit::TestCase
379
387
  end
380
388
  string
381
389
  end
390
+
391
+ def little_endian?
392
+ [1].pack("v") == [1].pack("S")
393
+ end
382
394
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 2
10
- version: 1.1.2
9
+ - 3
10
+ version: 1.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - The Ruby-GNOME2 Project Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-15 00:00:00 Z
18
+ date: 2012-04-08 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: pkg-config
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  requirements: []
192
192
 
193
193
  rubyforge_project:
194
- rubygems_version: 1.8.12
194
+ rubygems_version: 1.8.15
195
195
  signing_key:
196
196
  specification_version: 3
197
197
  summary: Ruby/GLib2 is a Ruby binding of GLib-2.x.