Skip to content

Commit edf849b

Browse files
committed
Fix constant redefinition warning
In e18fe2a the Jbuilder::VERSION constant was introduced but in 9aa3dd9 it was used in the gemspec which changed the loading order so that the version constant was loaded first. This defined Jbuilder as an Object subclass rather than the intended BasicObject and when jbuilder/jbuilder was required it redefined the Jbuilder constant and obliterates the VERSION constant. This commit ensures that the version constant exists and the Jbuilder parent class is BasicObject.
1 parent 9e0540b commit edf849b

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

lib/jbuilder.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require 'jbuilder/blank'
44
require 'jbuilder/key_formatter'
55
require 'jbuilder/errors'
6-
require 'jbuilder/version'
76
require 'json'
87
require 'active_support/core_ext/hash/deep_merge'
98

lib/jbuilder/errors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'jbuilder/jbuilder'
1+
require 'jbuilder/version'
22

33
class Jbuilder
44
class NullError < ::NoMethodError

lib/jbuilder/jbuilder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Jbuilder = Class.new(BasicObject)
1+
require 'jbuilder/version'

lib/jbuilder/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Jbuilder
1+
class Jbuilder < BasicObject
22
VERSION = "2.13.0"
33
end

0 commit comments

Comments
 (0)