grape-starter 2.1.0 → 2.1.1

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: 3120d80bd3930bf6d8760f03ef07a3b9ca9330fb2413705fc2330a2120c7a258
4
- data.tar.gz: 33efe62100801cc5def02818625b7c6e336449009bab66d4ef61f0dfc4b6b45f
3
+ metadata.gz: 88f7a549c78c1741a4c0ff18077722f2fb62d3d8b557cc6549c964de83487c2a
4
+ data.tar.gz: cdf6fa7b945c98c173b5c64d1d49423fbc004856b65951f00cc3ace640761ed6
5
5
  SHA512:
6
- metadata.gz: 60074684dfe1773666cf6c24c373edcd009eec3ab9d0b33c13caa05c5a1f57cb263160f21c28aacefcc0f63c82f0ed4df077bc095dea17f90398319e6d247e83
7
- data.tar.gz: 9b57425801bce4d43f439fe93600764e5e37d1f3cc08d2c0ce6a5a1298e2304352eb2850ef082a7d23f899e4740c2c0c97dd324e8de28fab86563039cbd2a49e
6
+ metadata.gz: 6a5e7ab35998625f88a216f9313ab7a155a1a2df30a8da690eb96ba75e1bc3cf26c1ed2d830a2b0761dd8c7e4554796bec064c9707de3048532502a53ae7ff20
7
+ data.tar.gz: 73569bbbd944855371b5121bf1d28c1d3dadfa848b3dddb856781785ea82a328204ef2cb97631a037ac4bf9f1ae3633513100b067b6e3103ff01472f31e287c4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  - contributions
4
4
 
5
+ ### v2.1.1 / 2023-10-24
6
+
7
+ - [(#43)](https://github.com/LeFnord/grape-starter/pull/43) Fixes desc generation if now useful prop is in content [LeFnord](https://github.com/LeFnord)
8
+
5
9
  ### v2.1.0 / 2023-10-21 Imports OApi specs
6
10
 
7
11
  - [(#41)](https://github.com/LeFnord/grape-starter/pull/41) Adds generating of desc block [LeFnord](https://github.com/LeFnord)
data/README.md CHANGED
@@ -144,7 +144,7 @@ to create an API based on the spec.
144
144
  - [x] specify it
145
145
  - [x] handle query parameter -> check it
146
146
  - [x] handle body parameter -> check it
147
- - [ ] add description block
147
+ - [x] add description block
148
148
 
149
149
 
150
150
  ### Remove a resource
@@ -9,18 +9,28 @@ module Starter
9
9
  @content = content
10
10
  end
11
11
 
12
- def to_s
12
+ def to_s # rubocop:disable Metrics/AbcSize
13
13
  return if content.blank?
14
14
 
15
- desc = content['summary'] || name
15
+ desc = content['summary'] || content['operationId']
16
+ entry = "desc '#{desc}'\n"
16
17
 
17
- entry = "desc '#{desc}' do\n"
18
+ return entry unless block_keys.intersect?(content.keys)
19
+
20
+ entry.sub!("\n", " do\n")
18
21
  entry << " detail '#{content['description']}'\n" if content.key?('description')
19
22
  entry << " tags #{content['tags']}\n" if content.key?('tags')
20
23
  entry << 'end'
21
24
 
22
25
  entry
23
26
  end
27
+
28
+ def block_keys
29
+ %w[
30
+ description
31
+ tags
32
+ ]
33
+ end
24
34
  end
25
35
  end
26
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Starter
4
- VERSION = '2.1.0'
4
+ VERSION = '2.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeFnord
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-22 00:00:00.000000000 Z
11
+ date: 2023-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
- rubygems_version: 3.4.17
180
+ rubygems_version: 3.4.21
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: Creates a Grape Rack skeleton