Skip to content

Commit b29b3f4

Browse files
committed
Merge pull request gazay#37 from maletor/master
Jbuilder support 1.8.7 now
2 parents 1a0a60b + cbb94f5 commit b29b3f4

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ gon.rabl :as => 'alias'
240240
241241
Use gon with [Jbuilder](https://github.com/rails/jbuilder) as with [Rabl](https://guthub.com/nesquena/rabl):
242242
243-
Jbuilder works now only on Ruby 1.9+, so Gon support for Jbuilder works on 1.9+ only
244-
245243
0. Add jbuilder to your Gemfile (because of it depends on
246244
ActiveSuppurt '~> 3.0.0')
247245

lib/gon.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if RUBY_VERSION > '1.9' && defined?(Jbuilder)
1+
if defined?(Jbuilder)
22
gem 'blankslate'
33
end
44
require 'action_view'
@@ -8,7 +8,7 @@
88
if defined?(Rabl)
99
require 'gon/rabl'
1010
end
11-
if RUBY_VERSION > '1.9' && defined?(Jbuilder)
11+
if defined?(Jbuilder)
1212
require 'gon/jbuilder'
1313
end
1414

@@ -88,7 +88,6 @@ def set_variable(name, value)
8888
alias_method :orig_jbuilder, :jbuilder
8989

9090
def jbuilder(*options)
91-
raise NoMethodError.new('You can use Jbuilder support only in 1.9+') if RUBY_VERSION < '1.9'
9291
orig_jbuilder(*options)
9392
end
9493

spec/gon/gon_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136

137137
end
138138

139-
if RUBY_VERSION > '1.9'
140139
require 'jbuilder'
141140
require 'gon/jbuilder'
142141

@@ -164,14 +163,7 @@
164163

165164
end
166165

167-
it 'should throw error if you use gon.jbuilder with ruby < 1.9+' do
168-
RUBY_VERSION = '1.8.7'
169-
170-
expect { Gon.jbuilder 'some_path'}.to raise_error(NoMethodError, /1.9/)
171-
end
172-
173166
it 'should raise error if you use gon.jbuilder without requiring jbuilder gem' do
174-
RUBY_VERSION = '1.9.2'
175167
Gon.send(:remove_const, :Jbuilder)
176168

177169
expect { Gon.jbuilder 'some_path' }.to raise_error(NoMethodError, /Gemfile/)
@@ -214,7 +206,6 @@
214206
end
215207
end
216208

217-
end
218209

219210
def request
220211
@request ||= double 'request', :env => {}

0 commit comments

Comments
 (0)