apipie-dsl 2.1.1 → 2.2.0

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: 5a4101d45b403c1034aeadf0175b74213fc86d40268efb89f122a4f0c56da3b8
4
- data.tar.gz: 7740ed0a5a764a690acf3a44bc0d773df59f204a18042a92a27026ddc9c86cc6
3
+ metadata.gz: 8712c1245add4425a89c69480c9a2e043a0c40a71199e64ce2dc4df6b3352973
4
+ data.tar.gz: e37febc7bf4200644582443d6d39224ab172f666e849abcd219b60a4e28c2809
5
5
  SHA512:
6
- metadata.gz: 253276c771d1c838c85b3bbb4d523e3881ca362b2c791c5164b52cfcf812db7050f956c4d02378da6740fd55f10e778b0a25b0a3816890f8db0dcd5a8b4add46
7
- data.tar.gz: a19479b561f1ca2b98d2fa3596a02419a3076922ff0cb00b82f759fb02459d098651f3985e458fd0214cbffbb27bf7d49820a6d181505605f656099495f20201
6
+ metadata.gz: 1b8b7af91cb70d835a8227038aef33b559bdd43f8bfcc42a92b83b990b2e212808016a119e5a0543a5f36a4a819b990f8a2127dfe8bc3f987882bea50e4984cf
7
+ data.tar.gz: 6e7c84c789542c09838bb37650af701bcf24f8210f451e74bbf097541e05659cba3d76be5a29aa687b2176ab8e7c335335671ba7f76110a0ca697d93816384d8
@@ -44,7 +44,7 @@ module ApipieDslHelper
44
44
  when 'keyword'
45
45
  "#{param[:name]}: #{default}"
46
46
  end
47
- end.join(', ')
47
+ end.compact.join(', ')
48
48
 
49
49
  block_param = method_desc[:params].find { |p| p[:type] == 'block' }
50
50
 
@@ -6,13 +6,17 @@
6
6
  <a href='<%= meth[:doc_url] %><%= link_extension %>'> >>> </a>
7
7
  </div>
8
8
  <div>
9
+ <% (meth[:signature] || [method_signature(meth)]).each do |signature| %>
10
+ <h2>
11
+ <a href='#description-<%= escaped_method_name(meth[:name], '_') %>'
12
+ class='accordion-toggle'
13
+ data-toggle='collapse'
14
+ data-parent='#meth-accordion'>
15
+ <%= signature %>
16
+ </a>
17
+ </h2>
18
+ <% end %>
9
19
  <h2>
10
- <a href='#description-<%= escaped_method_name(meth[:name], '_') %>'
11
- class='accordion-toggle'
12
- data-toggle='collapse'
13
- data-parent='#meth-accordion'>
14
- <%= method_signature(meth) %>
15
- </a>
16
20
  <% if meth[:deprecated] %>
17
21
  <code>DEPRECATED</code>
18
22
  <% end %>
@@ -29,8 +29,10 @@
29
29
  </ul>
30
30
 
31
31
  <div class='page-header'>
32
+ <% (@method[:signature] || [method_signature(@method)]).each do |signature| %>
33
+ <h1> <%= signature %> </h1>
34
+ <% end %>
32
35
  <h1>
33
- <%= method_signature(@method) %>
34
36
  <% if @method[:deprecated] %>
35
37
  <code>DEPRECATED</code>
36
38
  <% end %>
@@ -175,6 +175,10 @@ module ApipieDSL
175
175
  dsl_data[:aliases] = names
176
176
  end
177
177
 
178
+ def signature(*signature)
179
+ dsl_data[:signature] = signature
180
+ end
181
+
178
182
  # Describe possible errors
179
183
  #
180
184
  # Example:
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ApipieDSL
4
4
  class MethodDescription
5
- attr_reader :name, :klass, :see, :examples
5
+ attr_reader :name, :klass, :see, :examples, :signature
6
6
  attr_accessor :full_description, :short_description, :metadata, :show,
7
7
  :raises, :returns, :aliases
8
8
  alias_method :class_description, :klass
@@ -54,6 +54,8 @@ module ApipieDSL
54
54
  end
55
55
 
56
56
  @aliases = dsl_data[:aliases]
57
+
58
+ @signature = dsl_data[:signature]
57
59
  end
58
60
 
59
61
  def id
@@ -105,7 +107,8 @@ module ApipieDSL
105
107
  see: see.map(&:docs),
106
108
  show: @show,
107
109
  examples: @examples,
108
- aliases: aliases
110
+ aliases: aliases,
111
+ signature: signature
109
112
  }
110
113
  end
111
114
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApipieDSL
4
- VERSION = '2.1.1'
4
+ VERSION = '2.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apipie-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleh Fedorenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler