Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError (invalid byte sequence in UTF-8) #736 #737

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8c01bdf
update gems
hank-spokeo Mar 17, 2021
be3b512
Fix Ruby 2.7 keyword arguments deprecation warnings
r7kamura May 30, 2020
048cf96
use separate positional and keyword arguments
hank-spokeo Mar 17, 2021
8156595
update travis config
hank-spokeo Jun 10, 2021
43ca081
fix response_validation_spec.rb
hank-spokeo Jun 10, 2021
684cd53
use better method delegation
hank-spokeo Jun 10, 2021
4a050f2
Merge remote-tracking branch 'origin/master' into asdf
hank-spokeo Jul 21, 2021
68facba
update travis config
hank-spokeo Jul 21, 2021
5e0422d
ArgumentError (invalid byte sequence in UTF-8) #736. Remove invalid c…
aussiDavid Jan 19, 2022
05bab92
Update validator.rb (#739)
budnik Jan 31, 2022
31e568f
Deprecate Travis, run tests on GitHub Actions (#740)
mathieujobin Mar 7, 2022
82c6272
Merge remote-tracking branch 'origin/master' into asdf
hank-spokeo Mar 15, 2022
fbbca16
update github actions
hank-spokeo Mar 15, 2022
c925931
update gemfiles
hank-spokeo Mar 15, 2022
8593a5b
specify ruby 3.0 as a string
hank-spokeo Mar 15, 2022
e9072e6
fix typo
hank-spokeo Mar 15, 2022
e0fb98a
fix for LoadError: cannot load such file -- net/smtp
hank-spokeo Mar 15, 2022
b6dc427
tidy syntax
hank-spokeo Mar 15, 2022
05c0783
Update rel-eng
ofedoren Mar 16, 2022
bb85953
Bump to 0.5.20
ofedoren Mar 16, 2022
a83dea3
Merge pull request #716 from hank-spokeo/ruby-3.0
mathieujobin Mar 17, 2022
43613dd
dont bring all the rails module, only depends on railties
mathieujobin Jan 26, 2022
e8ded05
activerecord and activemailer should not be required
mathieujobin Jan 26, 2022
a43eea1
only depends on actionpack and actionsupport for testing
mathieujobin Mar 27, 2022
3697516
update gemfiles
mathieujobin Mar 27, 2022
85aa3b5
Merge pull request #741 from mathieujobin/only-depends-on-railties
mathieujobin Mar 27, 2022
be0029d
ArgumentError (invalid byte sequence in UTF-8) #736. Remove invalid c…
aussiDavid Jan 19, 2022
6b8ad5a
Merge branch 'master' of https://github.com/aussiDavid/apipie-rails
aussiDavid Mar 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: build

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby:
- 2.6
- 2.7
- '3.0'
- 3.1
gemfile:
- Gemfile.rails42
- Gemfile.rails52 # Min ruby 2.2.2
- Gemfile.rails60 # Min ruby 2.5.0
- Gemfile.rails61 # Min ruby 2.5.0
exclude:
- gemfile: Gemfile.rails42
ruby: 2.7
- gemfile: Gemfile.rails42
ruby: '3.0'
- gemfile: Gemfile.rails42
ruby: 3.1
- gemfile: Gemfile.rails52
ruby: 2.7
- gemfile: Gemfile.rails52
ruby: '3.0'
- gemfile: Gemfile.rails52
ruby: 3.1

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rspec
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Changelog
===========
## [v0.5.20](https://github.com/Apipie/apipie-rails/tree/v0.5.20) (2022-03-16)
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v0.5.19...v0.5.20)
* Update rel-eng (Oleh Fedorenko)
* Deprecate travis, run tests on github actions [#740](https://github.com/Apipie/apipie-rails/pull/740) (Mathieu Jobin)
* Update validator.rb [#739](https://github.com/Apipie/apipie-rails/pull/739) (Dmytro Budnyk)
* Fix wrong number of arguments for recorder#process [#725](https://github.com/Apipie/apipie-rails/pull/725) (rob mathews)
* Change "an" to "a" [#723](https://github.com/Apipie/apipie-rails/pull/723) (Naokimi)

## [v0.5.19](https://github.com/Apipie/apipie-rails/tree/v0.5.19) (2021-07-25)
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v0.5.18...v0.5.19)
* Add rel-eng notebook (Oleh Fedorenko)
Expand Down
7 changes: 0 additions & 7 deletions Gemfile.rails41

This file was deleted.

9 changes: 0 additions & 9 deletions Gemfile.rails50

This file was deleted.

9 changes: 0 additions & 9 deletions Gemfile.rails51

This file was deleted.

10 changes: 0 additions & 10 deletions Gemfile.rails60

This file was deleted.

10 changes: 0 additions & 10 deletions Gemfile.rails61

This file was deleted.

3 changes: 2 additions & 1 deletion apipie-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]

s.add_dependency "rails", ">= 4.1"
s.add_dependency "actionpack", ">= 4.1"
s.add_dependency "activesupport", ">= 4.1"
s.add_development_dependency "rspec-rails", "~> 3.0"
s.add_development_dependency "sqlite3"
s.add_development_dependency "minitest"
Expand Down
7 changes: 4 additions & 3 deletions Gemfile.rails42 → gemfiles/Gemfile.rails42
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
source "https://rubygems.org"

gemspec
gemspec path: '..'

gem 'rails', '~> 4.2.5'
gem 'actionpack', '~> 4.2.5'
gem 'activesupport', '~> 4.2.5'
gem 'mime-types', '~> 2.99.3'
gem 'sqlite3', '~> 1.3.6'

Expand All @@ -11,4 +12,4 @@ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1.0')
gem 'rdoc', '~> 4.2.2'
end

gem 'test_engine', path: 'spec/dummy/components/test_engine', group: :test
gem 'test_engine', path: '../spec/dummy/components/test_engine', group: :test
122 changes: 122 additions & 0 deletions gemfiles/Gemfile.rails42.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
PATH
remote: ../spec/dummy/components/test_engine
specs:
test_engine (0.0.1)

PATH
remote: ..
specs:
apipie-rails (0.5.20)
actionpack (>= 4.1)
activesupport (>= 4.1)

GEM
remote: https://rubygems.org/
specs:
RedCloth (4.3.2)
actionpack (4.2.11.3)
actionview (= 4.2.11.3)
activesupport (= 4.2.11.3)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.11.3)
activesupport (= 4.2.11.3)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activesupport (4.2.11.3)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
builder (3.2.4)
concurrent-ruby (1.1.10)
crass (1.0.6)
diff-lcs (1.5.0)
erubis (2.7.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json-schema (2.8.1)
addressable (>= 2.4)
loofah (2.15.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
maruku (0.7.3)
mime-types (2.99.3)
mini_portile2 (2.8.0)
minitest (5.15.0)
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
psych (4.0.3)
stringio
public_suffix (4.0.6)
racc (1.6.0)
rack (1.6.13)
rack-test (0.6.3)
rack (>= 1.0)
rails-deprecated_sanitizer (1.0.4)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (4.2.11.3)
actionpack (= 4.2.11.3)
activesupport (= 4.2.11.3)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.0.6)
rdoc (6.4.0)
psych (>= 4.0.0)
rspec-core (3.9.3)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-rails (3.9.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.4)
sqlite3 (1.3.13)
stringio (3.0.1)
thor (1.2.1)
thread_safe (0.3.6)
tzinfo (1.2.9)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
RedCloth
actionpack (~> 4.2.5)
activesupport (~> 4.2.5)
apipie-rails!
json-schema (~> 2.8)
maruku
mime-types (~> 2.99.3)
minitest
rake
rdoc
rspec-rails (~> 3.0)
sqlite3 (~> 1.3.6)
test_engine!

BUNDLED WITH
1.17.3
10 changes: 10 additions & 0 deletions gemfiles/Gemfile.rails52
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source "https://rubygems.org"

gemspec path: '..'

gem 'actionpack', '~> 5.2.6'
gem 'activesupport', '~> 5.2.6'
gem 'mime-types', '~> 2.99.3'
gem 'rails-controller-testing'

gem 'test_engine', path: '../spec/dummy/components/test_engine', group: :test
17 changes: 17 additions & 0 deletions gemfiles/Gemfile.rails60
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source "https://rubygems.org"

gemspec path: '..'

gem 'actionpack', '~> 6.0.4'
gem 'activesupport', '~> 6.0.4'
gem 'mime-types', '~> 3.0'
gem 'rails-controller-testing'
gem 'rspec-rails', '~> 5.0'

# net-smtp not included by default in Ruby 3.1
# Will be fixed by https://github.com/mikel/mail/pull/1439
if Gem.ruby_version >= Gem::Version.new("3.1.0")
gem 'net-smtp', require: false
end

gem 'test_engine', path: '../spec/dummy/components/test_engine', group: :test
17 changes: 17 additions & 0 deletions gemfiles/Gemfile.rails61
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source "https://rubygems.org"

gemspec path: '..'

gem 'actionpack', '~> 6.1.5'
gem 'activesupport', '~> 6.1.5'
gem 'mime-types', '~> 3.0'
gem 'rails-controller-testing'
gem 'rspec-rails', '~> 5.0'

# net-smtp not included by default in Ruby 3.1
# Will be fixed by https://github.com/mikel/mail/pull/1439
if Gem.ruby_version >= Gem::Version.new("3.1.0")
gem 'net-smtp', require: false
end

gem 'test_engine', path: '../spec/dummy/components/test_engine', group: :test
1 change: 1 addition & 0 deletions lib/apipie/extractor/recorder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def process(*, **) # action, parameters = nil, session = nil, flash = nil, http_
ensure
Apipie::Extractor.clean_call_recorder
end
ruby2_keywords :process if respond_to?(:ruby2_keywords, true)
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion lib/apipie/static_dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ def initialize(root)

def match?(path)
# Replace all null bytes
path = ::Rack::Utils.unescape(path || '').gsub(/\x0/, '')
path = ::Rack::Utils.unescape(path || '')
.encode(Encoding::UTF_8, invalid: :replace, replace: '')
.gsub(/\x0/, '')

full_path = path.empty? ? @root : File.join(@root, path)
paths = "#{full_path}#{ext}"
Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Apipie

module Validator

# to create new validator, inherit from Apipie::Validator::Base
# to create new validator, inherit from Apipie::Validator::BaseValidator
# and implement class method build and instance method validate
class BaseValidator

Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Apipie
VERSION = "0.5.19"
VERSION = "0.5.20"
end
Loading