rpdoc 0.2.0 → 0.2.1

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: 963515874d698d5e0dc7a13f81ac47cfb669022c84e91561cab91c0a23963774
4
- data.tar.gz: ac8543e04985d09166790d1f4604478995788cd10a5f38d95ba8b9e1637e6599
3
+ metadata.gz: 614c1855e12f3279570419fc23b7ce0af9849a4f2a8cf9a333b8f53013927cde
4
+ data.tar.gz: f0b61a84a3e26b447227368ccd2fae5e4723f4d15c2b75b42df569b005fd057b
5
5
  SHA512:
6
- metadata.gz: 1ca60eac1301f3aa5d320effbbb1065ed0a78374fc897793841ade037abce37a5d45ae6ae74bdbf4e94b222a2fb8d70cedfaa9fc4078a5cda646ee285d7ef8d9
7
- data.tar.gz: be9d0823c2ff93d0709b523534e9705fcd0ad5048cc4af92fc05f9f096d5cec36300bce1b3c8087fe06845e166efef6c2a996c5936dc591ba13e5e63e9b7f204
6
+ metadata.gz: 8dd60eaf51e2c3a466782a13c028a0a1f4ff99540b73c435ae7b9e4b4c22893bfdb7a405906639995d017d21a3906fae066d5e536ccc3cc91820921603806be6
7
+ data.tar.gz: c6e1c5cb2c221f484905182f112151621d73c2226b9383d26d60f63df8287a807e6ef49a50e53fa3897de79af3f1d9fc39bf47532481800e47b392435318f46d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.2.1] - 2024-04-11
2
+ - Fix `rspec_response_identifier` option bug.
3
+ - Fix path bug for redirected requests and `push_and_update` strategy.
4
+
1
5
  ## [0.2.0] - 2024-04-02
2
6
  - Add `rspec_root`, `rspec_response_allow_headers`, and `rspec_response_identifier` options to configuration.
3
7
  - Add public method `merge!` for PostmanCollection.
data/VERSION.md CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -66,7 +66,7 @@ module Rpdoc
66
66
  def valid?
67
67
  return true unless @rpdoc_enable && @rpdoc_auto_push
68
68
  return false if @postman_apikey.nil?
69
- return false unless RSPEC_RESPONSE_IDENTIFIERS.include?(@rspec_response_identifier.to_sym)
69
+ return false unless RSPEC_RESPONSE_IDENTIFIERS.include?(@rspec_response_identifier&.to_sym)
70
70
  return false unless RPDOC_AUTO_PUSH_STRATEGIES.include?(@rpdoc_auto_push_strategy.to_sym)
71
71
  return false if @rpdoc_auto_push_strategy == :push_and_update && @collection_uid.nil?
72
72
  return false if @rpdoc_folder_ordering.present? && (RPDOC_FOLDER_ORDERING.exclude?(@rpdoc_folder_ordering) || !@rpdoc_folder_ordering.is_a?(Array))
@@ -144,7 +144,7 @@ module Rpdoc
144
144
  item_hash[from_item_name][:description] = from_item[:description]
145
145
  insert_generated_responses_into(item_hash[from_item_name][:item], from_collection_items: from_item[:item].to_a)
146
146
  elsif from_item.has_key?(:response) && item_hash[from_item_name].has_key?(:response)
147
- item_hash[from_item_name][:request][:description] = from_item[:request][:description]
147
+ item_hash[from_item_name][:request] = from_item[:request].deep_dup
148
148
  item_hash[from_item_name][:response] += from_item[:response].deep_dup
149
149
  else
150
150
  collection_items << from_item.deep_dup
@@ -84,13 +84,15 @@ module Rpdoc
84
84
  text: 'text'
85
85
  }
86
86
  end.compact
87
+
88
+ original_path = @rspec_request.original_fullpath.split('?').first # use original_fullpath instead of path to avoid request being redirected
87
89
  {
88
90
  method: @rspec_request.method,
89
91
  header: filter_headers,
90
92
  url: {
91
- raw: "#{@configuration.rspec_server_host}#{@rspec_request.path}",
93
+ raw: "#{@configuration.rspec_server_host}#{original_path}",
92
94
  host: [@configuration.rspec_server_host],
93
- path: @rspec_request.path.split('/'),
95
+ path: original_path.split('/'),
94
96
  query: query_string
95
97
  },
96
98
  body: original_request_data_body
data/lib/rpdoc/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rpdoc
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yuntai
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-02 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_requester