apipie-dsl 2.6.1 → 2.6.3

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: a935b655bd2524a43eefbca0dca4de2ef003ec752093f970e2cc99ae7c29aba0
4
- data.tar.gz: f7b5dadbbd5e454318c721697c5e1866011ec368e6bc0371faac1a9efae27693
3
+ metadata.gz: da68108e5ca23babc8b31d829ee286270c363aefc5d2215692f223794f67b91e
4
+ data.tar.gz: 665784102a79fa4a55bd76999bcb81049f95700c3361ac0594150317d4dd2ec4
5
5
  SHA512:
6
- metadata.gz: 886c7753ceb135d1a479d8240709970ec999e8646d52e153170dbecef3359a2e4e13fe6292f3d39955866ad57570ab1c41e027578ff33671d79507266a4eb8b9
7
- data.tar.gz: 15a296d6773f87d4637891cc4ed23ff5e65a3b8056ff3392edaa55b508db427f5b4c4163ce9143346217e0365763cd4723f3bdb9f5b7b80ad56ad43eac799ba0
6
+ metadata.gz: 4a4cbb6cc0556ed93c96f7e1517670f8bca01827bce13322ab19d78bbbd9268a29a017466cbdcd67aaae758d77e7ca906d22b5b505bb8ab2e6c1df435d385a6a
7
+ data.tar.gz: 7214315041c96070bf2847c7f198b8527513eb90fc3180128c26872261c52516c5733c8b2475acc281c3a19be0b09004ec65d1d3c0facc70f637171bfe9d058d
@@ -83,6 +83,8 @@ module ApipieDslHelper
83
83
  when 'optional'
84
84
  if param[:expected_type] == 'list'
85
85
  "*#{param[:name]}"
86
+ elsif param[:expected_type] == 'kwlist'
87
+ "**#{param[:name]}"
86
88
  else
87
89
  "#{param[:name]} = #{default}"
88
90
  end
@@ -130,6 +130,14 @@ module ApipieDSL
130
130
  alias_method :splat, :list
131
131
  alias_method :rest, :list
132
132
 
133
+ def kwlist(name, desc_or_options = nil, options = {})
134
+ options[:type] = :optional
135
+ options[:default] ||= 'empty key: value list'
136
+ param(name, :kwrest, desc_or_options, options)
137
+ end
138
+ alias_method :kwsplat, :kwlist
139
+ alias_method :kwrest, :kwlist
140
+
133
141
  def define_param_group(name, &block)
134
142
  ApipieDSL.define_param_group(class_scope, name, &block)
135
143
  end
@@ -3,6 +3,12 @@
3
3
  module ApipieDSL
4
4
  module Markup
5
5
  class RDoc
6
+
7
+ def initialize
8
+ require 'rdoc'
9
+ require 'rdoc/markup/to_html'
10
+ end
11
+
6
12
  def to_html(text)
7
13
  rdoc.convert(text)
8
14
  end
@@ -10,14 +16,11 @@ module ApipieDSL
10
16
  private
11
17
 
12
18
  def rdoc
13
- @rdoc ||= begin
14
- require 'rdoc'
15
- require 'rdoc/markup/to_html'
16
- if Gem::Version.new(::RDoc::VERSION) < Gem::Version.new('4.0.0')
17
- ::RDoc::Markup::ToHtml.new()
18
- else
19
- ::RDoc::Markup::ToHtml.new(::RDoc::Options.new)
20
- end
19
+ rdoc_version = Gem::Version.new(::RDoc::VERSION)
20
+ if rdoc_version >= Gem::Version.new('4.0.0') && rdoc_version < Gem::Version.new('8.0.0')
21
+ ::RDoc::Markup::ToHtml.new(::RDoc::Options.new)
22
+ else
23
+ ::RDoc::Markup::ToHtml.new()
21
24
  end
22
25
  end
23
26
  end
@@ -440,6 +440,27 @@ module ApipieDSL
440
440
  end
441
441
  end
442
442
 
443
+ class KWRestValidator < BaseValidator
444
+ def self.build(param_description, argument, _options, _block)
445
+ return unless %i[kwrest kwlist kwsplat].include?(argument)
446
+
447
+ new(param_description)
448
+ end
449
+
450
+ def validate(_value)
451
+ # In **kwrest param we don't care about passed values.
452
+ true
453
+ end
454
+
455
+ def description
456
+ 'Must be a list of key: value'
457
+ end
458
+
459
+ def expected_type
460
+ 'kwlist'
461
+ end
462
+ end
463
+
443
464
  class NestedValidator < BaseValidator
444
465
  def initialize(param_description, argument, param_group)
445
466
  super(param_description)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApipieDSL
4
- VERSION = "2.6.1"
4
+ VERSION = "2.6.3"
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.6.1
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleh Fedorenko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2026-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -198,7 +198,7 @@ homepage: https://github.com/Apipie/apipie-dsl
198
198
  licenses:
199
199
  - MIT
200
200
  metadata: {}
201
- post_install_message:
201
+ post_install_message:
202
202
  rdoc_options: []
203
203
  require_paths:
204
204
  - lib
@@ -213,8 +213,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
213
  - !ruby/object:Gem::Version
214
214
  version: '0'
215
215
  requirements: []
216
- rubygems_version: 3.1.6
217
- signing_key:
216
+ rubygems_version: 3.2.33
217
+ signing_key:
218
218
  specification_version: 4
219
219
  summary: Ruby DSL documentation tool
220
220
  test_files: