glue_gun_dsl 0.1.28 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5b050524f016e18d7b9937fbc5bbba5e8bf989690fdfda10a6bd0adf09aeb86
4
- data.tar.gz: 2eab6853e671117b5253de7a88b9edb0f5274c5688ddd5817ce35ad77d8185de
3
+ metadata.gz: 1c7ef75df045c142a9b1175b91ad7f7745179ea3dacfa5c30c2b2409e1d4fe78
4
+ data.tar.gz: 3e55b0b662c7ccf655e784cc9672a5e6f7a792268bd0140d28e66b8b4439b627
5
5
  SHA512:
6
- metadata.gz: 30b842fe667aa8f8785a903d1b61f3e3fb65799cc417214392ecde7022251fd3ab212f81d5d26ea9d8818ca3241649729eb92b8e6454c128a8659f12d3f2f96a
7
- data.tar.gz: c000b550317b50a2c17c985f8d7e574e4bef04444e20f9cfdecef46420efa14e931a11f01334e1ad06f04889a60a3dedd29cdd3118fab478236b0703a06b3bbb
6
+ metadata.gz: f97de5312eaaae95f2c57bd8691a4751f55902ffdd7f8140d0f11a6548c2004afc47f31612f1e7ad14b42e2d530bdbf588349a9e8c4c0645a8dc760da3b383c4
7
+ data.tar.gz: 11916bd9c893ce87058a1fbf1e4f2b4b9fbcd16b8867493e35c932622e8ebcbe43ed8cee3291219aa24a274cb60a79f6d1f9ae15c67c712e1bf3f3398805f6a6
@@ -139,6 +139,10 @@ module GlueGun
139
139
 
140
140
  private
141
141
 
142
+ def awesome_print(message)
143
+ ap message
144
+ end
145
+
142
146
  def build_service_object(attributes)
143
147
  self.class.send(:attr_reader, service_attribute_name)
144
148
  service_class = resolve_service_class(attributes)
@@ -148,9 +152,9 @@ module GlueGun
148
152
  begin
149
153
  service_instance = service_class.new(service_attributes)
150
154
  rescue StandardError => e
151
- ap %(Error building service object #{service_class}:)
152
- ap e.message
153
- ap e.backtrace
155
+ awesome_print %(Error building service object #{service_class}:)
156
+ awesome_print e.message
157
+ awesome_print e.backtrace
154
158
  raise e
155
159
  end
156
160
  instance_variable_set("@#{service_attribute_name}", service_instance)
@@ -159,8 +163,10 @@ module GlueGun
159
163
  def resolve_service_type(attributes, initializing = false)
160
164
  attrs = if initializing || !persisted? || attributes.key?(self.class.option_key)
161
165
  attributes
162
- else
166
+ elsif respond_to?(self.class.option_key)
163
167
  { self.class.option_key => send(self.class.option_key) }
168
+ else
169
+ { self.class.option_key => self.class.service_registry.default_key }
164
170
  end
165
171
  attrs[self.class.option_key] || self.class.service_registry.default_key
166
172
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GlueGun
4
- VERSION = "0.1.28"
4
+ VERSION = "0.1.29"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glue_gun_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.28
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2024-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel