faraday-encoding 0.0.5 → 0.0.6

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
- SHA1:
3
- metadata.gz: 55ff9d7269e8b22f5d96fa27d27c7c5075dff4db
4
- data.tar.gz: 7e9bfe79504e4179249ac125f262c83786252189
2
+ SHA256:
3
+ metadata.gz: b81c8ee628ff9ecdf09fe773916a5a730ff445fabc37b0036860b3c56d64db11
4
+ data.tar.gz: 982d1c9f2e4b4e5b2955361dce742c69b5500f0bf51c5855fb69f481f977c118
5
5
  SHA512:
6
- metadata.gz: 1d9c834b0e4402e48553e6af76dac3cc7979d67ce8a9ae834f6d6e26399be1f0ccb37feb3641d22c30259988fbb851e117c830e43a642086853ad5dceaf01b30
7
- data.tar.gz: 70952c2f1c80132b38379becbc1dc2637a5658ca4b404b02c27262d9f54a5a47063511c29bae02dbd1aa2344730a388e386497c0c0afc658a019174e1357b98b
6
+ metadata.gz: 5fda32ac5631299869711cfcdf0a38b39d5dc5eb98a207977818dc039ee8197708af9554212c9112641fb20cdb0f8b034829643b7b3020a356bcb884305d5121
7
+ data.tar.gz: 60231d81a6e89395711d845a491454592538485ccc2645b98a8e053560b5510042664c8b655532979b0ab3d6cd780c819915a2e8336cc011392728f6672ffe48
@@ -0,0 +1,33 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+
15
+ jobs:
16
+ test:
17
+
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ matrix:
21
+ ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3' ]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v2
25
+ - name: Set up Ruby
26
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
27
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
32
+ - name: Run tests
33
+ run: bundle exec rake
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Faraday::Encoding
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/faraday-encoding.svg)](http://badge.fury.io/rb/faraday-encoding)
4
- [![Build Status](https://travis-ci.org/ma2gedev/faraday-encoding.svg)](https://travis-ci.org/ma2gedev/faraday-encoding)
4
+ [![Build Status](https://github.com/ma2gedev/faraday-encoding/workflows/Ruby/badge.svg?branch=master)](https://github.com/ma2gedev/faraday-encoding/actions?query=workflow%3ARuby)
5
5
 
6
6
  A Faraday Middleware sets body encoding when specified by server.
7
7
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "faraday-encoding"
7
- spec.version = "0.0.5"
7
+ spec.version = "0.0.6"
8
8
  spec.authors = ["Takayuki Matsubara"]
9
9
  spec.email = ["takayuki.1229@gmail.com"]
10
10
  spec.summary = %q{A Faraday Middleware sets body encoding when specified by server.}
@@ -17,8 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", "~> 1.7"
21
- spec.add_development_dependency "rake", "~> 10.0"
20
+ spec.add_development_dependency "rake", ">= 0"
22
21
  spec.add_development_dependency "rspec"
23
22
  spec.add_development_dependency 'faraday_middleware', '~> 0.10'
24
23
 
@@ -13,7 +13,7 @@ module Faraday
13
13
  @env = env
14
14
  if encoding = content_charset
15
15
  env[:body] = env[:body].dup if env[:body].frozen?
16
- env[:body].force_encoding(encoding)
16
+ env[:body].force_encoding(encoding) if !env[:body].nil?
17
17
  end
18
18
  end
19
19
  end
@@ -17,6 +17,9 @@ describe Faraday::Encoding do
17
17
  stub.get('/redirected') do
18
18
  [redirected_status, redirected_headers, redirected_body]
19
19
  end
20
+ stub.post('/post') do
21
+ [post_response_status, post_response_headers, post_response_body]
22
+ end
20
23
  end
21
24
  end
22
25
 
@@ -109,4 +112,18 @@ describe Faraday::Encoding do
109
112
  expect(response.body.encoding).to eq(Encoding::ASCII_8BIT)
110
113
  end
111
114
  end
115
+
116
+ context 'ignore with an empty body' do
117
+ let(:post_response_status) { 204 }
118
+ let(:post_response_headers) do
119
+ { 'content-type' => "text/plain; charset=utf-8" }
120
+ end
121
+ let(:post_response_body) do
122
+ nil
123
+ end
124
+
125
+ it 'skips `force_encoding`' do
126
+ expect { client.post('/post') }.not_to raise_error
127
+ end
128
+ end
112
129
  end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-encoding
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takayuki Matsubara
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-12 00:00:00.000000000 Z
11
+ date: 2024-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.7'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.7'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - "~>"
17
+ - - ">="
32
18
  - !ruby/object:Gem::Version
33
- version: '10.0'
19
+ version: '0'
34
20
  type: :development
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - "~>"
24
+ - - ">="
39
25
  - !ruby/object:Gem::Version
40
- version: '10.0'
26
+ version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rspec
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -87,8 +73,8 @@ executables: []
87
73
  extensions: []
88
74
  extra_rdoc_files: []
89
75
  files:
76
+ - ".github/workflows/ruby.yml"
90
77
  - ".gitignore"
91
- - ".travis.yml"
92
78
  - Gemfile
93
79
  - LICENSE.txt
94
80
  - README.md
@@ -102,7 +88,7 @@ homepage: https://github.com/ma2gedev/faraday-encoding
102
88
  licenses:
103
89
  - MIT
104
90
  metadata: {}
105
- post_install_message:
91
+ post_install_message:
106
92
  rdoc_options: []
107
93
  require_paths:
108
94
  - lib
@@ -117,9 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  requirements: []
120
- rubyforge_project:
121
- rubygems_version: 2.6.11
122
- signing_key:
106
+ rubygems_version: 3.5.3
107
+ signing_key:
123
108
  specification_version: 4
124
109
  summary: A Faraday Middleware sets body encoding when specified by server.
125
110
  test_files:
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.8
4
- - 2.2.4
5
- - 2.3.0
6
- sudo: false
7
- cache: bundler