imago 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: 417e5a3f6b7a3d41cee0ce17ec1cc225862fcc72c2448fc1c9b1da989509afd3
4
- data.tar.gz: feca98a16c48e79f386b88626d7fa5934be4637910ae250a91bf036f79a2865b
3
+ metadata.gz: e60c91ea1180d1b06bb91773b1d67bfe8d8adbfabda855a702b4260e64c7be3e
4
+ data.tar.gz: 502c092d7658190fa88a32faf3e4f528187ae77ce1777d143c7079a4c47cfaa8
5
5
  SHA512:
6
- metadata.gz: bb62ccf9dcb695a401f08674d68ba37e7b3f2e8cdb7ae5820735d987aa41839f95a2fd5152533016fd8a6b704fd43df26ebf9e18d8b4f64181ed4bfbea3a4a1e
7
- data.tar.gz: da94d8fbd02b78cce3ab04c567fa90881752670973925254c77ed724a645c9974dbb635b810e70ebe7182e5f5b658ae83f29590adaa867844760c5501cb70027
6
+ metadata.gz: 61f09f390958a1e2b878be10748a76ef1559682f283d229bd1c508301daf680ec5541cc75f53af86a86bc9f92609789c28373378f322bcdfdd3d09380580cf7f
7
+ data.tar.gz: 6060353aa5cc5d06cea8e0abee4b2f10504a64bdfb6c406cf4ea3278feff354c35e06c7967bfe97d32d6fa8bd2945fadc7d7a625322bbe8d12e05735e47f641a
data/.rubocop.yml CHANGED
@@ -63,3 +63,7 @@ Metrics/PerceivedComplexity:
63
63
 
64
64
  RSpec/MessageSpies:
65
65
  EnforcedStyle: receive
66
+
67
+ Style/GuardClause:
68
+ Enabled: true
69
+
@@ -88,7 +88,17 @@ module Imago
88
88
  end
89
89
 
90
90
  def build_generation_config(opts)
91
- { candidateCount: opts[:sample_count] || opts[:n], seed: opts[:seed], aspectRatio: opts[:aspect_ratio] }.compact
91
+ config = { candidateCount: opts[:sample_count] || opts[:n], seed: opts[:seed] }.compact
92
+ config[:imageConfig] = build_image_config(opts) if image_config_present?(opts)
93
+ config
94
+ end
95
+
96
+ def image_config_present?(opts)
97
+ opts[:aspect_ratio]
98
+ end
99
+
100
+ def build_image_config(opts)
101
+ { aspectRatio: opts[:aspect_ratio] }.compact
92
102
  end
93
103
 
94
104
  def fetch_models
data/lib/imago/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Imago
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imago
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - NEETzsche