rpdoc 0.3.0 → 0.3.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: e84bf7f80289a316f0b6c7f6b2de7c9fb6892aef65e359a248a087a63258e721
4
- data.tar.gz: b9428134ee02bc3917aa1c3801194dd598dc25605cb331b098b1e67d4216ff96
3
+ metadata.gz: e40662fbf5bf38f05614473952e0daad1fbd30de69f9587e595785bcfb9bbe05
4
+ data.tar.gz: efa6780201cf80d7c3bbb584e5f17f651d8b9a0bd4ccf4edf19d281b5ddd48a3
5
5
  SHA512:
6
- metadata.gz: 1a87a786d45263ebb13743d0ed17703f45ea2d9fc0c73b88bc53eebbf7139aa8b20df421b81f94f213f9aee5c88b8f6a882180223e96c3e588faa04e79b9ef1d
7
- data.tar.gz: 48749aea15bd52f4c676330fd3fe2e4e7d2e3046e9d5647a56efad301af90182528d11fae38401963bb34a624e3e726d5b48ca3bebc4f1767154bc9e9bdab51d
6
+ metadata.gz: ef9300e8e12a8638825cbaa4df8065829461657c3afd195f21fab2b5e47294d322fd6e87f4cca8a29fe69ac373ba9c9e8d02c13facd4120012d5623200952cf2
7
+ data.tar.gz: ad1126a812272b2dc204b21a74654f8c813caee34916348e15daf35e02ff7c55183a4d0e263657bcc8cab4efa1925b83129ff7b720d6190a678411aa3711c1ad
data/.gitignore CHANGED
@@ -4,5 +4,6 @@
4
4
  /coverage/
5
5
  /doc/
6
6
  /pkg/
7
+ /rpdoc/collection.json
7
8
  /spec/reports/
8
9
  /tmp/
data/.gitlab-ci.yml CHANGED
@@ -44,7 +44,7 @@ to_gem:
44
44
  - touch ~/.gem/credentials
45
45
  - chmod 0600 ~/.gem/credentials
46
46
  - 'printf -- "---\n:rubygems_api_key: $GEM_HOST_API_KEY\n" > ~/.gem/credentials'
47
- - RELEASE_VERSION=$(cat VERSION.md)
47
+ - RELEASE_VERSION=$(ruby -e 'require_relative "./lib/rpdoc/version"; puts Rpdoc::VERSION')
48
48
  - GEM_NAME=rpdoc-$RELEASE_VERSION.gem
49
49
  - gem build rpdoc.gemspec
50
50
  - gem push $GEM_NAME
data/.rubocop.yml CHANGED
@@ -1,10 +1,6 @@
1
1
  AllCops:
2
2
  NewCops: enable
3
- TargetRubyVersion: 3.0
4
-
5
- Style/StringLiterals:
6
- Enabled: true
7
- EnforcedStyle: single_quotes
3
+ TargetRubyVersion: 3.2
8
4
 
9
5
  Style/StringLiteralsInInterpolation:
10
6
  Enabled: false
@@ -46,6 +42,3 @@ Metrics/BlockLength:
46
42
 
47
43
  Metrics/ParameterLists:
48
44
  Max: 10
49
-
50
- Gemspec/RequireMFA:
51
- Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## [0.3.2] - 2026-04-14
2
+ - Update required Ruby version to `>= 3.2.0` in `rpdoc.gemspec` and `.rubocop.yml` to align with the latest security and performance requirements.
3
+ - activesupport to `8.1.3` to address the latest security and performance requirements.
4
+
5
+ ## [0.3.1] - 2026-04-08
6
+ - Update `rack-session` to `2.1.2` to address the latest critical session security advisory.
7
+ - Update `rack` to `3.2.6` to pick up the latest Rack security fixes from Dependabot alerts.
8
+ - Update `addressable` to `2.9.0` to fix Regular Expression Denial of Service in Addressable templates.
9
+ - Remove `VERSION.md` and keep gem versioning on `lib/rpdoc/version.rb` for gem build and release flows.
10
+ - Fix multipart form-data serialization for file array params in `Rpdoc::PostmanResponse`.
11
+ - Add support for both `ActionDispatch::Http::UploadedFile` and `Rack::Test::UploadedFile` in array and nested hash structures.
12
+ - Preserve existing text field output format for nested Hash and Array form-data entries.
13
+
1
14
  ## [0.3.0] - 2026-03-20
