Skip to content
Merged
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
5 changes: 3 additions & 2 deletions api_examples/upload_api/post_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

source_file = File.open('image.png')
Uploadcare::Uploader.upload(source_file, store: 'auto')
File.open('image.png') do |source_file|
Uploadcare::Uploader.upload(source_file, store: 'auto')
end
5 changes: 3 additions & 2 deletions api_examples/upload_api/post_multipart_complete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

source_file = File.open('image.png')
Uploadcare::Uploader.upload(source_file, store: 'auto')
File.open('image.png') do |source_file|
Uploadcare::Uploader.upload(source_file, store: 'auto')
end
5 changes: 3 additions & 2 deletions api_examples/upload_api/post_multipart_start.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

source_file = File.open('image.png')
Uploadcare::Uploader.upload(source_file, store: 'auto')
File.open('image.png') do |source_file|
Uploadcare::Uploader.upload(source_file, store: 'auto')
end
5 changes: 3 additions & 2 deletions api_examples/upload_api/put_presigned_url_x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

source_file = File.open('image.png')
Uploadcare::Uploader.upload(source_file, store: 'auto')
File.open('image.png') do |source_file|
Uploadcare::Uploader.upload(source_file, store: 'auto')
end
69 changes: 69 additions & 0 deletions context7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"$schema": "https://context7.com/schema/context7.json",
"projectTitle": "Uploadcare Ruby",
"description": "Ruby API client for Uploadcare uploads, file management, conversions, webhooks, add-ons, and signed CDN URLs.",
"url": "https://context7.com/uploadcare/uploadcare-ruby",
"public_key": "pk_WoigIc3LrHKMjLxnI0IA2",
"branch": "main",
"folders": [
"lib",
"api_examples"
],
"excludeFolders": [
".github",
"bin",
"spec",
"vendor",
"tmp",
"coverage",
"pkg",
"doc",
"*archive*",
"*archived*",
"old",
"docs/old",
"*deprecated*",
"*legacy*",
"*previous*",
"*outdated*",
"*superseded*"
],
"excludeFiles": [
"CHANGELOG.md",
"changelog.md",
"CHANGELOG.mdx",
"changelog.mdx",
"LICENSE",
"LICENSE.md",
"license.md",
"CODE_OF_CONDUCT.md",
"code_of_conduct.md",
"Gemfile",
"Rakefile",
"uploadcare-ruby.gemspec",
".rspec",
".rubocop.yml",
".yardopts"
],
"rules": [
"Install the gem as `uploadcare-ruby` and require it with `require \"uploadcare\"`.",
"Configure credentials with `Uploadcare.config.public_key` and `Uploadcare.config.secret_key` or the UPLOADCARE_PUBLIC_KEY and UPLOADCARE_SECRET_KEY environment variables.",
"Never hardcode real Uploadcare API keys in examples or application code; use environment variables or an application secrets store.",
"Use `Uploadcare::Uploader.upload` for automatic upload method selection and `Uploadcare::Uploader.multipart_upload` for explicit large-file multipart uploads.",
"Prefer public entity helpers such as `Uploadcare::File`, `Uploadcare::FileList`, `Uploadcare::Group`, `Uploadcare::Webhook`, and conversion methods over internal clients."
],
"previousVersions": [
{
"tag": "v4.4.3"
},
{
"tag": "v3.3.2"
},
{
"tag": "v2.1.2"
},
{
"tag": "v1.2.2"
}
]
}
10 changes: 6 additions & 4 deletions spec/support/generate_file_fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ def generate_big_file
return if File.file?('spec/fixtures/big.jpeg')

FileUtils.cp('spec/fixtures/kitten.jpeg', 'spec/fixtures/big.jpeg')
source_file = File.open('spec/fixtures/kitten.jpeg')
destination = File.open('spec/fixtures/big.jpeg', 'w')
destination.write(source_file.read)
destination.write('a' * 10 * 1024 * 1024)
File.open('spec/fixtures/kitten.jpeg') do |source_file|
File.open('spec/fixtures/big.jpeg', 'w') do |destination|
destination.write(source_file.read)
destination.write('a' * 10 * 1024 * 1024)
end
end
end
4 changes: 3 additions & 1 deletion spec/uploadcare/entity/decorator/paginator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ module Decorator
fl_path = fl_with_params.delete(:next)
previous_page_path = previous_page.delete(:next)
expect(fl_with_params).to eq(previous_page)
expect(CGI.parse(URI.parse(fl_path).query)).to eq(CGI.parse(URI.parse(previous_page_path).query))
fl_query = URI.decode_www_form(URI.parse(fl_path).query).sort
previous_page_query = URI.decode_www_form(URI.parse(previous_page_path).query).sort
expect(fl_query).to eq(previous_page_query)
end
end
end
Expand Down
Loading