gql 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd8a84ed2a267ac54920709090a7f462e68d3669
4
- data.tar.gz: 4a3e5bec9744df6f0af716d1ac21bdb9dfe309cc
3
+ metadata.gz: 91c3e88c06f95f36b8f36526bce27d09799bec99
4
+ data.tar.gz: fc749a590e76c66395a5f7d9bc8353368004053a
5
5
  SHA512:
6
- metadata.gz: f35fc1eae1c53765b4c1f931bb12b2fd5f8325f470d9315e2ed26485cdb79fd6604413e127e096f6a475332b720fcc53238d068c1f11433e61ae3e5c4fb83b87
7
- data.tar.gz: f76fd8dff372e093470a0dda9b5aac075ddfdfd17f9e8f83759a90748677a54542988491e84e1c024a71f49e3b83d88ebcf64bfa48d81b62a0cc0c1197ea57b4
6
+ metadata.gz: 322528bd170fde6ab9d4ccfb70f4faa1619c4da64b9189b49f11899dc2a265db48ea08d6e95512e234d275845d13c733e70300ee7b039f434f8b1a956ab18e24
7
+ data.tar.gz: b38aea1027e426fe732024b35ed37bf23bf41feb3cd31b63e62730f1f53be942452097d526a6569bd7b5c832b416bc1258363fe6f2bd40a7b684e42ccff9e078
data/lib/gql/config.rb CHANGED
@@ -66,13 +66,18 @@ module GQL
66
66
  end
67
67
 
68
68
  def debug
69
- @@debug ||= ENV.has_key?('DEBUG')
69
+ if defined? @@debug
70
+ @@debug
71
+ else
72
+ @@debug = nil
73
+ self.debug = ENV.has_key?('DEBUG')
74
+ end
70
75
  end
71
76
 
72
77
  def debug=(value)
73
78
  value = !!value
74
79
 
75
- return if value == debug
80
+ return if value == @@debug
76
81
 
77
82
  value ? switch_debug_on : switch_debug_off
78
83
 
@@ -93,8 +98,10 @@ module GQL
93
98
  def switch_on_type_field
94
99
  return if Node.fields.has_key? :__type__
95
100
 
96
- [Node, *Node.descendants].each do |node_class|
97
- node_class.object :__type__, -> { field_class }, node_class: Schema::Field
101
+ type_field_class = Node.object :__type__, -> { field_class }, node_class: Schema::Field
102
+
103
+ Node.descendants.each do |node_class|
104
+ node_class.fields[:__type__] = type_field_class
98
105
  end
99
106
  end
100
107
 
@@ -10,10 +10,6 @@ module GQL
10
10
  included do
11
11
  class_attribute :fields, :field_proc, instance_accessor: false, instance_predicate: false
12
12
  self.fields = {}
13
-
14
- object :__type__, -> { field_class }, node_class: Schema::Field if GQL.debug
15
-
16
- const_set :ExecutionContext, GQL.debug ? ExecutionContextDebug : ExecutionContextNoDebug
17
13
  end
18
14
 
19
15
  module ClassMethods
data/lib/gql/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GQL
2
- VERSION = '0.0.16'
2
+ VERSION = '0.0.17'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Andert