rpdoc 0.2.0 → 0.2.2

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: 963515874d698d5e0dc7a13f81ac47cfb669022c84e91561cab91c0a23963774
4
- data.tar.gz: ac8543e04985d09166790d1f4604478995788cd10a5f38d95ba8b9e1637e6599
3
+ metadata.gz: 43e4c8339b0e0c0284081a6fc379ba6c7f32cd2da141e183f9016ed043d5652c
4
+ data.tar.gz: 2e30093e3e338f2668fb44b18e94d907062fd1fa01c943c8f1c33c10cf4fb0bb
5
5
  SHA512:
6
- metadata.gz: 1ca60eac1301f3aa5d320effbbb1065ed0a78374fc897793841ade037abce37a5d45ae6ae74bdbf4e94b222a2fb8d70cedfaa9fc4078a5cda646ee285d7ef8d9
7
- data.tar.gz: be9d0823c2ff93d0709b523534e9705fcd0ad5048cc4af92fc05f9f096d5cec36300bce1b3c8087fe06845e166efef6c2a996c5936dc591ba13e5e63e9b7f204
6
+ metadata.gz: 2e396d921816259e7055d7b78338c163a3d5f00e022487ef1517f10ae2fbd957a0a1148d0d1a87e03d1cab2ca39dd6cd11343946c9ded6fb5c731b9344270ea4
7
+ data.tar.gz: d97e2ff1940687757a3576705f548678da23152c7e6ffbd0264ef958e69b0e83534801f70b833758ac4aa557cd665a7fd9952d77229fc9eeda25daab3dc69dae
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.2.2] - 2024-06-28
2
+ - Fix push_and_update strategy bug.
3
+
4
+ ## [0.2.1] - 2024-04-11
5
+ - Fix `rspec_response_identifier` option bug.
6
+ - Fix path bug for redirected requests and `push_and_update` strategy.
7
+
1
8
  ## [0.2.0] - 2024-04-02
2
9
  - Add `rspec_root`, `rspec_response_allow_headers`, and `rspec_response_identifier` options to configuration.
3
10
  - Add public method `merge!` for PostmanCollection.
data/VERSION.md CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.2
@@ -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))
@@ -39,7 +39,7 @@ module Rpdoc
39
39
  remote_collection = PostmanCollection.new(data: remote_collection_data)
40
40
  remote_collection.clean_generated_responses!
41
41
  remote_collection.merge!(self)
42
- @requester.http_send(:put, path, remote_collection.data, headers)
42
+ @requester.http_send(:put, path, remote_collection.data, headers, content_type_charset: nil)
43
43
  end
44
44
 
45
45
  def save(path: nil)
@@ -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.2"
5
5
  end
data/rpdoc.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency 'json_requester', '~> 1.0'
30
+ spec.add_dependency 'json_requester', '~> 1.1.1'
31
31
  spec.add_dependency 'activesupport', '~> 6.1'
32
32
 
33
33
  spec.add_development_dependency 'railties', '~> 6.1.4'
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.2
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-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_requester
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: 1.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: 1.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement