Skip to content

Commit 514d791

Browse files
committed
Support building of fat binary gem
This should fix issue #51 on Windows
1 parent 0b15820 commit 514d791

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

CHANGES

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
2010-08-15 (1.5.0)
1+
2011-01-24 (1.5.1)
2+
* Made rake-compiler build a fat binary gem. This should fix issue
3+
https://github.com/flori/json/issues#issue/54.
4+
2011-01-22 (1.5.0)
25
* Included Java source codes for the Jruby extension made by Daniel Luz
36
<dev@mernen.com>.
47
* Output full exception message of deep_const_get to aid debugging.

Rakefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,12 @@ else
386386
desc "Generate diagrams of ragel parser"
387387
task :ragel_dot => [ :ragel_dot_png, :ragel_dot_ps ]
388388

389+
task :environment do
390+
ENV['RUBY_CC_VERSION'] = '1.8.7:1.9.2'
391+
end
392+
389393
desc "Build all gems and archives for a new release of json and json_pure."
390-
task :release => [ :clean, :version, :cross, :native, :gem, ] do
394+
task :release => [ :clean, :version, :environment, :cross, :native, :gem, ] do
391395
sh "#$0 clean native gem"
392396
sh "#$0 clean package"
393397
end

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.0
1+
1.5.1

lib/json/ext.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@ module JSON
44
# This module holds all the modules/classes that implement JSON's
55
# functionality as C extensions.
66
module Ext
7-
require 'json/ext/parser'
8-
require 'json/ext/generator'
7+
begin
8+
if defined?(RUBY_ENGINE) == 'constant' and RUBY_ENGINE == 'ruby' and RUBY_VERSION =~ /\A1\.9\./
9+
require 'json/ext/1.9/parser'
10+
require 'json/ext/1.9/generator'
11+
elsif !defined?(RUBY_ENGINE) && RUBY_VERSION =~ /\A1\.8\./
12+
require 'json/ext/1.8/parser'
13+
require 'json/ext/1.8/generator'
14+
else
15+
require 'json/ext/parser'
16+
require 'json/ext/generator'
17+
end
18+
rescue LoadError
19+
require 'json/ext/parser'
20+
require 'json/ext/generator'
21+
end
922
$DEBUG and warn "Using Ext extension for JSON."
1023
JSON.parser = Parser
1124
JSON.generator = Generator

lib/json/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module JSON
22
# JSON version
3-
VERSION = '1.5.0'
3+
VERSION = '1.5.1'
44
VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
55
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
66
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:

0 commit comments

Comments
 (0)