Sha256: c96af04b5ff2e776423958a0918f643b3e2fdb86182fd83cfc5016808be68cff
Contents?: true
Size: 940 Bytes
Versions: 2
Compression:
Stored size: 940 Bytes
Contents
# frozen_string_literal: true require 'thor' module FlatironS3Uploader class CLI < Thor option :bucket, required: true, desc: 'S3 bucket' option :directory, desc: '(optional) Directory within the S3 bucket' option :width, type: :numeric, desc: '(optional) Resize image to the specified width' option :height, type: :numeric, desc: '(optional) Resize image to the specified height' desc 'upload', 'Upload an image to S3' long_desc <<-LONGDESC Uploads an image to a S3 bucket; sets public read permission; and optionally resizes it. Example usage: $ flatiron-s3-uploader upload 'path/to/file.png' --bucket 'curriculum-content' --directory 'phase-0/lab' --width 600 # => https://curriculum-content.s3.amazonaws.com/phase-0/lab/file.png LONGDESC def upload(filepath) bucket = options['bucket'] puts FlatironS3Uploader.upload(filepath, bucket, options) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
flatiron-s3-uploader-0.1.2 | lib/flatiron_s3_uploader/cli.rb |
flatiron-s3-uploader-0.1.1 | lib/flatiron_s3_uploader/cli.rb |