Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby_version: [2.6, 2.7]
ruby_version: [2.7, 3.0, 3.1, 3.2, 3.3, 3.4]
env:
CI: true
steps:
Expand Down
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require: rubocop-rspec
plugins:
- rubocop-rspec

AllCops:
DisplayCopNames: true
Expand Down Expand Up @@ -56,6 +57,9 @@ Lint/RaiseException:
Lint/StructNewOverride:
Enabled: false

Lint/RedundantDirGlobSort:
Enabled: false

Metrics/ParameterLists:
Max: 7

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
2.7.8
55 changes: 32 additions & 23 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
veryfi (2.0.0)
veryfi (3.0.0)
base64 (~> 0.1)
faraday (>= 1.7, < 3.0)
openssl (>= 2.2, < 4.1)
Expand All @@ -17,8 +17,8 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.2.0)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (3.1.8)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
Expand All @@ -38,21 +38,25 @@ GEM
hashdiff (1.1.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.18.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
method_source (1.1.0)
minitest (5.23.1)
openssl (4.0.0)
parallel (1.24.0)
parser (3.3.2.0)
parallel (1.27.0)
parser (3.3.10.1)
ast (~> 2.4.1)
racc
prism (1.8.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.5)
racc (1.8.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
regexp_parser (2.11.3)
rexml (3.4.4)
rspec (3.13.0)
rspec-core (~> 3.13.0)
Expand All @@ -70,20 +74,23 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (0.93.1)
rubocop (1.82.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.6.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.48.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-rspec (1.44.1)
rubocop (~> 0.87)
rubocop-ast (>= 0.7.1)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-rspec (3.9.0)
lint_roller (~> 1.1)
rubocop (~> 1.81)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
Expand All @@ -96,7 +103,9 @@ GEM
thor (1.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (1.8.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
vcr (6.1.0)
webmock (3.23.1)
addressable (>= 2.8.0)
Expand All @@ -112,20 +121,20 @@ PLATFORMS

DEPENDENCIES
activesupport (~> 6.0)
bundler (~> 2.2)
bundler (~> 2.4)
bundler-audit (~> 0.9)
pry (~> 0.14)
rake (~> 13.0)
rexml (~> 3.4.4)
rspec (~> 3.9)
rspec-its (~> 1.3)
rubocop (~> 0.82)
rubocop-rspec (~> 1.38)
rubocop (~> 1.65)
rubocop-rspec (~> 3.0)
simplecov (~> 0.21)
simplecov-badge (~> 2.0)
vcr (~> 6.0)
veryfi!
webmock (~> 3.14)

BUNDLED WITH
2.2.26
2.4.22
4 changes: 2 additions & 2 deletions lib/veryfi/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ def generate_headers(params = {})
def default_headers
{
"User-Agent": "Ruby Veryfi-Ruby/#{Veryfi::VERSION}",
"Accept": "application/json",
Accept: "application/json",
"Content-Type": "application/json",
"Client-Id": client_id,
"Authorization": "apikey #{username}:#{api_key}"
Authorization: "apikey #{username}:#{api_key}"
}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/veryfi/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Veryfi
VERSION = "2.0.0"
VERSION = "3.0.0"
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# call SimpleCov::Formatter::BadgeFormatter after the normal HTMLFormatter
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::BadgeFormatter,
SimpleCov::Formatter::BadgeFormatter
]
end
end
Expand Down
36 changes: 18 additions & 18 deletions spec/veryfi/document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@

let(:document_params) do
{
"file_path": Dir.pwd + "/spec/fixtures/receipt.jpg",
"auto_delete": true,
"boost_mode": true,
"async": false,
"external_id": "123456789",
"max_pages_to_process": 10,
"tags": [
file_path: Dir.pwd + "/spec/fixtures/receipt.jpg",
auto_delete: true,
boost_mode: true,
async: false,
external_id: "123456789",
max_pages_to_process: 10,
tags: [
"tag1"
],
"categories": [
categories: [
"Advertising & Marketing",
"Automotive"
]
Expand Down Expand Up @@ -91,20 +91,20 @@

let(:document_params) do
{
"file_name": "invoice.png",
"file_url": "https://raw.githubusercontent.com/veryfi/veryfi-python/master/tests/assets/receipt_public.jpg",
"file_urls": [
file_name: "invoice.png",
file_url: "https://raw.githubusercontent.com/veryfi/veryfi-python/master/tests/assets/receipt_public.jpg",
file_urls: [
"https://raw.githubusercontent.com/veryfi/veryfi-python/master/tests/assets/receipt_public.jpg"
],
"auto_delete": true,
"boost_mode": true,
"async": false,
"external_id": "123456789",
"max_pages_to_process": 10,
"tags": [
auto_delete: true,
boost_mode: true,
async: false,
external_id: "123456789",
max_pages_to_process: 10,
tags: [
"tag1"
],
"categories": [
categories: [
"Advertising & Marketing",
"Automotive"
]
Expand Down
40 changes: 20 additions & 20 deletions spec/veryfi/line_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@

let(:line_item_params) do
{
"date": "",
"description": "98 Meat Pty Xchz",
"discount": 0,
"end_date": "",
"hsn": "",
"order": 1,
"price": 12.5,
"quantity": 1,
"reference": "",
"section": "",
"sku": "038902058959",
"start_date": "",
"tags": [
date: "",
description: "98 Meat Pty Xchz",
discount: 0,
end_date: "",
hsn: "",
order: 1,
price: 12.5,
quantity: 1,
reference: "",
section: "",
sku: "038902058959",
start_date: "",
tags: [
{
"id": 757_123,
"name": "tag"
id: 757_123,
name: "tag"
}
],
"tax": 7.66,
"tax_rate": 7.66,
"total": 88.2,
"type": "food",
"unit_of_measure": ""
tax: 7.66,
tax_rate: 7.66,
total: 88.2,
type: "food",
unit_of_measure: ""
}
end

Expand Down
10 changes: 4 additions & 6 deletions spec/veryfi/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
let(:expected_headers) do
{
"User-Agent": "Ruby Veryfi-Ruby/#{Veryfi::VERSION}",
"Accept": "application/json",
Accept: "application/json",
"Content-Type": "application/json",
"Client-Id": "fBvJLm1zCJ8Doxf94mMrpbrkDp8nr",
"Authorization": "apikey john_doe:123456"
Authorization: "apikey john_doe:123456"
}
end

Expand All @@ -24,7 +24,7 @@

response = client.document.all

expect(response).to match_array([{ "id" => 1 }])
expect(response).to contain_exactly({ "id" => 1 })
end
end

Expand Down Expand Up @@ -78,9 +78,7 @@
"details": [
{
"type": "value_error",
"loc": [

],
"loc": [],
"msg": "Value error, Only one of ..."
}
]
Expand Down
6 changes: 3 additions & 3 deletions veryfi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ Gem::Specification.new do |spec|

spec.add_dependency "faraday", ">= 1.7", "< 3.0"

spec.add_development_dependency "bundler", "~> 2.2"
spec.add_development_dependency "bundler", "~> 2.4"
spec.add_development_dependency "bundler-audit", "~> 0.9"
spec.add_development_dependency "pry", "~> 0.14"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.9"
spec.add_development_dependency "rspec-its", "~> 1.3"
spec.add_development_dependency "rubocop", "~> 0.82"
spec.add_development_dependency "rubocop-rspec", "~> 1.38"
spec.add_development_dependency "rubocop", "~> 1.65"
spec.add_development_dependency "rubocop-rspec", "~> 3.0"
spec.add_development_dependency "simplecov", "~> 0.21"
spec.add_development_dependency "simplecov-badge", "~> 2.0"
spec.add_development_dependency "vcr", "~> 6.0"
Expand Down