Skip to content

Commit

Permalink
Support building of fat binary gem
Browse files Browse the repository at this point in the history
This should fix issue #51 on Windows
  • Loading branch information
flori committed Jan 26, 2011
1 parent 0b15820 commit 514d791
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
2010-08-15 (1.5.0)
2011-01-24 (1.5.1)
* Made rake-compiler build a fat binary gem. This should fix issue
/~https://github.com/flori/json/issues#issue/54.
2011-01-22 (1.5.0)
* Included Java source codes for the Jruby extension made by Daniel Luz
<dev@mernen.com>.
* Output full exception message of deep_const_get to aid debugging.
Expand Down
6 changes: 5 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,12 @@ else
desc "Generate diagrams of ragel parser"
task :ragel_dot => [ :ragel_dot_png, :ragel_dot_ps ]

task :environment do
ENV['RUBY_CC_VERSION'] = '1.8.7:1.9.2'
end

desc "Build all gems and archives for a new release of json and json_pure."
task :release => [ :clean, :version, :cross, :native, :gem, ] do
task :release => [ :clean, :version, :environment, :cross, :native, :gem, ] do
sh "#$0 clean native gem"
sh "#$0 clean package"
end
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
17 changes: 15 additions & 2 deletions lib/json/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ module JSON
# This module holds all the modules/classes that implement JSON's
# functionality as C extensions.
module Ext
require 'json/ext/parser'
require 'json/ext/generator'
begin
if defined?(RUBY_ENGINE) == 'constant' and RUBY_ENGINE == 'ruby' and RUBY_VERSION =~ /\A1\.9\./
require 'json/ext/1.9/parser'
require 'json/ext/1.9/generator'
elsif !defined?(RUBY_ENGINE) && RUBY_VERSION =~ /\A1\.8\./
require 'json/ext/1.8/parser'
require 'json/ext/1.8/generator'
else
require 'json/ext/parser'
require 'json/ext/generator'
end
rescue LoadError
require 'json/ext/parser'
require 'json/ext/generator'
end
$DEBUG and warn "Using Ext extension for JSON."
JSON.parser = Parser
JSON.generator = Generator
Expand Down
2 changes: 1 addition & 1 deletion lib/json/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module JSON
# JSON version
VERSION = '1.5.0'
VERSION = '1.5.1'
VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
Expand Down

0 comments on commit 514d791

Please sign in to comment.