Skip to content
Browse files

Ruby 2.0 fixes.

  • Loading branch information...
1 parent d58562f commit 0e4e29738888980827606347b17693f15b0899fd @pwnall committed Mar 14, 2013
Showing with 13 additions and 7 deletions.
  1. +1 −1 Gemfile
  2. +3 −3 Gemfile.lock
  3. +9 −3 script/git_shell.rb
View
2 Gemfile
@@ -33,7 +33,7 @@ gem 'jquery-rails', '>= 2.2.0'
gem 'authpwn_rails', '>= 0.14.0'
gem 'configvars_rails', '>= 0.5.2'
gem 'gravatar-ultimate', '>= 1.0.3'
-gem 'grit', :git => 'https://github.com/pwnall/grit.git', :branch => 'hunks'
+gem 'grit', :git => 'https://github.com/pwnall/grit.git', :branch => 'gitty'
gem 'json', :platforms => [:mri_18, :jruby]
gem 'markdpwn', '>= 0.1.5'
gem 'net-ssh', '>= 2.6.3', :require => 'net/ssh'
View
6 Gemfile.lock
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/pwnall/grit.git
- revision: a61253bd78ac289122e5110f26c591007a40b7c3
- branch: hunks
+ revision: 750045fdc460905e4ada315a3cf13623b6c8c362
+ branch: gitty
specs:
grit (2.5.0)
diff-lcs (~> 1.1)
@@ -92,7 +92,7 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.7)
- jwt (0.1.7)
+ jwt (0.1.8)
multi_json (>= 1.5)
libv8 (3.11.8.13)
mail (2.5.3)
View
12 script/git_shell.rb
@@ -11,7 +11,9 @@
end
begin
- require 'json'
+ unless defined? JSON
+ require 'json'
+ end
rescue LoadError
# Ruby 1.8
begin
@@ -21,11 +23,15 @@
# If the JSON gem is not available, use a hack that mostly works.
module JSON
def self.parse(data)
- raise SyntaxError, 'Not JSON' unless data[0] == ?{ && data[-1] == ?}
+ unless data[0] == ?{ && data[-1] == ?}
+ raise JSON::JSONError, 'Not JSON'
+ end
eval data.gsub(/([^\\])":/, '\\1"=>')
end
end
- JSON::JSONError = SyntaxError
+ unless defined? JSON::JSONError
+ JSON::JSONError = SyntaxError
+ end
end
end

0 comments on commit 0e4e297

Please sign in to comment.
Something went wrong with that request. Please try again.