2
15
  - Bump gem version to `0.3.0` and raise the required Ruby version to `>= 3.0.0`.
3
16
  - Add `SECURITY.md`, document the project's security policy, and link it from `README.md`.
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rpdoc (0.3.0)
4
+ rpdoc (0.3.1)
5
5
  activesupport (>= 7.1, < 9.0)
6
6
  json_requester (~> 2.0, >= 2.0.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (8.1.2)
12
- actionview (= 8.1.2)
13
- activesupport (= 8.1.2)
11
+ actionpack (8.1.3)
12
+ actionview (= 8.1.3)
13
+ activesupport (= 8.1.3)
14
14
  nokogiri (>= 1.8.5)
15
15
  rack (>= 2.2.4)
16
16
  rack-session (>= 1.0.1)
@@ -18,13 +18,13 @@ GEM
18
18
  rails-dom-testing (~> 2.2)
19
19
  rails-html-sanitizer (~> 1.6)
20
20
  useragent (~> 0.16)
21
- actionview (8.1.2)
22
- activesupport (= 8.1.2)
21
+ actionview (8.1.3)
22
+ activesupport (= 8.1.3)
23
23
  builder (~> 3.1)
24
24
  erubi (~> 1.11)
25
25
  rails-dom-testing (~> 2.2)
26
26
  rails-html-sanitizer (~> 1.6)
27
- activesupport (8.1.2)
27
+ activesupport (8.1.3)
28
28
  base64
29
29
  bigdecimal
30
30
  concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -37,7 +37,7 @@ GEM
37
37
  securerandom (>= 0.3)
38
38
  tzinfo (~> 2.0, >= 2.0.5)
39
39
  uri (>= 0.13.1)
40
- addressable (2.8.9)
40
+ addressable (2.9.0)
41
41
  public_suffix (>= 2.0.2, < 8.0)
42
42
  ast (2.4.3)
43
43
  base64 (0.3.0)
@@ -123,8 +123,8 @@ GEM
123
123
  stringio
124
124
  public_suffix (7.0.5)
125
125
  racc (1.8.1)
126
- rack (3.2.5)
127
- rack-session (2.1.1)
126
+ rack (3.2.6)
127
+ rack-session (2.1.2)
128
128
  base64 (>= 0.1.0)
129
129
  rack (>= 3.0.0)
130
130
  rack-test (2.2.0)
@@ -138,9 +138,9 @@ GEM
138
138
  rails-html-sanitizer (1.7.0)
139
139
  loofah (~> 2.25)
140
140
  nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
141
- railties (8.1.2)
142
- actionpack (= 8.1.2)
143
- activesupport (= 8.1.2)
141
+ railties (8.1.3)
142
+ actionpack (= 8.1.3)
143
+ activesupport (= 8.1.3)
144
144
  irb (~> 1.13)
145
145
  rackup (>= 1.0.0)
146
146
  rake (>= 12.2)
@@ -137,31 +137,46 @@ module Rpdoc
137
137
  end
138
138
 
139
139
  def form_data_object_to_array(form_data, prefix: nil)
140
- array = []
141
- form_data.each do |key, value|
142
- key = "#{prefix}[#{key}]" if prefix.present?
143
- case value
144
- when Hash
145
- array += form_data_object_to_array(value, prefix: key)
146
- when Array
147
- value.each do |item|
148
- array += form_data_object_to_array(item, prefix: "#{key}[]")
149
- end
150
- when ActionDispatch::Http::UploadedFile
151
- array << {
152
- key: key,
153
- src: value.original_filename,
154
- type: "file"
155
- }
156
- else
157
- array << {
158
- key: key,
159
- value: value,
160
- type: "text"
161
- }
140
+ case form_data
141
+ when Hash
142
+ form_data.flat_map do |key, value|
143
+ nested_key = prefix.present? ? "#{prefix}[#{key}]" : key.to_s
144
+ form_data_object_to_array(value, prefix: nested_key)
145
+ end
146
+ when Array
147
+ form_data.flat_map do |item|
148
+ form_data_object_to_array(item, prefix: "#{prefix}[]")
162
149
  end
150
+ else
151
+ [build_form_data_entry(prefix, form_data)]
163
152
  end
164
- array
153
+ end
154
+
155
+ def build_form_data_entry(key, value)
156
+ return build_file_form_data_entry(key, value) if uploaded_file?(value)
157
+
158
+ build_text_form_data_entry(key, value)
159
+ end
160
+
161
+ def uploaded_file?(value)
162
+ value.is_a?(ActionDispatch::Http::UploadedFile) ||
163
+ (defined?(Rack::Test::UploadedFile) && value.is_a?(Rack::Test::UploadedFile))
164
+ end
165
+
166
+ def build_file_form_data_entry(key, file)
167
+ {
168
+ key: key,
169
+ src: file.original_filename,
170
+ type: "file"
171
+ }
172
+ end
173
+
174
+ def build_text_form_data_entry(key, value)
175
+ {
176
+ key: key,
177
+ value: value,
178
+ type: "text"
179
+ }
165
180
  end
166
181
  end
167
182
  end
data/lib/rpdoc/version.rb CHANGED
@@ -2,6 +2,5 @@
2
2
 
3
3
  # Root namespace for rpdoc gem components.
4
4
  module Rpdoc
5
- version_file = File.expand_path("../../VERSION.md", __dir__)
6
- VERSION = File.read(version_file, encoding: "UTF-8").strip
5
+ VERSION = "0.3.2"
7
6
  end
data/rpdoc.gemspec CHANGED
@@ -12,16 +12,20 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "Rpdoc is a simple Postman API documentation tool, which transforms RSpec examples to Postman collection."
13
13
  spec.homepage = "https://github.com/kdan-mobile-software-ltd/rpdoc"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.2.0")
16
16
  spec.metadata = {
17
17
  "source_code_uri" => "https://github.com/kdan-mobile-software-ltd/rpdoc",
18
- "changelog_uri" => "https://github.com/kdan-mobile-software-ltd/rpdoc/blob/master/CHANGELOG.md"
18
+ "changelog_uri" => "https://github.com/kdan-mobile-software-ltd/rpdoc/blob/master/CHANGELOG.md",
19
+ "rubygems_mfa_required" => "true"
19
20
  }
20
21
 
21
22
  # Specify which files should be added to the gem when it is released.
22
23
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
24
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
+ `git ls-files -z`
26
+ .split("\x0")
27
+ .select { |f| File.file?(f) }
28
+ .reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
29
  end
26
30
  spec.bindir = "exe"
27
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yuntai
@@ -75,7 +75,6 @@ files:
75
75
  - README.md
76
76
  - Rakefile
77
77
  - SECURITY.md
78
- - VERSION.md
79
78
  - bin/console
80
79
  - bin/setup
81
80
  - lib/generators/rpdoc/install_generator.rb
@@ -95,6 +94,7 @@ licenses:
95
94
  metadata:
96
95
  source_code_uri: https://github.com/kdan-mobile-software-ltd/rpdoc
97
96
  changelog_uri: https://github.com/kdan-mobile-software-ltd/rpdoc/blob/master/CHANGELOG.md
97
+ rubygems_mfa_required: 'true'
98
98
  rdoc_options: []
99
99
  require_paths:
100
100
  - lib
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - ">="
104
104
  - !ruby/object:Gem::Version
105
- version: 3.0.0
105
+ version: 3.2.0
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
data/VERSION.md DELETED
@@ -1 +0,0 @@
1
- 0.3.0