
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
flatiron-s3-uploader
Advanced tools
A tool for resizing and uploading images to AWS S3.
$ gem install flatiron-s3-uploader
The S3 upload functionality requires that you have the following environment variables set:
ENV['AWS_ACCESS_KEY_ID']
ENV['AWS_SECRET_ACCESS_KEY']
ENV['AWS_REGION']
The core functionality of uploading (and optionally resizing) images can be
performed one of two ways. To use this Ruby gem in other Ruby projects, use the
FlatironS3Uploader.upload
method directly:
# Upload a file to a specified S3 bucket
FlatironS3Uploader.upload('path/to/image.png', 'bucket-name')
# => "https://bucket-name.s3.amazonaws.com/image.png"
# Upload and resize an image
FlatironS3Uploader.upload('path/to/image.png', 'bucket-name', { width: 400, directory: 'folder/subfolder' })
# => "https://bucket-name.s3.amazonaws.com/folder/subfolder/image.png"
The FlatironS3Uploader.upload(path, bucket, options = {})
method takes the
following parameters:
path
: The file location of the image to be uploaded.bucket
: The name of the S3 bucket.options
:
width
: The width of the resized image. If a +height+ is not specified, the
height will scale based on the specified width.height
: The height of the resized image. If a +width+ is not specified, the
width will scale based on the specified height.directory
: The directory of the S3 bucket to upload to (i.e.
'phase-3/lab-name')You can also use the gem directly from the command line:
$ flatiron-s3-uploader upload path/to/image.png --bucket bucket-name --width 400 --directory folder/subfolder
After checking out the repo, run bin/setup
to install dependencies. Then, run
bundle exec rspec
to run the tests. You can also run bin/console
for an
interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To
release a new version, update the version number in version.rb
, and then run
bundle exec rake release
, which will create a git tag for the version, push
git commits and the created tag, and push the .gem
file to
rubygems.org.
This project uses Rubocop to enforce consistent styling
via a pre-commit hook, so any time you
make a commit, your code will be linted. For VSCode users, it's suggested that
you install the
Ruby VSCode extension
and enable linting in VSCode via the settings.json
file so that you can see
linting errors before committing your code:
{
"ruby.lint": {
"rubocop": {
"useBundler": true
}
},
"ruby.format": "rubocop"
}
You can also run Rubocop manually to get a list of any issues:
$ bundle exec rubocop
Bug reports and pull requests are welcome on GitHub at https://github.com/ihollander/flatiron-s3-uploader. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the FlatironS3Uploader project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that flatiron-s3-uploader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.